All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Static Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | List of all members
MBSim::ObjectFactory Class Reference

#include <objectfactory.h>

Static Public Member Functions

template<class CreateType >
static void registerXMLName (const MBXMLUtils::FQN &name)
 
template<class CreateType >
static void registerXMLNameAsSingleton (const MBXMLUtils::FQN &name)
 
template<class CreateType >
static void deregisterXMLName (const MBXMLUtils::FQN &name)
 
template<class CreateType >
static void deregisterXMLNameAsSingleton (const MBXMLUtils::FQN &name)
 
template<class ContainerType >
static ContainerType * createAndInit (const xercesc::DOMElement *element)
 

Private Types

typedef fmatvec::Atom *(* AllocateFkt )()
 
typedef void(* DeallocateFkt )(fmatvec::Atom *obj)
 
typedef std::vector< std::pair
< AllocateFkt, DeallocateFkt > > 
AllocDeallocVector
 
typedef
AllocDeallocVector::iterator 
AllocDeallocVectorIt
 
typedef std::map
< MBXMLUtils::FQN,
AllocDeallocVector > 
NameMap
 
typedef NameMap::iterator NameMapIt
 

Static Private Member Functions

static void registerXMLName (const MBXMLUtils::FQN &name, AllocateFkt alloc, DeallocateFkt dealloc)
 
static void deregisterXMLName (const MBXMLUtils::FQN &name, AllocateFkt alloc)
 
static ObjectFactoryinstance ()
 
template<class CreateType >
static fmatvec::Atomallocate ()
 
static void deallocate (fmatvec::Atom *obj)
 
template<class CreateType >
static fmatvec::AtomgetSingleton ()
 
static void deallocateSingleton (fmatvec::Atom *obj)
 

Private Attributes

NameMap registeredType
 

Detailed Description

A object factory. A object factory which creates any object derived from fmatvec::Atom.

Member Function Documentation

template<class ContainerType >
static ContainerType* MBSim::ObjectFactory::createAndInit ( const xercesc::DOMElement *  element)
inlinestatic

Create and initialize an object corresponding to the XML element element and return a pointer of type ContainerType. Throws if the created object is not of type ContainerType or no object can be create without errors. This function returns a new object or a singleton object dependent on the registration of the created object.

template<class CreateType >
static void MBSim::ObjectFactory::deregisterXMLName ( const MBXMLUtils::FQN &  name)
inlinestatic

Deregister the class CreateType. You should not use this function directly but see also the macro MBSIM_OBJECTFACTORY_REGISTERXMLNAME.

template<class CreateType >
static void MBSim::ObjectFactory::deregisterXMLNameAsSingleton ( const MBXMLUtils::FQN &  name)
inlinestatic

Deregister the class CreateType. You should not use this function directly but see also the macro MBSIM_OBJECTFACTORY_REGISTERXMLNAMEASSINGLETON.

template<class CreateType >
static void MBSim::ObjectFactory::registerXMLName ( const MBXMLUtils::FQN &  name)
inlinestatic

Register the class CreateType which the XML element name name by the object factory. You should not use this function directly but see also the macro MBSIM_OBJECTFACTORY_REGISTERXMLNAME.

template<class CreateType >
static void MBSim::ObjectFactory::registerXMLNameAsSingleton ( const MBXMLUtils::FQN &  name)
inlinestatic

Register the class CreateType which the XML element name name by the object factory. You should not use this function directly but see also the macro MBSIM_OBJECTFACTORY_REGISTERXMLNAMEASSINGLETON.


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

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML