Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

DDPHandler Class Reference

This class handles the Dog-Discovery-Protocol DDP. More...

#include <DDPHandler.h>

Inheritance diagram for DDPHandler:

Inheritance graph
[legend]
Collaboration diagram for DDPHandler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DDPHandler ()
 ~DDPHandler ()
void initDDPHandler ()
 does stuff which can only be done after aperios completly runs

void sendDDPPackage ()
 sends a ddp-package

virtual void onReceive (void *data, int size)
 called by the framework if a package is recived on the DDP-Port


Public Attributes

DDPListEntry list [Player::numOfPlayerNumbers-1]
 List of the other robots.


Private Attributes

DDPPackage thePackage
 Buffer for the DDPPackage to send *.

unsigned long timeLastPackage
 Time when the last DDPPackage was send *.


Detailed Description

This class handles the Dog-Discovery-Protocol DDP.

Its used to find out the IP-addresses of the teammates and stors them in a list. This list is then used by the UDPHandler for the team-communication

Definition at line 51 of file DDPHandler.h.


Constructor & Destructor Documentation

DDPHandler::DDPHandler  ) 
 

Definition at line 19 of file DDPHandler.cpp.

References DDPListEntry::ip, list, DDPListEntry::port, timeLastPackage, and DDPListEntry::timeLastSeen.

DDPHandler::~DDPHandler  )  [inline]
 

Definition at line 55 of file DDPHandler.h.


Member Function Documentation

void DDPHandler::initDDPHandler  ) 
 

does stuff which can only be done after aperios completly runs

Definition at line 31 of file DDPHandler.cpp.

References UDPEndpoint::bind(), and DDPPORT.

Referenced by UDPHandler::start().

Here is the call graph for this function:

void DDPHandler::sendDDPPackage  ) 
 

sends a ddp-package

This is periodically called by the UDP-Handler

Definition at line 87 of file DDPHandler.cpp.

References DDPPORT, SystemCall::getCurrentSystemTime(), getPlayer(), Player::getPlayerNumber(), Player::getTeamColor(), SystemCall::getTimeSince(), DDPPackage::playerNumber, UDPEndpoint::send(), DDPPackage::teamColor, DDPPackage::teamIdentifier, thePackage, and timeLastPackage.

Referenced by UDPHandler::doRegularStuff().

Here is the call graph for this function:

void DDPHandler::onReceive void *  data,
int  size
[virtual]
 

called by the framework if a package is recived on the DDP-Port

Reimplemented from UDPEndpoint.

Definition at line 36 of file DDPHandler.cpp.

References ASSERT, SystemCall::getCurrentSystemTime(), getPlayer(), Player::getPlayerNumber(), Player::getTeamColor(), idText, and INFO.

Here is the call graph for this function:


Member Data Documentation

DDPListEntry DDPHandler::list[Player::numOfPlayerNumbers-1]
 

List of the other robots.

Definition at line 61 of file DDPHandler.h.

Referenced by DDPHandler(), UDPHandlerEndpoint::onReceive(), and UDPHandlerEndpoint::sendPackage().

DDPPackage DDPHandler::thePackage [private]
 

Buffer for the DDPPackage to send *.

Definition at line 64 of file DDPHandler.h.

Referenced by sendDDPPackage().

unsigned long DDPHandler::timeLastPackage [private]
 

Time when the last DDPPackage was send *.

Definition at line 65 of file DDPHandler.h.

Referenced by DDPHandler(), and sendDDPPackage().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:05:37 2004 for GT2004 by doxygen 1.3.6