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

rovsoft::io::FlowController Class Reference

Class for reading and writing messages from/to a segmented stream with flow control. More...

#include <FlowController.hh>

Inheritance diagram for rovsoft::io::FlowController:

Inheritance graph
[legend]
Collaboration diagram for rovsoft::io::FlowController:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FlowController (SegmentIOStreamer *stream, MessageStreamParser &reader)
 FlowController (SegmentIStreamer *istr, SegmentOStreamer *ostr, MessageStreamParser &reader)
 Use seperate IStreamer and OStreamer.
virtual void putMessage (const messages::MessagePtr message) throw (TargetUnreachableExceptionPtr)
 This method is used by devices for writing messages to the underlying stream, it should not return until a positive confirmation message was received (if the message being send needs a confirmation).
virtual void run ()
 this function runs as tread
void sendInit ()
virtual ~FlowController ()
 Delets streams.

Protected Member Functions

bool getCNumber (const messages::MessagePtr message)

Protected Attributes

SegmentIStreameristream
SegmentOStreamerostream
MessageStreamParserparser
std::map< unsigned short,
states
device
 the map contains the DA of the devices and a struct for the possible states of the devices
ost::Semaphore write_access

Classes

struct  states
 this structure contains the state of the device More...

Detailed Description

Class for reading and writing messages from/to a segmented stream with flow control.

(like in the EnergyCommunication or the Robotboardcommunication.)

Todo:
Implement writeMessage for writing to stream -> protected

If the parser reads the message and afterwards the end is not reached, the parser should have the option to check if the end was reached, after reading.

--> The task is, how to implement this in a beautiful way.


Constructor & Destructor Documentation

rovsoft::io::FlowController::FlowController SegmentIOStreamer stream,
MessageStreamParser reader
 

Parameters:
stream The stream to read/write messages from/to. Must be dynamically generated, (it is deleted in the destructor of this class.
reader A message stream parser. The reader object will be used to read and parse the messages received on the stream. The object will not get copied, so ensure its availability!

Here is the call graph for this function:

rovsoft::io::FlowController::FlowController SegmentIStreamer istr,
SegmentOStreamer ostr,
MessageStreamParser reader
 

Use seperate IStreamer and OStreamer.

Todo:
Check for null pointers.

Here is the call graph for this function:

rovsoft::io::FlowController::~FlowController  )  [virtual]
 

Delets streams.


Member Function Documentation

bool rovsoft::io::FlowController::getCNumber const messages::MessagePtr  message  )  [protected]
 

void rovsoft::io::FlowController::putMessage const messages::MessagePtr  message  )  throw (TargetUnreachableExceptionPtr) [virtual]
 

This method is used by devices for writing messages to the underlying stream, it should not return until a positive confirmation message was received (if the message being send needs a confirmation).

Exceptions:
TargetUnreachableExceptionPtr if no positive confirmation was received after several trials. Values:
  • "No confirmation" if no confirmation was received.
  • "Bad confirmation" if a negative confirmation was received.

Implements rovsoft::messages::MessageReceiver.

Here is the call graph for this function:

void rovsoft::io::FlowController::run  )  [virtual]
 

this function runs as tread

Here is the call graph for this function:

void rovsoft::io::FlowController::sendInit  ) 
 

Here is the call graph for this function:


Member Data Documentation

std::map<unsigned short,states> rovsoft::io::FlowController::device [protected]
 

the map contains the DA of the devices and a struct for the possible states of the devices

SegmentIStreamer* rovsoft::io::FlowController::istream [protected]
 

SegmentOStreamer* rovsoft::io::FlowController::ostream [protected]
 

MessageStreamParser& rovsoft::io::FlowController::parser [protected]
 

ost::Semaphore rovsoft::io::FlowController::write_access [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue May 31 14:19:32 2005 for Rovsoft by  doxygen 1.4.3