VR-Forces 4.0.4 Class Documentation
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtStringAndIntKeyFactory< T_CreationType > Class Template Reference

Template for factory classes that are keyed of both a string and integer type. More...

Inheritance diagram for DtStringAndIntKeyFactory< T_CreationType >:
Inheritance graph
[legend]

List of all members.

Classes

struct  DtStringAndIntKeyFactoryEntry

Public Types

typedef T_CreationType *(* DtCreatorFcn )()

Public Member Functions

 DtStringAndIntKeyFactory ()
 constructor
virtual ~DtStringAndIntKeyFactory ()
 Destructor: deletes factory and any entries on the factory.
virtual void addCreatorFcn (const DtString &type, const int intType, DtCreatorFcn fcn)
 Add a creator function to the factory.
virtual int intTypeForStringType (const DtString &stringType) const
virtual DtString stringTypeForIntType (int intType)
virtual T_CreationType * createItem (const DtString &type) const
 Create and return a new instance of the type based on the creator functions and the type specified.
virtual T_CreationType * createItem (int type) const
 Create and return a new instance of the type based on the creator functions and the type specified.

Static Public Member Functions

static
DtStringAndIntKeyFactory
< T_CreationType > * 
create ()

Protected Member Functions

virtual DtString creationTypeName () const

Protected Attributes

DtHashlist myStringTypeHashlist
DtHashlist myIntTypeHashlist

Private Member Functions

 DtStringAndIntKeyFactory (const DtStringAndIntKeyFactory &orig)
 Not implemented.
const DtStringAndIntKeyFactoryoperator= (const DtStringAndIntKeyFactory &orig)
 Not implemented.

Detailed Description

template<typename T_CreationType>
class DtStringAndIntKeyFactory< T_CreationType >

Template for factory classes that are keyed of both a string and integer type.

Classes instantiated from this template will build up a list of creator functions indexed both by integer type and string type, and can be created using either type index. Functions are also included to lookup the string-to-integer and integer-to-string mapping.


Member Typedef Documentation

template<typename T_CreationType>
typedef T_CreationType*(* DtStringAndIntKeyFactory< T_CreationType >::DtCreatorFcn)()

Constructor & Destructor Documentation

template<typename T_CreationType>
DtStringAndIntKeyFactory< T_CreationType >::DtStringAndIntKeyFactory ( )

constructor

template<typename T_CreationType>
DtStringAndIntKeyFactory< T_CreationType >::DtStringAndIntKeyFactory ( const DtStringAndIntKeyFactory< T_CreationType > &  orig) [private]

Not implemented.

template<typename T_CreationType>
virtual DtStringAndIntKeyFactory< T_CreationType >::~DtStringAndIntKeyFactory ( ) [virtual]

Destructor: deletes factory and any entries on the factory.


Member Function Documentation

template<typename T_CreationType>
const DtStringAndIntKeyFactory& DtStringAndIntKeyFactory< T_CreationType >::operator= ( const DtStringAndIntKeyFactory< T_CreationType > &  orig) [private]

Not implemented.

template<typename T_CreationType>
virtual void DtStringAndIntKeyFactory< T_CreationType >::addCreatorFcn ( const DtString type,
const int  intType,
DtCreatorFcn  fcn 
) [virtual]

Add a creator function to the factory.

template<typename T_CreationType>
virtual T_CreationType* DtStringAndIntKeyFactory< T_CreationType >::createItem ( const DtString type) 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_CreationType>
virtual T_CreationType* DtStringAndIntKeyFactory< T_CreationType >::createItem ( int  type) 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_CreationType>
virtual int DtStringAndIntKeyFactory< T_CreationType >::intTypeForStringType ( const DtString stringType) const [virtual]
Returns:
The int type that is mapped to the specified string type.
template<typename T_CreationType>
virtual DtString DtStringAndIntKeyFactory< T_CreationType >::stringTypeForIntType ( int  intType) [virtual]
Returns:
the string type that is mapped to the specified int type.
template<typename T_CreationType>
static DtStringAndIntKeyFactory<T_CreationType>* DtStringAndIntKeyFactory< T_CreationType >::create ( ) [static]
template<typename T_CreationType>
virtual DtString DtStringAndIntKeyFactory< T_CreationType >::creationTypeName ( ) const [protected, virtual]
Returns:
The name of the creation type 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".

Reimplemented in DtSetDataRequestFactory, DtSimTaskFactory, DtSimTaskStateFactory, DtSimReportFactory, and DtAdminContentFactory.


Member Data Documentation

template<typename T_CreationType>
DtHashlist DtStringAndIntKeyFactory< T_CreationType >::myStringTypeHashlist [protected]
template<typename T_CreationType>
DtHashlist DtStringAndIntKeyFactory< T_CreationType >::myIntTypeHashlist [protected]

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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)