- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Utils::Lang::FactoryArg0< t_Base > Class Template Reference

`#include <Factory.h>`

Inheritance diagram for Mers::Utils::Lang::FactoryArg0< t_Base >:

[legend]
Collaboration diagram for Mers::Utils::Lang::FactoryArg0< t_Base >:

[legend]
List of all members.

## Public Member Functions
t_Base * | create (const std::type_info *objType)
t_Base * | create (const char *objTypeName)
template<class t_Object>
t_Base * | create ()
template<class t_Object>
void | support (const char *className)
template<class t_Object>
void | unsupport ()
virtual void | unsupport (const std::type_info *objectType)
## Static Public Member Functions
static FactoryArg0 & | getSingleton ()
## Protected Types
typedef std::map< const std::type_info *, ConstructorBase *, PointerCompare< std::type_info > > | t_MapTypeIDToConstructor
| The type of map used to find constructors for the types.
## Protected Member Functions
template<class t_Object, typename t_NameMap, typename t_Map, typename t_Constructor>
void | supportHelper (const char *className, t_NameMap &typeNames, t_Map &constructors)
template<typename t_NameMap, typename t_Map>
void | unsupportHelper (const std::type_info *objectType, t_NameMap &typeNames, t_Map &constructors)
## Protected Attributes
t_MapTypeIDToConstructor | m_Constructors
## Classes
class | Constructor
class | ConstructorBase

## Detailed Description

### template<class t_Base>
class Mers::Utils::Lang::FactoryArg0< t_Base >

This factory base class is used to construct objects on the fly when loading data. This factory handles constructors that take no arguments, so a factory of 0 arguments. The name is written as FactoryArg0 so that it is easily discernable from FactoryArg1.

Definition at line 217 of file Factory.h.

## Member Function Documentation

template<class t_Base>
template<class t_Object, typename t_NameMap, typename t_Map, typename t_Constructor>

void Mers::Utils::Lang::FactoryArg0< t_Base >::supportHelper | ( | const char * | className,
|  | t_NameMap & | typeNames,
|  | t_Map & | constructors |
| ) |  |  | `[inline, protected]`

To support g++ v3.4.4, we cannot call another class's template function using our class's template parameters directly - it can't find our parameter. So add a level of indirection.

Definition at line 254 of file Factory.h.

template<class t_Base>
template<typename t_NameMap, typename t_Map>

void Mers::Utils::Lang::FactoryArg0< t_Base >::unsupportHelper | ( | const std::type_info * | objectType,
|  | t_NameMap & | typeNames,
|  | t_Map & | constructors |
| ) |  |  | `[inline, protected]`

To support g++ v3.4.4, we cannot call another class's template function using our class's template parameters directly - it can't find our parameter. So add a level of indirection.

Definition at line 264 of file Factory.h.

template<class t_Base>

static FactoryArg0& Mers::Utils::Lang::FactoryArg0< t_Base >::getSingleton | ( |  | ) | `[inline, static]`

Returns the single instance of this factory class.

Definition at line 273 of file Factory.h.

template<class t_Base>

t_Base* Mers::Utils::Lang::FactoryArg0< t_Base >::create | ( | const std::type_info * | objType | ) | `[inline]`

Constructs the desired object given the desired object type.

Definition at line 285 of file Factory.h.

References Mers::Utils::Lang::FactoryArg0< t_Base >::m_Constructors.

template<class t_Base>

t_Base* Mers::Utils::Lang::FactoryArg0< t_Base >::create | ( | const char * | objTypeName | ) | `[inline]`

Constructs the desired object given the name of the desired object type.

Definition at line 300 of file Factory.h.

References Mers::Utils::Lang::FactoryArg0< t_Base >::create().

Here is the call graph for this function:

template<class t_Base>
template<class t_Object>

t_Base* Mers::Utils::Lang::FactoryArg0< t_Base >::create | ( |  | ) | `[inline]`

Constructs the desired object given the desired object type.

Definition at line 314 of file Factory.h.

Referenced by Mers::Utils::Lang::FactoryArg0< t_Base >::create().

template<class t_Base>
template<class t_Object>

void Mers::Utils::Lang::FactoryArg0< t_Base >::support | ( | const char * | className | ) | `[inline]`

Adds the ability to construct this object type to this factory. The object will be constructed either by type or by name. Since rtti names are not standard, the name provided allows the user to standardize the name of the class.

Parameters:

  | className | the name under which the t_Object class should be registered.

Definition at line 328 of file Factory.h.

References Mers::Utils::Lang::FactoryArg0< t_Base >::m_Constructors.

template<class t_Base>
template<class t_Object>

void Mers::Utils::Lang::FactoryArg0< t_Base >::unsupport | ( |  | ) | `[inline]`

Removes support for constructing the specified object type under any name.

Note:
  : This is a hack to get around VC++ (and maybe g++) not finding this function in our parent class.

Reimplemented from Mers::Utils::Lang::FactoryBase< t_Base >.

Definition at line 340 of file Factory.h.

References Mers::Utils::Lang::FactoryBase< t_Base >::unsupport().

Here is the call graph for this function:

template<class t_Base>

virtual void Mers::Utils::Lang::FactoryArg0< t_Base >::unsupport | ( | const std::type_info * | objectType | ) | `[inline, virtual]`

Removes support for constructing the specified object type under any name.

Parameters:

  | objectType | The type of object for which support is removed.

Implements Mers::Utils::Lang::FactoryBase< t_Base >.

Definition at line 352 of file Factory.h.

References Mers::Utils::Lang::FactoryArg0< t_Base >::m_Constructors.

## Member Data Documentation

template<class t_Base>

t_MapTypeIDToConstructor Mers::Utils::Lang::FactoryArg0< t_Base >::m_Constructors`[protected]`

This list of constructors knows how to construct an object based on its type_info if support for it has already been added.

Definition at line 361 of file Factory.h.

Referenced by Mers::Utils::Lang::FactoryArg0< t_Base >::create(), Mers::Utils::Lang::FactoryArg0< t_Base >::support(), and Mers::Utils::Lang::FactoryArg0< t_Base >::unsupport().

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

- /Users/fpy/titan-1-5-MBARI/Mers/Utils/Lang/Factory.h