ChirpSim
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PhysicalObjectFactory Class Reference

The PhysicalObjectFactory class is a singleton class allowing users to register factories for a PhysicalObject class through a type name. More...

#include <physicalobjectfactory.h>

Inheritance diagram for PhysicalObjectFactory:
Inheritance graph

Public Member Functions

void addFactory (const QString &name, FactoryFunction factoryFunction)
 addFactory registers a root object factory on a type name. More...
 
FactoryFunctiongetFactory (const QString &name)
 getFactory More...
 

Static Public Member Functions

static PhysicalObjectFactoryinstance ()
 

Private Member Functions

 PhysicalObjectFactory ()
 

Private Attributes

QMap< QString, FactoryFunction * > _map
 

Static Private Attributes

static PhysicalObjectFactory_instance = NULL
 

Detailed Description

The PhysicalObjectFactory class is a singleton class allowing users to register factories for a PhysicalObject class through a type name.

Constructor & Destructor Documentation

PhysicalObjectFactory::PhysicalObjectFactory ( )
explicitprivate

References addFactory(), arenaFactory(), chirpFactory(), pushableObjectFactory(), and wallFactory().

Referenced by instance().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

void PhysicalObjectFactory::addFactory ( const QString &  name,
FactoryFunction  factoryFunction 
)

addFactory registers a root object factory on a type name.

Parameters
nametype name of the object.
factoryFunctionfactory function used to create the object from a json object.

References _map.

Referenced by PhysicalObjectFactory().

Here is the caller graph for this function:

FactoryFunction * PhysicalObjectFactory::getFactory ( const QString &  name)

getFactory

Parameters
nametype name of the object.
Returns
Factory function for creating an object of type "name" from a json object.

References _map.

Referenced by World::fromJsonDocument().

Here is the caller graph for this function:

PhysicalObjectFactory * PhysicalObjectFactory::instance ( )
static
Returns
singleton instance of the class.

References _instance, and PhysicalObjectFactory().

Referenced by World::fromJsonDocument().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

PhysicalObjectFactory * PhysicalObjectFactory::_instance = NULL
staticprivate

Referenced by instance().

QMap<QString, FactoryFunction*> PhysicalObjectFactory::_map
private

Referenced by addFactory(), and getFactory().


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