![]() |
LiteFX 0.3.1.2022
Computer Graphics Engine
|
Describes a root builder. More...
#include <containers.hpp>
Public Types | |
using | derived_type = TDerived |
using | instance_type = T |
using | parent_type = std::nullptr_t |
using | pointer_type = TPointer |
using | builder_type = Builder< derived_type, instance_type, parent_type, pointer_type > |
Public Member Functions | |
const T * | instance () const noexcept |
Returns a pointer to the current instance of the object that is built by the builder. More... | |
Builder (TPointer &&instance) noexcept | |
Initializes the builder instance. More... | |
Builder (builder_type &&_other) noexcept | |
Initializes the builder instance by taking over another instance. More... | |
Builder (const builder_type &)=delete | |
virtual | ~Builder () noexcept=default |
template<typename TInstance > | |
void | use (pointer_type &&)=delete |
Called by child builders to pass a constructed object back to the parent builder. More... | |
operator TPointer && () | |
Calls build and returns the instance. More... | |
Protected Member Functions | |
T * | instance () noexcept |
Returns a pointer to the current instance of the object that is built by the builder. More... | |
virtual void | build () |
Can be overwritten to perform any pre-construction work before the builder returns the final object instance. More... | |
Describes a root builder.
TDerived | The concrete implementation of the builder itself. |
T | The type of the object the builder builds. |
TPointer | The type of the pointer, used to access the instance of T this builder builds. |
using LiteFX::Builder< TDerived, T, std::nullptr_t, typename TPointer >::builder_type = Builder<derived_type, instance_type, parent_type, pointer_type> |
using LiteFX::Builder< TDerived, T, std::nullptr_t, typename TPointer >::derived_type = TDerived |
using LiteFX::Builder< TDerived, T, std::nullptr_t, typename TPointer >::instance_type = T |
using LiteFX::Builder< TDerived, T, std::nullptr_t, typename TPointer >::parent_type = std::nullptr_t |
using LiteFX::Builder< TDerived, T, std::nullptr_t, typename TPointer >::pointer_type = TPointer |
|
inlineexplicitnoexcept |
Initializes the builder instance.
instance | The instance of the object to build. |
|
inlinenoexcept |
Initializes the builder instance by taking over another instance.
_other | The instance of another builder object to take over. |
|
delete |
|
virtualdefaultnoexcept |
|
inlineprotectedvirtual |
Can be overwritten to perform any pre-construction work before the builder returns the final object instance.
|
inlinenoexcept |
Returns a pointer to the current instance of the object that is built by the builder.
|
inlineprotectednoexcept |
Returns a pointer to the current instance of the object that is built by the builder.
|
inline |
Calls build and returns the instance.
|
delete |
Called by child builders to pass a constructed object back to the parent builder.
This method must be implemented for each child builder, a builder can create. This introduces a hard dependency between child and parent builders. It is not possible to define a child builder without implementing the counter part in the parent builder.