5#include "acme/parallelization/critical_section.h"
6#include "acme/prototype/collection/atom_map.h"
8#include "acme/prototype/prototype/type.h"
9#include "acme/prototype/collection/list_iterator.h"
14CLASS_DECL_ACME ::string demangle(
const char * pszMangledName);
26 class CLASS_DECL_ACME factory_item_interface :
27 virtual public ::particle
32 factory_item_interface();
33 ~factory_item_interface()
override;
36 virtual string base_type_name()
const;
38 virtual string __type_name()
const;
40 virtual ::pointer < ::subparticle > __call__create_particle();
48 template <
typename ORIGIN_TYPE >
49 class factory_item_base :
50 public factory_item_interface
61 ~factory_item_base()
override
68 string base_type_name()
const override { return ::demangle(::type < ORIGIN_TYPE>().name()); }
70 virtual ::pointer<ORIGIN_TYPE> __call__create() = 0;
77 return __call__create();
93 template <
typename TYPE,
typename ORIGIN_TYPE >
95 public factory_item_base < ORIGIN_TYPE >
106 ~factory_item()
override
113 string __type_name()
const override { return ::demangle(
typeid(TYPE).name()); }
120 return {
place_t{}, __new_refdbg_continuation TYPE() };
128 template <
typename TYPE,
typename ORIGIN_TYPE >
130 public factory_item < TYPE, ORIGIN_TYPE >
136 ORIGIN_TYPE * m_pfree;
147 void return_back(ORIGIN_TYPE * p);
157 m_pfree = m_pfree->m_pnext;
177 using factory_base = atom_map < ::pointer<factory_item_interface > >;
180 class CLASS_DECL_ACME factory :
181 virtual public factory_base
189 ::string m_strArgument;
200 inline ::factory::factory_item_interface * get_factory_item(const ::atom&
atom)
const;
201 bool has_factory_item(const ::atom&
atom)
const;
205 template <
typename ORIGIN_TYPE >
206 inline ::pointer<::factory::factory_item_interface>& get_factory_item();
208 template <
typename ORIGIN_TYPE >
209 inline ::pointer<::factory::factory_item_interface>& get_factory_item(const ::atom&
atom);
212 template <
typename BASE_TYPE >
214 template <
typename TYPE,
typename ORIGIN_TYPE>
218#if REFERENCING_DEBUGGING
221 factory * __call__add_referer2(const ::reference_referer & referer)
const;
228 template <
typename TYPE,
typename ORIGIN_TYPE = TYPE >
231 template <
typename ORIGIN_TYPE >
236 template <
typename TYPE,
typename ORIGIN_TYPE>
239 template <
typename ORIGIN_TYPE >
240 inline ::pointer<ORIGIN_TYPE>__call__create(::particle * pparticle);
242 void merge(const ::factory::factory* pfactory);
244 void merge_to_global_factory()
const;
246 void set_currently_loading_library();
249 template <
typename ORIGIN_TYPE >
256 this->__raw_construct(p);
263 template <
typename ORIGIN_TYPE >
267 template <
typename ORIGIN_TYPE >
271 virtual ::particle_pointer __call__create(const ::string & strType, ::particle * pparticle);
274 virtual bool has(const ::atom &
atom)
const;
276 template <
typename TYPE >
280 return this->has(::demangle(
typeid(TYPE).name()));
289 using factory_array = pointer_array < factory_item_interface >;
305 bool has(const ::atom&
atom);
309 void set_factory(const ::atom &
atom, const ::pointer<factory_item_interface>& pfactory);
311 template <
typename ORIGIN_TYPE >
312 inline ::atom get_atom();
348 template <
typename ORIGIN_TYPE >
349 inline ::pointer<factory_item_interface> get_factory_item(const ::atom & atomSource);
407 template <
typename ORIGIN_TYPE>
413 auto pfactoryitem = __allocate ::factory::factory_item< ORIGIN_TYPE, ORIGIN_TYPE > ();
415 set_at(
atom, pfactoryitem);
424 CLASS_DECL_ACME::factory::factory * loading_library_factory();
665 inline ::pointer<factory_item_interface> & get_existing_factory_item(const ::atom & atom);
854template <
typename BASE_TYPE >
Definition critical_section.h:29
Definition critical_section.h:9
virtual ::pointer< ::subparticle > __call__create_particle() override
consumes a referer
Definition factory.h:74
::pointer< ORIGIN_TYPE > __call__create() override
consumes a referer
Definition factory.h:117
::pointer< ORIGIN_TYPE > __call__create() override
consumes a referer
Definition _impl_factory.h:12
Definition subparticle.h:26