libjmmcg
build_2783
A C++ library containing an eclectic mix of useful, advanced components.
|
A factory that manufactures a clone of an 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::createable_type | createable_type |
typedef base_t::created_type | created_type |
typedef Cont_::mapped_type::first_type::value_type::lock_traits | lock_traits |
Public Types inherited from jmmcg::factory::base< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ > | |
typedef Cont_ | 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 Ret_ | created_type |
Public Member Functions | |
constexpr __stdcall | clone () |
virtual __stdcall | ~clone () |
virtual created_type __fastcall | make (const id_type &) const |
Returns a clone of an instance of the specified return-type for a specified key that has been registered with the factory. More... | |
Public Member Functions inherited from jmmcg::factory::base< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ > | |
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... | |
Additional Inherited Members | |
Protected Member Functions inherited from jmmcg::factory::base< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ > | |
__stdcall | base (void) |
Protected Attributes inherited from jmmcg::factory::base< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ > | |
container_type | createables_ |
A factory that manufactures a clone of an 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 and shared pointer-type would need to be thread-safe.
Definition at line 171 of file factory.hpp.
typedef base<ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_> jmmcg::factory::clone< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::base_t |
Definition at line 173 of file factory.hpp.
typedef base_t::createable_type jmmcg::factory::clone< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::createable_type |
Definition at line 175 of file factory.hpp.
typedef base_t::created_type jmmcg::factory::clone< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::created_type |
Definition at line 176 of file factory.hpp.
typedef base_t::id_type jmmcg::factory::clone< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::id_type |
Definition at line 174 of file factory.hpp.
typedef Cont_::mapped_type::first_type::value_type::lock_traits jmmcg::factory::clone< ID_, Obj_, Except_, Ret_, NotFound_, CreatFn_, Cont_ >::lock_traits |
Definition at line 177 of file factory.hpp.
|
inlineconstexpr |
Definition at line 128 of file factory_impl.hpp.
|
inlinevirtual |
Definition at line 133 of file factory_impl.hpp.
|
inlinevirtual |
Returns a clone of an instance of the specified return-type for a specified key that has been registered with the factory.
Definition at line 137 of file factory_impl.hpp.