CPPGPGPU Library - Reference (Doxygen)

Main Page | General Use | Reference | Examples Info | Get/Download CPPGPGPU | SF.net Page

NodeManager Class Reference

Full Node Manager, access using NODEMAN. More...

#include <Node.h>

List of all members.

Public Member Functions

void RegisterType (const string &sClass, ProducerFunct t)
 Factory Portion (this is called internally).
Node Spawn (const string &sClass, const string &sName)
 Spawn a new object of type sClass and name sName. If one already exists, don't make a new one.
Node SpawnExplicit (const string &sClass, const string &sName)
 Spawn a new object of type sClass and name sName. If one already exists, make a new one anyway.
void Drop (NodeObject *nObject)
 Remove nObject from the inventory.
void Add (NodeObject *nObject)
 Add nObject from the inventory.
Node GetInstance (const string &sName)
 Find the object named sName and return it. If not found, a Null node is returned.
NodeObjectGetInstanceExp (const string &sName)
 Same as GetInstance except don't Nodize it. Use of this function is discouraged.
void RegisterForMessage (const string &sMessage, int iMessageID, Node nToRegister)
 Register object nToRegister to the message sMessage so it receives iMessageID.
void UnregisterForMessage (const string &sMessage, int iMessageID, Node nToRegister)
 Undo previous registeration.
void BroadcastMessage (const string &sMessage, const string &sPayload, Node nTarget)
 Broadcast specific message to all listening objects.
void PostMessage (const string &sMessage, const string &sPayload, Node nTarget, const float fTimeInFuture=0)
 Post a message for future transmission to any then listening objects.
void Update (const float fDtime)
 Update the Node Manager, this is suggested to be called once per frame.
NodeObjectDerefGet (const string &sType, const string &sName)
 Like Spawn but doesn't return Node. Suggested you don't use this.
map< string, NodeObject * > * GetObjectInstanceMap ()
 Return a map to all instances. It is suggested you allow this to be used internally, and don't use it, yourself.

Static Public Member Functions

static NodeManagerInstance ()

Private Attributes

bool m_bInit
 Will always be zero on static-time init. (Used for static time initialization).
map< string, ProducerFunctm_mToMake
 Map to all ProducerFunct's for how to make every known type of object.
map< string, NodeObject * > m_mInstances
 Map to all instances of all registered objects.
map< string, map< Node, int > > m_mMessageMatches
 Map to all possible messages.
vector< StringPairm_dImmediateMessages
vector< StringPairFloatm_vFutureMessages
 [Internal] List of all pending messages
double m_fCurrentTime
 Current time (From epoch).

Classes

struct  StringPair
 [Internal] Structure to hold all message data pairs. More...
struct  StringPairFloat
 [Internal] Structure to hold all information regarding active, waiting messages. More...


Detailed Description

Full Node Manager, access using NODEMAN.

Definition at line 179 of file Node.h.


Member Function Documentation

NodeManager * NodeManager::Instance (  )  [static]

Definition at line 210 of file Node.cpp.

void NodeManager::RegisterType ( const string sClass,
ProducerFunct  t 
)

Factory Portion (this is called internally).

Definition at line 220 of file Node.cpp.

Node NodeManager::Spawn ( const string sClass,
const string sName 
)

Spawn a new object of type sClass and name sName. If one already exists, don't make a new one.

Definition at line 225 of file Node.cpp.

Node NodeManager::SpawnExplicit ( const string sClass,
const string sName 
)

Spawn a new object of type sClass and name sName. If one already exists, make a new one anyway.

Definition at line 234 of file Node.cpp.

void NodeManager::Drop ( NodeObject nObject  ) 

Remove nObject from the inventory.

Definition at line 249 of file Node.cpp.

void NodeManager::Add ( NodeObject nObject  ) 

Add nObject from the inventory.

Definition at line 243 of file Node.cpp.

Node NodeManager::GetInstance ( const string sName  )  [inline]

Find the object named sName and return it. If not found, a Null node is returned.

Definition at line 200 of file Node.h.

NodeObject* NodeManager::GetInstanceExp ( const string sName  )  [inline]

Same as GetInstance except don't Nodize it. Use of this function is discouraged.

Definition at line 203 of file Node.h.

void NodeManager::RegisterForMessage ( const string sMessage,
int  iMessageID,
Node  nToRegister 
)

Register object nToRegister to the message sMessage so it receives iMessageID.

Definition at line 259 of file Node.cpp.

void NodeManager::UnregisterForMessage ( const string sMessage,
int  iMessageID,
Node  nToRegister 
)

Undo previous registeration.

Definition at line 264 of file Node.cpp.

void NodeManager::BroadcastMessage ( const string sMessage,
const string sPayload,
Node  nTarget 
)

Broadcast specific message to all listening objects.

Definition at line 274 of file Node.cpp.

void NodeManager::PostMessage ( const string sMessage,
const string sPayload,
Node  nTarget,
const float  fTimeInFuture = 0 
)

Post a message for future transmission to any then listening objects.

Definition at line 290 of file Node.cpp.

void NodeManager::Update ( const float  fDtime  ) 

Update the Node Manager, this is suggested to be called once per frame.

Definition at line 310 of file Node.cpp.

NodeObject* NodeManager::DerefGet ( const string sType,
const string sName 
) [inline]

Like Spawn but doesn't return Node. Suggested you don't use this.

Definition at line 227 of file Node.h.

map< string, NodeObject* >* NodeManager::GetObjectInstanceMap (  )  [inline]

Return a map to all instances. It is suggested you allow this to be used internally, and don't use it, yourself.

Definition at line 230 of file Node.h.


Member Data Documentation

bool NodeManager::m_bInit [private]

Will always be zero on static-time init. (Used for static time initialization).

Definition at line 234 of file Node.h.

map< string, ProducerFunct > NodeManager::m_mToMake [private]

Map to all ProducerFunct's for how to make every known type of object.

Definition at line 237 of file Node.h.

map< string, NodeObject * > NodeManager::m_mInstances [private]

Map to all instances of all registered objects.

Definition at line 240 of file Node.h.

map< string, map< Node, int > > NodeManager::m_mMessageMatches [private]

Map to all possible messages.

Definition at line 243 of file Node.h.

vector< StringPair > NodeManager::m_dImmediateMessages [private]

Definition at line 253 of file Node.h.

vector< StringPairFloat > NodeManager::m_vFutureMessages [private]

[Internal] List of all pending messages

Definition at line 267 of file Node.h.

double NodeManager::m_fCurrentTime [private]

Current time (From epoch).

Definition at line 270 of file Node.h.


The documentation for this class was generated from the following files:
© 2005-2007 Charles Lohr, Joshua Allen, David Chapman, Andrew Lohr. All material including documentation under the MIT/X11 license.