aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/no_child_control.hpp
blob: 62a9fa8d29e7729785f3f8d7e7facfd18768b57c (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