blueprints.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_UTILITIES_BLUEPRINT_FACTORY_HPP_
13 #define ECL_UTILITIES_BLUEPRINT_FACTORY_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
20 
21 /*****************************************************************************
22 ** Namespaces
23 *****************************************************************************/
24 
25 namespace ecl {
26 
46 template <typename Derived>
47 class BluePrint {
48 public:
54  BluePrint() {
55  ecl_compile_time_concept_check(BluePrintConcept<Derived>);
56  }
71  template <typename BaseType>
72  BaseType implementInstantiate() {
73  return static_cast<Derived*>(this)->instantiate();
74  }
90  template <typename BaseType>
91  void implementApply(BaseType& object) const {
92  static_cast<const Derived*>(this)->apply(object);
93  }
94 
95  virtual ~BluePrint() {}
96 };
104 template <typename Base>
105 class BluePrintFactory {
106  private:
110  BluePrintFactory() {};
111  virtual ~BluePrintFactory() {};
112 };
113 
114 }; // namespace ecl
115 
116 
117 #endif /* ECL_UTILITIES_BLUEPRINT_FACTORY_HPP_ */
ecl_compile_time_concept_check
#define ecl_compile_time_concept_check(Model)
ecl::BluePrint::implementInstantiate
BaseType implementInstantiate()
Use the blueprint to instantiate a new object.
Definition: blueprints.hpp:84
ecl::BluePrintFactory::~BluePrintFactory
virtual ~BluePrintFactory()
Definition: blueprints.hpp:117
ecl::BluePrint::~BluePrint
virtual ~BluePrint()
Definition: blueprints.hpp:107
blueprints.hpp
ecl::BluePrint::BluePrint
BluePrint()
Blueprint concept checking.
Definition: blueprints.hpp:66
ecl::BluePrint::implementApply
void implementApply(BaseType &object) const
Apply the blueprint rules to an existing object.
Definition: blueprints.hpp:103
ecl::BluePrintFactory::BluePrintFactory
BluePrintFactory()
Default constructor that locks this class from being used directly.
Definition: blueprints.hpp:116
ecl
Embedded control libraries.


ecl_utilities
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:32