Skip to content

DesignPattern🔗

Classes🔗

Name
class DesignPattern::Command
class DesignPattern::Command< void >
class DesignPattern::Creation
This pattern can be used if you write an abstraction where you have to throw an exception in the constructor when you for instance would like to manage a resource and the constructor was unable to acquire that resource. In this case you inherit from [Creation]() and your class has three more static factory methods - create, placementCreate and verify. create forwards all arguments to the underlying class constructor and if the construction was successful an expected containing the type is returned, otherwise an error value which describes the error. Additionally, this class is providing two protected member variables m_isInitialized and m_errorValue. The user always has to set m_isInitialized to true when the object construction was successful otherwise one sets it to false and write the corresponding error cause in the provided m_errorValue variable which is then returned to the user.

Types🔗

Name
using Command< void > Action

Types Documentation🔗

using Action🔗

using DesignPattern::Action = typedef Command<void>;

Updated on 17 June 2021 at 11:15:26 CEST