From d86a71f79afe0e4dac768f61d6bff690567aca5b Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 24 May 2020 01:40:02 +0800 Subject: ... --- include/cru/ui/NoChildControl.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/cru/ui/NoChildControl.hpp (limited to 'include/cru/ui/NoChildControl.hpp') diff --git a/include/cru/ui/NoChildControl.hpp b/include/cru/ui/NoChildControl.hpp new file mode 100644 index 00000000..1a31ae7e --- /dev/null +++ b/include/cru/ui/NoChildControl.hpp @@ -0,0 +1,24 @@ +#pragma once +#include "Control.hpp" + +namespace cru::ui { +class NoChildControl : public Control { + private: + static const std::vector 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& GetChildren() const override final { + return empty_control_vector; + } +}; +} // namespace cru::ui -- cgit v1.2.3