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

InMessage Class Reference

An Interface for reading single messages from a MessageQueue that is used by MessageHandler derivates. More...

#include <InMessage.h>

Collaboration diagram for InMessage:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 InMessage (MessageQueueBase &queue)
 Constructor.

unsigned long getTimeStamp () const
 returns the time stamp of the current message

MessageID getMessageID () const
 returns the message id of the current message

int getMessageSize () const
 returns the message size of the current message

Player::teamColor getTeamColor () const
 returns the team color of the robot that sent this message.

Player::playerNumber getPlayerNumber () const
 returns the player number of the robot that sent this message.

int getRobotNumber () const
 returns the robot number of the robot that sent this message.

bool getMessageWasSentFromAPhysicalRobot () const
 returns whether the message was sent from a physical robot.

void resetReadPosition ()
 sets the read position to 0 so that the message can be read again


Public Attributes

InBinaryMessage bin
 An interface for reading binary messages from the queue.

InTextMessage text
 An interface for reading text messages from the queue.

InConfigMessage config
 An interface for reading config-file-style text messages from the queue.


Protected Member Functions

const char * getData () const
 Gives a direct read access to the message.


Private Attributes

MessageQueueBasequeue
 The message queue where the messages are read from.


Friends

class MessageQueue
 gives the class MessageQueue access to protected members

void operator>> (InMessage &message, MessageQueue &queue)
 gives the operator that copies a InMessage to another queue access to protected members

Outoperator<< (Out &stream, const MessageQueue &messageQueue)
 Gives the stream operator access to protected members.


Detailed Description

An Interface for reading single messages from a MessageQueue that is used by MessageHandler derivates.

Use the bin, text or config member for formated reading from a message queue.

Definition at line 124 of file InMessage.h.


Constructor & Destructor Documentation

InMessage::InMessage MessageQueueBase queue  ) 
 

Constructor.

Parameters:
queue A reference to a MessageQueueBase

Definition at line 66 of file InMessage.cpp.


Member Function Documentation

unsigned long InMessage::getTimeStamp  )  const
 

returns the time stamp of the current message

Definition at line 71 of file InMessage.cpp.

References MessageQueueBase::getTimeStamp().

Referenced by operator<<(), and operator>>().

Here is the call graph for this function:

MessageID InMessage::getMessageID  )  const
 

returns the message id of the current message

Definition at line 76 of file InMessage.cpp.

References MessageQueueBase::getMessageID(), and MessageID.

Referenced by GTXabsl2EngineExecutor::handleMessage(), RobotConfiguration::handleMessage(), Process::handleMessage(), Motion::handleMessage(), Logger::handleMessage(), Debug::handleMessage(), Cognition::handleMessage(), ParamRearOnlyInvKinWalkingEngine::handleMessage(), ParamInvKinWalkingEngine::handleMessage(), InvKinWalkingEngine::handleMessage(), GT2004WalkingEngine::handleMessage(), BB2004InvKinWalkingEngine::handleMessage(), GT2003MotionNetSpecialActions::handleMessage(), ObstacleAvoiderOnGreenFieldERS7::handleMessage(), ObstacleAvoiderOnGreenField::handleMessage(), NoOdometrySelfLocator::handleMessage(), GT2004SelfLocator::handleMessage(), GT2004ObstaclesLocator::handleMessage(), GT2004MotionControl::handleMessage(), DebugMotionControl::handleMessage(), GT2004ImageProcessor::handleMessage(), DefaultTacticChooser::handleMessage(), GT2004BehaviorControl::handleMessage(), KickSelectionSymbols::handleMessage(), GT2004BallLocator::handleMessage(), MessageQueue::handleSpecificMessages(), operator<<(), and operator>>().

Here is the call graph for this function:

int InMessage::getMessageSize  )  const
 

returns the message size of the current message

Definition at line 81 of file InMessage.cpp.

References MessageQueueBase::getMessageSize().

Referenced by MessageQueue::getStreamedSize(), operator<<(), and operator>>().

Here is the call graph for this function:

Player::teamColor InMessage::getTeamColor  )  const
 

returns the team color of the robot that sent this message.

Can be undefined.

Definition at line 86 of file InMessage.cpp.

References MessageQueueBase::getTeamColor().

Referenced by operator<<(), and operator>>().

Here is the call graph for this function:

Player::playerNumber InMessage::getPlayerNumber  )  const
 

returns the player number of the robot that sent this message.

