Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
StructFactory Class Reference

#include "steam/asset/struct.hpp"

Description

Factory specialised for creating Structural Asset objects.

Definition at line 136 of file struct.hpp.

Public Member Functions

template<class STRU >
lib::P< STRU > operator() (Query< STRU > const &query)
 Retrieve a suitable Structural Asset instance, possibly create one.
 
template<class STRU >
lib::P< STRU > newInstance (Symbol nameID="")
 invoke the factory to create new Structural Asset.
 
template<class STRU >
lib::P< STRU > made4fake (Query< STRU > const &query)
 special backdoor for fake-configrules.hpp This allows to simulate creation of objects triggered by rules.
 
lib::P< PipenewPipe (string pipeID, string streamID)
 Factory method for creating Pipes explicitly.
 

Friends

class Struct
 

Protected Member Functions

 StructFactory ()
 using private implementation detail class
 

Private Attributes

unique_ptr< StructFactoryImplimpl_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ StructFactory()

StructFactory ( )
protected

using private implementation detail class

Definition at line 67 of file struct.cpp.

Member Function Documentation

◆ operator()()

template<class STRU >
template PSequence operator() ( Query< STRU > const &  query)

Retrieve a suitable Structural Asset instance, possibly create one.

First tries to resolve the asset by issuing an capability query. If unsuccessful, use some internally specialised ctor call.

Todo:

work out the struct asset naming scheme! /////////////////////////////////TICKET #565

for now we're using a faked config query, just pulling preconfigured hardwired answers from a table. Should be replaced by a real resolution engine.

Note
the exact calling sequence implemented here can be considered a compromise, due to having neither a working resolution, nor a generic interface for issuing queries. Thus, directly calling this factory acts as a replacement for both. The intended solution would be to have a dedicated QueryResolver, which is fully integrated into a generic rules driven query subsystem, but has the additional ability to "translate" capabilities directly into the respective properties of of asset::Struct subclasses.
Returns
a Struct smart ptr linked to the internally registered smart ptr created as a side effect of calling the concrete Struct subclass ctor.

Definition at line 112 of file struct.cpp.

References StructFactory::impl_, AssetManager::instance, ConfigResolver::instance, and QueryHandler< TY >::resolve().

+ Here is the call graph for this function:

◆ newInstance()

template<class STRU >
template PSequence newInstance ( Symbol  nameID = "")

invoke the factory to create new Structural Asset.

This function skips the query and retrieval of existing instances and immediately creates a new one.

Parameters
nameID(optional) an ID to use; if omitted an ID will be default created, based on the kind of Asset.
Exceptions
error::Invalidin case of ID clash with an existing Asset
Returns
an Struct smart ptr linked to the internally registered smart ptr created as a side effect of calling the concrete Struct subclass ctor.
Todo:
using the AssetManager this way for picking up the previously stored asset is a code smell ////////////////////////////TICKET #691

Definition at line 85 of file struct.cpp.

References StructFactory::impl_, and AssetManager::instance.

Referenced by DefsManager_test::verifyRemoval().

+ Here is the caller graph for this function:

◆ made4fake()

template<class STRU >
template PSequence made4fake ( Query< STRU > const &  query)

special backdoor for fake-configrules.hpp This allows to simulate creation of objects triggered by rules.

Warning
to be removed in Alpha when using a real resolution engine /////TICKET #710

Actually we use just a fake implementation based on a table lookup plus some hard wired special cases, which need to call in here to fabricate new objects, which can then be used as "solutions".

Parameters
querya prolog like query string
Note
works quite similar like the #operator(), but without re-invoking the ConfigRules....

Definition at line 140 of file struct.cpp.

References StructFactory::impl_, and AssetManager::instance.

Referenced by MockTable::fabricate_Sequence_on_demand(), and MockTable::fabricate_Timeline_on_demand().

+ Here is the caller graph for this function:

◆ newPipe()

lib::P< Pipe > newPipe ( string  pipeID,
string  streamID 
)

Factory method for creating Pipes explicitly.

Normalises pipe- and streamID, then retrieves the default processing pattern (ProcPatt) for this streamID. The Pipe ctor will fill out the shortDesc and longDesc automatically, based on pipeID and streamID (and they are editable anyways)

See also
ProcPatt
DefaultsManager

Definition at line 158 of file struct.cpp.

References StructFactory::impl_, and AssetManager::instance.

Referenced by BasicPipe_test::createExplicit(), and DefsManagerImpl_test::define_and_search().

+ Here is the caller graph for this function:

Member Data Documentation

◆ impl_

Friends And Related Symbol Documentation

◆ Struct

friend class Struct
friend

Definition at line 143 of file struct.hpp.

+ Inheritance diagram for StructFactory:
+ Collaboration diagram for StructFactory:

The documentation for this class was generated from the following files: