InMessage Class Reference

#include <InMessage.h>

List of all members.

Public Member Functions

 InMessage (MessageQueueBase &queue)
unsigned long getTimeStamp () const
MessageID getMessageID () const
int getMessageSize () const
Player::teamColor getTeamColor () const
Player::playerNumber getPlayerNumber () const
int getRobotNumber () const
bool getMessageWasSentFromAPhysicalRobot () const
void resetReadPosition ()

Public Attributes

InBinaryMessage bin
InTextMessage text
InConfigMessage config

Protected Member Functions

const char * getData () const

Private Attributes

MessageQueueBasequeue

Friends

class MessageQueue
void operator>> (InMessage &message, MessageQueue &queue)
Outoperator<< (Out &stream, const MessageQueue &messageQueue)


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

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(), and queue.

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

MessageID InMessage::getMessageID (  )  const

returns the message id of the current message

Definition at line 76 of file InMessage.cpp.

References MessageQueueBase::getMessageID(), and queue.

Referenced by GTXabsl2EngineExecutor::handleMessage(), RobotConfiguration::handleMessage(), Process::handleMessage(), CRobotRemoteApp::handleMessage(), DebugDrawingManagerMessageHandler::handleMessage(), CMessageHandlerForQueueToGUI::handleMessage(), CMessageHandlerForQueueFromPhysicalRobots::handleMessage(), CXabsl2DlgBar::handleMessage(), CValueHistoryDlgBar::handleMessage(), CTSLColorTableToolDlgBar::handleMessage(), CTimeDiagramDlgBar::handleMessage(), CStatisticsDlgBar::handleMessage(), CRadarViewerDlgBar::handleMessage(), CRadarViewer3DDlgBar::handleMessage(), COptionRatingDlgBar::handleMessage(), CMofTesterDlgBar::handleMessage(), CMessageViewerDlgBar::handleMessage(), CKickEditorDlgBar::handleMessage(), CJointViewerDlgBar::handleMessage(), CInvKinParametersDlgBar::handleMessage(), CHSIColorTableToolDlgBar::handleMessage(), CHistogramDlgBar::handleMessage(), CGT2004WalkingEngineParamSetDlgBar::handleMessage(), CGT2004BallLocatorSetDlgBar::handleMessage(), CColorTable64DlgBar::handleMessage(), CColorSpaceDlgBar::handleMessage(), Motion::handleMessage(), Logger::handleMessage(), Debug::handleMessage(), Cognition::handleMessage(), TimeInfo::handleMessage(), RobotConsole::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>>().

int InMessage::getMessageSize (  )  const

returns the message size of the current message

Definition at line 81 of file InMessage.cpp.

References MessageQueueBase::getMessageSize(), and queue.

Referenced by MessageQueue::getStreamedSize(), CRobotRemoteApp::handleMessage(), COptionRatingDlgBar::handleMessage(), CMessageViewerDlgBar::handleMessage(), RobotConsole::handleMessage(), operator<<(), and operator>>().

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(), and queue.

Referenced by CRobotControlQueues::isFromSelectedOrUndefinedRobot(), operator<<(), and operator>>().

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(), and queue.

Referenced by COptionRatingDlgBar::handleMessage(), operator<<(), and operator>>().

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(), MessageQueueBase::getTeamColor(), queue, Player::undefinedPlayerNumber, and Player::undefinedTeamColor.

Referenced by CRobotControlQueues::isFromSelectedOrUndefinedRobot().

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(), and queue.

Referenced by RobotConsole::handleMessage(), operator<<(), and operator>>().

unsigned long InMessage::getTimeStamp (  )  const

returns the time stamp of the current message

Definition at line 71 of file InMessage.cpp.

References MessageQueueBase::getTimeStamp(), and queue.

Referenced by CJointViewerDlgBar::handleMessage(), RobotConsole::handleMessage(), operator<<(), and operator>>().

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, queue, InText::reset(), MessageQueueBase::resetReadPosition(), and text.

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


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.

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

Streaming operator that writes a MessageQueue to a stream.

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

Definition at line 153 of file MessageQueue.cpp.

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

Streaming operator that writes a InMessage to another MessageQueue.

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

Definition at line 180 of file MessageQueue.cpp.


Member Data Documentation

InBinaryMessage InMessage::bin

An interface for reading binary messages from the queue

Definition at line 135 of file InMessage.h.

Referenced by DebugDrawing::addShapeFromQueue(), GTXabsl2EngineExecutor::handleMessage(), RobotConfiguration::handleMessage(), Process::handleMessage(), Router::handleMessage(), CRobotRemoteApp::handleMessage(), CMessageHandlerForQueueToGUI::handleMessage(), CMessageHandlerForQueueFromPhysicalRobots::handleMessage(), CXabsl2DlgBar::handleMessage(), CValueHistoryDlgBar::handleMessage(), CTSLColorTableToolDlgBar::handleMessage(), CTimeDiagramDlgBar::handleMessage(), CRadarViewerDlgBar::handleMessage(), CRadarViewer3DDlgBar::handleMessage(), COptionRatingDlgBar::handleMessage(), CMofTesterDlgBar::handleMessage(), CKickEditorDlgBar::handleMessage(), CJointViewerDlgBar::handleMessage(), CInvKinParametersDlgBar::handleMessage(), CHSIColorTableToolDlgBar::handleMessage(), CHistogramDlgBar::handleMessage(), CGT2004WalkingEngineParamSetDlgBar::handleMessage(), CColorTable64DlgBar::handleMessage(), CColorSpaceDlgBar::handleMessage(), Motion::handleMessage(), Logger::handleMessage(), Debug::handleMessage(), Cognition::handleMessage(), Xabsl2Info::handleMessage(), TimeInfo::handleMessage(), RobotConsole::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(), CStatisticsDlgBar::handleMessageOracledWorldState(), CStatisticsDlgBar::handleMessagePercepts(), CStatisticsDlgBar::handleMessageWorldState(), CGT2004BallLocatorSetDlgBar::ReadFilterStates(), CGT2004BallLocatorSetDlgBar::ReadKalmanParameters(), LogPlayer::saveAMV(), LogPlayer::saveCSV(), and LogPlayer::saveImages().

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().

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.

Referenced by getData(), getMessageID(), getMessageSize(), getMessageWasSentFromAPhysicalRobot(), getPlayerNumber(), getRobotNumber(), getTeamColor(), getTimeStamp(), and resetReadPosition().

InTextMessage InMessage::text

An interface for reading text messages from the queue

Definition at line 138 of file InMessage.h.

Referenced by MessageQueue::handleAllMessages(), CRobotRemoteApp::handleMessage(), COptionRatingDlgBar::handleMessage(), CMessageViewerDlgBar::handleMessage(), RobotConsole::handleMessage(), KickSelectionSymbols::handleMessage(), MessageQueue::handleSpecificMessages(), and resetReadPosition().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:38:39 2006 for DT2005.panorama by  doxygen 1.4.7