asset::StructFactoryImpl Class Reference

#include <structfactoryimpl.hpp>

Collaboration diagram for asset::StructFactoryImpl:

Collaboration graph
[legend]

List of all members.


Detailed Description

Implementation deatils, esp.

concerning how configuration queries are resolved and when to create new objects automatically.

Todo:
better use a general struct traits class, esp.for creating the Ident

Definition at line 86 of file structfactoryimpl.hpp.


Public Member Functions

template<>
Pipefabricate (const Query< Pipe > &caps)
template<>
const ProcPattfabricate (const Query< const ProcPatt > &caps)
template<>
Trackfabricate (const Query< Track > &caps)
template<class STRU>
STRU * fabricate (const Query< STRU > &caps)
 make a new structural asset instance.
 StructFactoryImpl (StructFactory &interface)

Private Member Functions

template<class STRU>
const Asset::Ident createIdent (const Query< STRU > &query)

Private Attributes

StructFactoryrecursive_create_
 used for issuing recursive create calls to top level

Member Function Documentation

template<class STRU>
const Asset::Ident asset::StructFactoryImpl::createIdent ( const Query< STRU > &  query  )  [inline, private]

For internal use only.

derive a sensible asset ident tuple when creating structural asset instances based on a capability query

Definition at line 94 of file structfactoryimpl.hpp.

References asset::str().

00095         {
00096           string name (query); 
00097           string nameID = extractID (Traits<STRU>::idSymbol, query);
00098           if (isnil (nameID))
00099             {
00100                // no name-ID contained in the query...
00101               //  so we'll create a new one
00102               static int i=0;
00103               static format namePattern ("%s.%d");
00104               static format predPattern ("%s(%s), ");
00105               nameID = str(namePattern % Traits<STRU>::namePrefix % (++i) );
00106               name.insert(0, 
00107                        str(predPattern % Traits<STRU>::idSymbol % nameID ));
00108             }
00109           ENSURE (!isnil (name));
00110           ENSURE (!isnil (nameID));
00111           ENSURE (contains (name, nameID));
00112           
00113           Category cat (STRUCT, Traits<STRU>::catFolder);
00114           return Asset::Ident (name, cat );
00115         }

Here is the call graph for this function:

template<class STRU>
STRU* asset::StructFactoryImpl::fabricate ( const Query< STRU > &  caps  )  [inline]

make a new structural asset instance.

default/fallback impl. throws.

Definition at line 136 of file structfactoryimpl.hpp.

References lumiera::Query< OBJ >::asKey(), and asset::str().

00137         {
00138         throw lumiera::error::Config ( str(format("The following Query could not be resolved: %s.") % caps.asKey())
00139                                      , LUMIERA_ERROR_CAPABILITY_QUERY );
00140         }

Here is the call graph for this function:


Member Data Documentation

used for issuing recursive create calls to top level

Definition at line 123 of file structfactoryimpl.hpp.


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

Generated on Fri Nov 7 22:15:27 2008 for Lumiera by  doxygen 1.5.6