VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions
DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg > Class Template Reference

This template is similar to DtFactoryTemplate, but allows one argument to be passed to the creator function of the objects being created. More...

Inheritance diagram for DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >:
Inheritance graph
[legend]

Classes

struct  DtSingleArgFactoryTemplateEntry
 

Public Types

typedef T_CreationObject *(* DtCreatorFcn )(T_Arg)
 
typedef std::map< T_Key,
DtSingleArgFactoryTemplateEntry
DtCreatorMapType
 

Public Member Functions

 DtSingleArgFactoryTemplate ()
 constructor More...
 
virtual ~DtSingleArgFactoryTemplate ()
 Destructor: deletes factory and any entries on the factory. More...
 
virtual void addCreatorFcn (const T_Key &key, DtCreatorFcn fcn)
 Add a creator function to the factory. More...
 
virtual bool removeCreatorFcn (const T_Key &key)
 Remove a creator function with the given key. More...
 
virtual bool isKeyRegistered (const T_Key &key) const
 
virtual DtString creationObjectName () const
 
virtual const DtCreatorMapTypecreatorMap () const
 
virtual void setAlwaysWarnOnlyOnce (bool)
 Whether or not to always warn only once, even if not registered. Default is true. More...
 
bool alwaysWarnOnlyOnce () const
 
virtual T_CreationObject * createNew (const T_Key &key, T_Arg arg) const
 Create and return a new instance of the type based on the creator functions and the type specified. More...
 

Static Public Member Functions

static
DtSingleArgFactoryTemplate
< T_CreationObject, T_Key,
T_Arg > * 
create ()
 

Protected Attributes

DtCreatorMapType myCreatorMap
 
bool myAlwaysWarnOnlyOnce
 
std::map< T_Key, boolmyMessageWarningFilters
 

Private Member Functions

 DtSingleArgFactoryTemplate (const DtSingleArgFactoryTemplate &orig)
 Not implemented. More...
 
const DtSingleArgFactoryTemplateoperator= (const DtSingleArgFactoryTemplate &orig)
 Not implemented. More...
 

Detailed Description

template<typename T_CreationObject, typename T_Key, typename T_Arg>
class DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >

This template is similar to DtFactoryTemplate, but allows one argument to be passed to the creator function of the objects being created.

Member Typedef Documentation

template<typename T_CreationObject, typename T_Key, typename T_Arg>
typedef T_CreationObject*(* DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::DtCreatorFcn)(T_Arg)
template<typename T_CreationObject, typename T_Key, typename T_Arg>
typedef std::map<T_Key, DtSingleArgFactoryTemplateEntry> DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::DtCreatorMapType

Constructor & Destructor Documentation

template<typename T_CreationObject, typename T_Key, typename T_Arg>
DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::DtSingleArgFactoryTemplate ( )

constructor

template<typename T_CreationObject, typename T_Key, typename T_Arg>
DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::DtSingleArgFactoryTemplate ( const DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg > &  orig)
private

Not implemented.

template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::~DtSingleArgFactoryTemplate ( )
virtual

Destructor: deletes factory and any entries on the factory.

Member Function Documentation

template<typename T_CreationObject, typename T_Key, typename T_Arg>
const DtSingleArgFactoryTemplate& DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::operator= ( const DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg > &  orig)
private

Not implemented.

template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual void DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::addCreatorFcn ( const T_Key &  key,
DtCreatorFcn  fcn 
)
virtual

Add a creator function to the factory.

template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual bool DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::removeCreatorFcn ( const T_Key &  key)
virtual

Remove a creator function with the given key.

Return true if the key is found

template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual T_CreationObject* DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::createNew ( const T_Key &  key,
T_Arg  arg 
) const
virtual

Create and return a new instance of the type based on the creator functions and the type specified.

Prints a warning if not found. See creationTypeName().

template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual bool DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::isKeyRegistered ( const T_Key &  key) const
virtual
template<typename T_CreationObject, typename T_Key, typename T_Arg>
static DtSingleArgFactoryTemplate<T_CreationObject, T_Key, T_Arg>* DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::create ( )
static
template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual DtString DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::creationObjectName ( ) const
virtual
Returns
The name of the creation object that will be printed in any errors. Errors are printed when a creation call is made and no creator is found. Default implementation returns "data".
template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual const DtCreatorMapType& DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::creatorMap ( ) const
virtual
template<typename T_CreationObject, typename T_Key, typename T_Arg>
virtual void DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::setAlwaysWarnOnlyOnce ( bool  )
virtual

Whether or not to always warn only once, even if not registered. Default is true.

template<typename T_CreationObject, typename T_Key, typename T_Arg>
bool DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::alwaysWarnOnlyOnce ( ) const

Member Data Documentation

template<typename T_CreationObject, typename T_Key, typename T_Arg>
DtCreatorMapType DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::myCreatorMap
protected
template<typename T_CreationObject, typename T_Key, typename T_Arg>
bool DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::myAlwaysWarnOnlyOnce
protected
template<typename T_CreationObject, typename T_Key, typename T_Arg>
std::map<T_Key, bool> DtSingleArgFactoryTemplate< T_CreationObject, T_Key, T_Arg >::myMessageWarningFilters
mutableprotected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)