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

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

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

`#include <Factory.h>`

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

[legend]
List of all members.

## Public Member Functions
virtual | ~FactoryBase ()
template<class t_Object>
void | unsupport ()
virtual void | unsupport (const std::type_info *objectType)=0
## Protected Types
typedef std::map< String, const std::type_info * > | t_MapTypeNameToTypeID
| The type of map used to find types by name.
## Protected Member Functions
const std::type_info * | find (const char *objTypeName)
| FactoryBase ()
## Protected Attributes
t_MapTypeNameToTypeID | m_TypeNames

## Detailed Description

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

This factory base class is used to construct objects on the fly when loading data. This base class handles the generic class name handling features of the factory while leaving the object part to the base classes of this factory, customized to the number of constructor arguments.

Definition at line 141 of file Factory.h.

## Constructor & Destructor Documentation

template<class t_Base>

virtual Mers::Utils::Lang::FactoryBase< t_Base >::~FactoryBase | ( |  | ) | `[inline, virtual]`

Default destructor.

Definition at line 147 of file Factory.h.

template<class t_Base>

Mers::Utils::Lang::FactoryBase< t_Base >::FactoryBase | ( |  | ) | `[inline, protected]`

This constructor is used to construct the singleton factory. Since we only want to allow one to exist, this constructor is protected. Only inheriters of this class can create this class, and it will only ever create one instance per template type.

Definition at line 205 of file Factory.h.

## Member Function Documentation

template<class t_Base>

const std::type_info* Mers::Utils::Lang::FactoryBase< t_Base >::find | ( | const char * | objTypeName | ) | `[inline, protected]`

Finds the constructor of the desired object given the name of the desired object type. This function returns NULL if it was not found.

Definition at line 159 of file Factory.h.

References Mers::Utils::Lang::FactoryBase< t_Base >::m_TypeNames.

template<class t_Base>
template<class t_Object>

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

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

Reimplemented in Mers::Utils::Lang::FactoryArg0< t_Base >, and Mers::Utils::Lang::FactoryArg1< t_Base, t_Arg1 >.

Definition at line 175 of file Factory.h.

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

template<class t_Base>

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

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

Parameters:

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

Implemented in Mers::Utils::Lang::FactoryArg0< t_Base >, and Mers::Utils::Lang::FactoryArg1< t_Base, t_Arg1 >.

## Member Data Documentation

template<class t_Base>

t_MapTypeNameToTypeID Mers::Utils::Lang::FactoryBase< t_Base >::m_TypeNames`[protected]`

This map will map named class instances to their type_info objects. This can then be used to construct one of these classes.

Definition at line 196 of file Factory.h.

Referenced by Mers::Utils::Lang::FactoryBase< t_Base >::find().

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

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