diff options
author | crupest <crupest@outlook.com> | 2018-09-19 01:15:01 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-19 01:15:01 +0800 |
commit | 85bb4d466efeb2540363065d7c0987a9d60f70e9 (patch) | |
tree | ea5e5aa738afb37a2d3bc4e74f9be64c15f3d188 /CruUI/builder.h | |
parent | 4710715102df3806479985679bd8048631ccaab5 (diff) | |
download | cru-85bb4d466efeb2540363065d7c0987a9d60f70e9.tar.gz cru-85bb4d466efeb2540363065d7c0987a9d60f70e9.tar.bz2 cru-85bb4d466efeb2540363065d7c0987a9d60f70e9.zip |
finish animation!!!
Diffstat (limited to 'CruUI/builder.h')
-rw-r--r-- | CruUI/builder.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/CruUI/builder.h b/CruUI/builder.h deleted file mode 100644 index 3ae8724e..00000000 --- a/CruUI/builder.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "base.h" - -namespace cru -{ - template<typename T> - class OneTimeBuilder : public Object - { - protected: - OneTimeBuilder() = default; - - public: - OneTimeBuilder(const OneTimeBuilder& other) = delete; - OneTimeBuilder(OneTimeBuilder&& other) = delete; - OneTimeBuilder& operator=(const OneTimeBuilder& other) = delete; - OneTimeBuilder& operator=(OneTimeBuilder&& other) = delete; - virtual ~OneTimeBuilder() = default; - - T* Create() - { - if (is_valid_) - { - is_valid_ = false; - return OnCreate(); - } - else - throw std::runtime_error("OneTimeBuilder is invalid."); - } - - bool IsValid() const - { - return is_valid_; - } - - protected: - virtual T* OnCreate() = 0; - - private: - bool is_valid_ = true; - }; -} |