fsf::CSystem Class Reference

The system class (singleton pattern). More...

#include <FsfSystem.h>

Collaboration diagram for fsf::CSystem:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Clock
Time getTime ()
 Gets the system time on *nix platforms.
Manipulators
void registerNodeFactory (const std::string &strID, CNodeFactoryBase *pNodeFactory)
 Adds the argument node factory to this system's map using the argument ID string as key.
CNodeFactoryBasegetNodeFactory (const std::string &strID)
 Gets a pointer to the node factory identified by the argument ID string.
void registerCellFactory (const std::string &strID, CCellFactoryBase *pCellFactory)
 Adds the argument cell factory to this system's map using the argument ID string as key.
CCellFactoryBasegetCellFactory (const std::string &strID)
 Gets a pointer to the cell factory identified by the argument ID string.

Static Public Member Functions

Object instantiation functions
Formerly in the Scripting Module

static CCellcreateCell (const std::string &strID)
static CNodecreateNode (const std::string &strID, fsf::CNode *pParent=NULL)
template<class N >
static CPassiveFilter< N > * createPassiveFilter (const std::string &strName)

Singleton pattern

static CSystemgetInstance ()
 Gets a pointer to the unique instance of this class; allocates the intance if necessary.
static void deleteInstance ()
 Deletes the unique instance of the class.
 ~CSystem ()
 Destructor.


Detailed Description

The system class (singleton pattern).

By convention, any application using FSF must have a single instance of the System type. The corresponding class therefore implements the Singleton pattern, so that this unique instance is automatically created the first time it is needed. This object provides the reference clock, and holds the lists of node and cell factories available for building application graphs. In order to use a module in an application, its node and cell factories must be declared and registered with the system instance.

Although FSF is highly multi-threaded, the unique instance will be allocated before multi-threading kicks in, and thus a double lock mechanism is probably not needed.


Constructor & Destructor Documentation

CSystem::~CSystem (  ) 

Destructor.


Member Function Documentation

CCell * CSystem::createCell ( const std::string &  strID  )  [static]

Parameters:
strID The cell type ID string
Returns:
A pointer to the newly created cell if successful, NULL otherwise (e.g. type is unknown).

CNode * CSystem::createNode ( const std::string &  strID,
fsf::CNode pParent = NULL 
) [static]

Parameters:
strID The node type ID string
pParent A pointer to the new node's parent (can be NULL)
Returns:
A pointer to the newly created node if successful, NULL otherwise (e.g. type is unknown).

template<class N >
static CPassiveFilter<N>* fsf::CSystem::createPassiveFilter ( const std::string &  strName  )  [inline, static]

static void fsf::CSystem::deleteInstance (  )  [inline, static]

Deletes the unique instance of the class.

for FSF, the system should never be deleted before the program ends... Do not attempt to destroy before all threads are completed or terminated!

CCellFactoryBase* fsf::CSystem::getCellFactory ( const std::string &  strID  )  [inline]

Gets a pointer to the cell factory identified by the argument ID string.

static CSystem* fsf::CSystem::getInstance (  )  [inline, static]

Gets a pointer to the unique instance of this class; allocates the intance if necessary.

CNodeFactoryBase* fsf::CSystem::getNodeFactory ( const std::string &  strID  )  [inline]

Gets a pointer to the node factory identified by the argument ID string.

Time fsf::CSystem::getTime (  )  [inline]

Gets the system time on *nix platforms.

void fsf::CSystem::registerCellFactory ( const std::string &  strID,
CCellFactoryBase pCellFactory 
) [inline]

Adds the argument cell factory to this system's map using the argument ID string as key.

void fsf::CSystem::registerNodeFactory ( const std::string &  strID,
CNodeFactoryBase pNodeFactory 
) [inline]

Adds the argument node factory to this system's map using the argument ID string as key.


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

Generated on Thu Oct 21 11:47:38 2010 for MFSM by  doxygen 1.5.9