VR-Forces 5.0.3 Developer's Guide
 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

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.

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 ()
 
virtual ~DtSingleArgFactoryTemplate ()
 
virtual void addCreatorFcn (const T_Key &key, DtCreatorFcn fcn)
 
virtual bool removeCreatorFcn (const T_Key &key)
 
virtual bool isKeyRegistered (const T_Key &key) const
 
virtual DtString creationObjectName () const
 
virtual const DtCreatorMapTypecreatorMap () const
 
virtual void setAlwaysWarnOnlyOnce (bool)
 
bool alwaysWarnOnlyOnce () const
 
virtual T_CreationObject * createNew (const T_Key &key, T_Arg arg) const
 

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)
 
const DtSingleArgFactoryTemplateoperator= (const DtSingleArgFactoryTemplate &orig)
 

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 Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)