Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
orxonox::TrafficControl Class Reference

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/network/TrafficControl.h>

Inheritance diagram for orxonox::TrafficControl:
orxonox::ClientConnectionListener orxonox::Listable orxonox::Identifiable

Public Member Functions

 TrafficControl ()
 Constructor: assures that only one reference will be created and sets the pointer. More...
 
virtual ~TrafficControl ()
 Destructor: resets the instance pointer to nullptr. More...
 
bool dataSort (obj i, obj j)
 sort-algorithm for sorting the objectList after position in original data stream More...
 
void deleteObject (unsigned int objectID)
 
void fixCreatorDependencies (std::list< obj >::iterator it, std::list< obj > &list, unsigned int clientID)
 
void printList (std::list< obj > &list, unsigned int clientID)
 
bool prioritySort (uint32_t clientID, obj i, obj j)
 sort-algorithm for sorting the objectlist after priorities More...
 
void processObjectList (unsigned int clientID, unsigned int gamestateID, std::list< obj > &list)
 
void setConfigValues ()
 is being used by GSManager from Server: list contains: ObjIds, CreatorIds, Size (in this order) from Client XY Elements of list are accessed by *list[i] Elements of struct i are therefore: *list[i].objID More...
 
- Public Member Functions inherited from orxonox::ClientConnectionListener
 ClientConnectionListener ()
 Constructor Register the object. More...
 
virtual ~ClientConnectionListener ()
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 

Static Public Member Functions

static TrafficControlgetInstance ()
 
static void processAck (unsigned int clientID, unsigned int gamestateID)
 
- Static Public Member Functions inherited from orxonox::ClientConnectionListener
static void broadcastClientConnected (unsigned int clientID)
 Call clientConnected() on all ClientConnectionListeners. More...
 
static void broadcastClientDisconnected (unsigned int clientID)
 Call clientDisconnected() on all ClientConnectionListeners. More...
 

Static Protected Attributes

static TrafficControlinstance_ =nullptr
 Initializing protected members. More...
 

Private Member Functions

void ack (unsigned int clientID, unsigned int gamestateID)
 
virtual void clientConnected (unsigned int clientID) override
 
virtual void clientDisconnected (unsigned int clientID) override
 
void cut (std::list< obj > &list, unsigned int targetsize)
 cut takes the current list that has to be returned to the gsmanager and shortens it in criteria of bandwidth of clientID(XY) More...
 
void evaluateList (unsigned int clientID, std::list< obj > &list)
 evaluates Data given (list) and produces result(->Data to be updated) More...
 
void insertinClientListPerm (unsigned int clientID, obj objinf)
 Definition of private members. More...
 
void updateClientListTemp (std::list< obj > &list)
 updateClientListTemp takes the shortened list which will be sent to the gsmanager and puts the *info into clientListTemp More...
 

Private Attributes

bool bActive_
 
std::map< unsigned int, std::map< unsigned int, objInfo > > clientListPerm_
 permanent client list: contains client ids, object ids and objectInfos (in this order) More...
 
std::map< unsigned int, std::map< unsigned int, std::list< obj > > > clientListTemp_
 temporary client list: contains client ids, gamestate ids and object ids (in this order) More...
 
unsigned int currentClientID
 
unsigned int currentGamestateID
 updateReferenceList currentGamestateID and currentClientID will be defined as soon as TrafficControl is being called by Server More...
 
unsigned int targetSize
 

Constructor & Destructor Documentation

orxonox::TrafficControl::TrafficControl ( )

Constructor: assures that only one reference will be created and sets the pointer.

orxonox::TrafficControl::~TrafficControl ( )
virtual

Destructor: resets the instance pointer to nullptr.

Member Function Documentation

void orxonox::TrafficControl::ack ( unsigned int  clientID,
unsigned int  gamestateID 
)
private
virtual void orxonox::TrafficControl::clientConnected ( unsigned int  clientID)
inlineoverrideprivatevirtual
void orxonox::TrafficControl::clientDisconnected ( unsigned int  clientID)
overrideprivatevirtual
void orxonox::TrafficControl::cut ( std::list< obj > &  list,
unsigned int  targetsize 
)
private

cut takes the current list that has to be returned to the gsmanager and shortens it in criteria of bandwidth of clientID(XY)

bool orxonox::TrafficControl::dataSort ( obj  i,
obj  j 
)

sort-algorithm for sorting the objectList after position in original data stream

void orxonox::TrafficControl::deleteObject ( unsigned int  objectID)
void orxonox::TrafficControl::evaluateList ( unsigned int  clientID,
std::list< obj > &  list 
)
private

evaluates Data given (list) and produces result(->Data to be updated)

evaluateList evaluates whether new obj are there, whether there are things to be updatet and manipulates all this.

void orxonox::TrafficControl::fixCreatorDependencies ( std::list< obj >::iterator  it,
std::list< obj > &  list,
unsigned int  clientID 
)
TrafficControl * orxonox::TrafficControl::getInstance ( )
static
void orxonox::TrafficControl::insertinClientListPerm ( unsigned int  clientID,
obj  objinf 
)
private

Definition of private members.

updateClientListPerm returns void

void orxonox::TrafficControl::printList ( std::list< obj > &  list,
unsigned int  clientID 
)
bool orxonox::TrafficControl::prioritySort ( uint32_t  clientID,
obj  i,
obj  j 
)

sort-algorithm for sorting the objectlist after priorities

static void orxonox::TrafficControl::processAck ( unsigned int  clientID,
unsigned int  gamestateID 
)
inlinestatic
void orxonox::TrafficControl::processObjectList ( unsigned int  clientID,
unsigned int  gamestateID,
std::list< obj > &  list 
)
void orxonox::TrafficControl::setConfigValues ( void  )

is being used by GSManager from Server: list contains: ObjIds, CreatorIds, Size (in this order) from Client XY Elements of list are accessed by *list[i] Elements of struct i are therefore: *list[i].objID

Definition of public members.

void orxonox::TrafficControl::updateClientListTemp ( std::list< obj > &  list)
private

updateClientListTemp takes the shortened list which will be sent to the gsmanager and puts the *info into clientListTemp

Member Data Documentation

bool orxonox::TrafficControl::bActive_
private
std::map<unsigned int, std::map<unsigned int, objInfo > > orxonox::TrafficControl::clientListPerm_
private

permanent client list: contains client ids, object ids and objectInfos (in this order)

std::map<unsigned int, std::map<unsigned int, std::list<obj> > > orxonox::TrafficControl::clientListTemp_
private

temporary client list: contains client ids, gamestate ids and object ids (in this order)

unsigned int orxonox::TrafficControl::currentClientID
private
unsigned int orxonox::TrafficControl::currentGamestateID
private

updateReferenceList currentGamestateID and currentClientID will be defined as soon as TrafficControl is being called by Server

TrafficControl * orxonox::TrafficControl::instance_ =nullptr
staticprotected

Initializing protected members.

unsigned int orxonox::TrafficControl::targetSize
private

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