libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
A factory that manufactures a new, unique instance of the specified return-type for a specified key that has been registered with the factory. More...
#include <factory.hpp>
Public Types | |
typedef base< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ > | base_t |
typedef base_t::id_type | id_type |
typedef base_t::created_type | created_type |
![]() | |
typedef rapid_insert_lookup::multimap< ID_, std::unique_ptr< Obj_ >(__fastcall *)(void) > | container_type |
typedef container_type::key_type | id_type |
typedef container_type::value_type | value_type |
typedef container_type::mapped_type | createable_type |
typedef container_type::mapped_type | mapped_type |
typedef container_type::size_type | size_type |
typedef std::unique_ptr< Obj_ > | created_type |
Public Member Functions | |
constexpr __stdcall | creator (void) |
virtual __stdcall | ~creator (void) |
virtual created_type __fastcall | make (const id_type &id) const |
Returns a new, unique new, unique instance of the specified return-type for a specified key that has been registered with the factory. More... | |
![]() | |
base (base const &)=delete | |
virtual __stdcall | ~base () |
bool __fastcall | insert (const value_type &) |
Register a specific key & manufacturing method with the factory. More... | |
bool __fastcall | insert (const id_type &, const createable_type &) |
Register a specific key & manufacturing method with the factory. More... | |
const container_type::size_type __fastcall | erase (const id_type &id) |
Unregister a specific key from the factory. More... | |
bool __fastcall | find (const id_type &) const |
Return true if that key has been registered with the factory. More... | |
bool __fastcall | empty (void) const noexcept(true) |
Return true if any key has been registered with the factory. More... | |
const size_type __fastcall | size (void) const noexcept(true) |
Return the total number of unique keys registered with the factory. More... | |
void __fastcall | reserve (const size_type) |
Reserve capacity for a specified number of keys with the factory. More... | |
const container_type &__fastcall | createables (void) const noexcept(true) |
Access the internal associative collection used to store the keys and methods for creating the return items. More... | |
container_type &__fastcall | createables (void) noexcept(true) |
Access the internal associative collection used to store the keys and methods for creating the return items. More... | |
A factory that manufactures a new, unique instance of the specified return-type for a specified key that has been registered with the factory.
Note that this class is not thread-safe by default, at a minimum the container would need to be thread-safe.
Definition at line 108 of file factory.hpp.
typedef base<ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_> jmmcg::LIBJMMCG_VER_NAMESPACE::factory::creator< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::base_t |
Definition at line 110 of file factory.hpp.
typedef base_t::created_type jmmcg::LIBJMMCG_VER_NAMESPACE::factory::creator< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::created_type |
Definition at line 112 of file factory.hpp.
typedef base_t::id_type jmmcg::LIBJMMCG_VER_NAMESPACE::factory::creator< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::id_type |
Definition at line 111 of file factory.hpp.
|
inlineconstexpr |
Definition at line 75 of file factory_impl.hpp.
|
inlinevirtual |
Definition at line 80 of file factory_impl.hpp.
|
inlinevirtual |
Returns a new, unique new, unique instance of the specified return-type for a specified key that has been registered with the factory.
Definition at line 84 of file factory_impl.hpp.