#include <FsfSystem.h>
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. | |
CNodeFactoryBase * | getNodeFactory (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. | |
CCellFactoryBase * | getCellFactory (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 CCell * | createCell (const std::string &strID) |
static CNode * | createNode (const std::string &strID, fsf::CNode *pParent=NULL) |
template<class N > | |
static CPassiveFilter< N > * | createPassiveFilter (const std::string &strName) |
Singleton pattern | |
static CSystem * | getInstance () |
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. |
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.
CSystem::~CSystem | ( | ) |
Destructor.
CCell * CSystem::createCell | ( | const std::string & | strID | ) | [static] |
strID | The cell type ID string |
CNode * CSystem::createNode | ( | const std::string & | strID, | |
fsf::CNode * | pParent = NULL | |||
) | [static] |
strID | The node type ID string | |
pParent | A pointer to the new node's parent (can be NULL) |
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.