Can be undefined.

Definition at line 91 of file InMessage.cpp.

References MessageQueueBase::getPlayerNumber().

Referenced by operator<<(), and operator>>().

Here is the call graph for this function:

int InMessage::getRobotNumber  )  const
 

returns the robot number of the robot that sent this message.

Returns:
0: red1, 3:red4, 4:blue1, 7:blue4, 8:undefined

Definition at line 96 of file InMessage.cpp.

References MessageQueueBase::getPlayerNumber(), and MessageQueueBase::getTeamColor().

Here is the call graph for this function:

bool InMessage::getMessageWasSentFromAPhysicalRobot  )  const
 

returns whether the message was sent from a physical robot.

This is true, when the message was sent from the Aperios/OpenR platform, otherwise false.

Definition at line 102 of file InMessage.cpp.

References MessageQueueBase::getMessageWasSentFromAPhysicalRobot().

Referenced by operator<<(), and operator>>().

Here is the call graph for this function:

void InMessage::resetReadPosition  ) 
 

sets the read position to 0 so that the message can be read again

Definition at line 107 of file InMessage.cpp.

References config, InText::reset(), MessageQueueBase::resetReadPosition(), and text.

Referenced by ModuleHandler::handleMessage(), and GT2004BallLocator::handleMessage().

Here is the call graph for this function:

const char * InMessage::getData  )  const [protected]
 

Gives a direct read access to the message.

Returns:
The adress of the first byte of the message.

Definition at line 114 of file InMessage.cpp.

References MessageQueueBase::getData().

Referenced by operator<<(), and operator>>().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class MessageQueue [friend]
 

gives the class MessageQueue access to protected members

Definition at line 187 of file InMessage.h.

void operator>> InMessage message,
MessageQueue queue
[friend]
 

gives the operator that copies a InMessage to another queue access to protected members

Parameters:
message The InMessage to write.
queue The MessageQueue object.

Definition at line 180 of file MessageQueue.cpp.

Out& operator<< Out stream,
const MessageQueue messageQueue
[friend]
 

Gives the stream operator access to protected members.

Parameters:
stream The stream to write on.
messageQueue The MessageQueue object.
Returns:
The stream.

Definition at line 153 of file MessageQueue.cpp.


Member Data Documentation

MessageQueueBase& InMessage::queue [private]
 

The message queue where the messages are read from.

Note that the selection which message is read is not done by InMessageQueue but by MessageQueue itself.

Definition at line 131 of file InMessage.h.

InBinaryMessage InMessage::bin
 

An interface for reading binary messages from the queue.

Definition at line 135 of file InMessage.h.

Referenced by GTXabsl2EngineExecutor::handleMessage(), RobotConfiguration::handleMessage(), Process::handleMessage(), Motion::handleMessage(), Logger::handleMessage(), Debug::handleMessage(), Cognition::handleMessage(), ParamRearOnlyInvKinWalkingEngine::handleMessage(), ParamInvKinWalkingEngine::handleMessage(), InvKinWalkingEngine::handleMessage(), GT2004WalkingEngine::handleMessage(), BB2004InvKinWalkingEngine::handleMessage(), ObstacleAvoiderOnGreenFieldERS7::handleMessage(), ObstacleAvoiderOnGreenField::handleMessage(), NoOdometrySelfLocator::handleMessage(), GT2004SelfLocator::handleMessage(), GT2004ObstaclesLocator::handleMessage(), GT2004MotionControl::handleMessage(), DebugMotionControl::handleMessage(), DefaultTacticChooser::handleMessage(), GT2004BehaviorControl::handleMessage(), GT2004BallLocator::handleMessage(), LogPlayer::saveAMV(), LogPlayer::saveCSV(), and LogPlayer::saveImages().

InTextMessage InMessage::text
 

An interface for reading text messages from the queue.

Definition at line 138 of file InMessage.h.

Referenced by MessageQueue::handleAllMessages(), KickSelectionSymbols::handleMessage(), MessageQueue::handleSpecificMessages(), and resetReadPosition().

InConfigMessage InMessage::config
 

An interface for reading config-file-style text messages from the queue.

Definition at line 141 of file InMessage.h.

Referenced by MessageQueue::handleAllMessages(), GTXabsl2EngineExecutor::handleMessage(), GT2003MotionNetSpecialActions::handleMessage(), MessageQueue::handleSpecificMessages(), and resetReadPosition().


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