VR-Forces 4.1.1 Class Documentation
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtMessageDispatcher Class Reference

IGI Manager managers both IGI clients and IGI interfaces. More...

Public Types

enum  { theInternalControlId = 1 }
enum  { id_AddInterfaceMap = 1 }
typedef unsigned short IGIInterfaceID
 The IGIInterfaceID type.

Public Member Functions

 DtMessageDispatcher (bool isMaster)
 Protected CTOR, construct using the Instance class.
virtual ~DtMessageDispatcher ()
 DTOR.
void registerProctor (int classId, DtProctor *handler)
 Register an proctor class.
DtProctorfindProctor (int classId)
 Find a handler.
void deliverFromClients ()
 Deliver any messages from clients.
void deliverToClients ()
 Deliver all queued messages to clients.
void queueForDelivery (DtMessage *msg, bool toClients=true, bool toLocalInterface=false)
 Deliver the message, note the msg will be 'owned' and deleted upon send.
void addClient (DtMessageClient *client)
 Add a client to the manager.
void removeClient (DtMessageClient *client)
 Remove a client from the manager.
bool hasClients () const
 Check to see if the IGI Manager has clients.
bool isMaster () const
 Check to see if the Manager is the master manager.
void setIsMaster (bool isMaster)
 Set if the manager is the master manager.

Protected Types

typedef std::list
< DtMessageClient * > 
ClientList
typedef std::map< std::string,
IGIInterfaceID
NameIdMap
typedef std::map
< IGIInterfaceID, DtProxy * > 
IdInterfaceMap
typedef std::list< DtProxy * > InterfaceList
typedef std::map< int,
DtProctor * > 
ProctorTable
typedef std::vector< DtMessage * > MessageList

Protected Member Functions

void sendInterfaceMapToClients (IGIInterfaceID id, const std::string &name)
 Send an interface map to clients.

Protected Attributes

bool myIsMasterFlag
 Holds whether the IGI Manager is the master manager.
IGIInterfaceID myFreeInterfaceId
 Internal id used to generate IDs.
ClientList myClients
 My list of clients.
NameIdMap myIdLookUp
IdInterfaceMap myInstanceLookUp
InterfaceList myUnknownInterfaceList
ProctorTable myProctors
MessageList myMessageQueue

Detailed Description

IGI Manager managers both IGI clients and IGI interfaces.

Member Typedef Documentation

The IGIInterfaceID type.

An IGIInterfaceID uniquely defines an instance.

typedef std::map<std::string,IGIInterfaceID> makVrv::DtMessageDispatcher::NameIdMap
protected
typedef std::list<DtProxy*> makVrv::DtMessageDispatcher::InterfaceList
protected
typedef std::map<int, DtProctor*> makVrv::DtMessageDispatcher::ProctorTable
protected
typedef std::vector<DtMessage*> makVrv::DtMessageDispatcher::MessageList
protected

Member Enumeration Documentation

anonymous enum
Enumerator:
theInternalControlId 
anonymous enum
Enumerator:
id_AddInterfaceMap 

Constructor & Destructor Documentation

makVrv::DtMessageDispatcher::DtMessageDispatcher ( bool  isMaster)

Protected CTOR, construct using the Instance class.

virtual makVrv::DtMessageDispatcher::~DtMessageDispatcher ( )
virtual

DTOR.

Member Function Documentation

void makVrv::DtMessageDispatcher::registerProctor ( int  classId,
DtProctor handler 
)

Register an proctor class.

To remove an proctor class, register a NULL pointer.

Exceptions
DtInvalidInputif an proctor is already registered with that classId.
DtProctor* makVrv::DtMessageDispatcher::findProctor ( int  classId)

Find a handler.

void makVrv::DtMessageDispatcher::deliverFromClients ( )

Deliver any messages from clients.

void makVrv::DtMessageDispatcher::deliverToClients ( )

Deliver all queued messages to clients.

void makVrv::DtMessageDispatcher::queueForDelivery ( DtMessage msg,
bool  toClients = true,
bool  toLocalInterface = false 
)

Deliver the message, note the msg will be 'owned' and deleted upon send.

void makVrv::DtMessageDispatcher::addClient ( DtMessageClient client)

Add a client to the manager.

void makVrv::DtMessageDispatcher::removeClient ( DtMessageClient client)

Remove a client from the manager.

bool makVrv::DtMessageDispatcher::hasClients ( ) const

Check to see if the IGI Manager has clients.

bool makVrv::DtMessageDispatcher::isMaster ( ) const

Check to see if the Manager is the master manager.

void makVrv::DtMessageDispatcher::setIsMaster ( bool  isMaster)

Set if the manager is the master manager.

void makVrv::DtMessageDispatcher::sendInterfaceMapToClients ( IGIInterfaceID  id,
const std::string &  name 
)
protected

Send an interface map to clients.

Member Data Documentation

bool makVrv::DtMessageDispatcher::myIsMasterFlag
protected

Holds whether the IGI Manager is the master manager.

The server should always be the master manager.

IGIInterfaceID makVrv::DtMessageDispatcher::myFreeInterfaceId
protected

Internal id used to generate IDs.

ClientList makVrv::DtMessageDispatcher::myClients
protected

My list of clients.

NameIdMap makVrv::DtMessageDispatcher::myIdLookUp
protected
IdInterfaceMap makVrv::DtMessageDispatcher::myInstanceLookUp
protected
InterfaceList makVrv::DtMessageDispatcher::myUnknownInterfaceList
protected
ProctorTable makVrv::DtMessageDispatcher::myProctors
protected
MessageList makVrv::DtMessageDispatcher::myMessageQueue
protected

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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)