aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/NoChildControl.hpp
blob: 1a31ae7e9ac14bc3c74c15f28076692c4b892fec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#pragma once
#include "Control.hpp"

namespace cru::ui {
class NoChildControl : public Control {
 private:
  static const std::vector<Control*> empty_control_vector;

 protected:
  NoChildControl() = default;

 public:
  NoChildControl(const NoChildControl& other) = delete;
  NoChildControl(NoChildControl&& other) = delete;
  NoChildControl& operator=(const NoChildControl& other) = delete;
  NoChildControl& operator=(NoChildControl&& other) = delete;
  ~NoChildControl() override = default;

 protected:
  const std::vector<Control*>& GetChildren() const override final {
    return empty_control_vector;
  }
};
}  // namespace cru::ui