Lumiera  0.pre.03
»edit your freedom«
StructFactory Class Reference

#include "steam/asset/struct.hpp"

Description

Factory specialised for creating Structural Asset objects.

Definition at line 145 of file struct.hpp.

Public Member Functions

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. More...
 
template<class STRU >
lib::P< STRU > newInstance (Symbol nameID="")
 invoke the factory to create new Structural Asset. More...
 
lib::P< PipenewPipe (string pipeID, string streamID)
 Factory method for creating Pipes explicitly. More...
 
template<class STRU >
lib::P< STRU > operator() (Query< STRU > const &query)
 Retrieve a suitable Structural Asset instance, possibly create one. More...
 

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 (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Member Function Documentation

◆ operator()()

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 121 of file struct.cpp.

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

Referenced by StructFactory::newPipe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newInstance()

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 94 of file struct.cpp.

Referenced by StructFactory::newPipe().

+ Here is the caller graph for this function:

◆ made4fake()

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 149 of file struct.cpp.

References AssetManager::instance.

Referenced by StructFactory::newPipe().

+ 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 167 of file struct.cpp.

References AssetManager::instance, StructFactory::made4fake(), StructFactory::newInstance(), and StructFactory::operator()().

+ Here is the call graph for this function:
+ Inheritance diagram for StructFactory:
+ Collaboration diagram for StructFactory:

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