Amessage, this
is described first. However no instances of Amessage should ever be
created, it is intended as a base class for other messages. For this
reason no constructor is provided, and the default constructor will
return an error if used.
class Amessage: public Message
#include Message.h // Ptolemy include file
#include Amessage.h // ATLAS include file
int Amessage::eventIdentifier() const
To query the unique event identifier to which this message refers. This is set by the constructor, and may not be subsequently changed.
double Amessage::creationTime() const
To query the simulation time at which this message was created. To be used for statistics gathering purposes. This is set by the constructor and may not be subsequently changed.
const Length* Amessage::length() const
To query the length of data transfer which this message represents. This returns a pointer to a constant object of type Length. This was included (rather than a simple int) following discussion because it was clear that the length will be required in different units, priincipally bits (for switches) and bytes or words (for buses).
const NodeAddress* Amessage::sourceAddress() const
To query the node address of the originator (=source = creator) of this message. This is set in the constructor and cannot be changed. The reson for this restriction is that in the presently agreed philosophy all messages only live between two nodes. If a message is to be passed on by a node then a clone is made with the address of the new creator. This returns a pointer to a constant NodeAddress object . It is assumed that all nodes will be given a unique node address at creation time.
void Amessage::destinationAddress(const NodeAddress& )
const NodeAddress* Amessage::destinationAddress() const
To set and query the node address of the intended destination for the message [Typically the source will be connected to one port of a switch, and the destination will be connected to another. The switch will, by some means, know what is connected to it and route accordingly]. The query method returns a pointer to a constant NodeAddress object.
const char* dataType() const
This is a method which Ptolemy demands you redefine and which is used to identify a message type. This returns a constant string = "classname". For example Amessage::dataType() returns "Amessage" , whereas RoiDataRequest::dataType() returns "RoiDataRequest" .
int isA( const char* typ ) const
This is a method which Ptolemy demands you redefine and which is used to identify a message type. Returns `true' if typ=="classname" or any "superclassname". For example RoiDataRequest::isA( "RoiDataRequest" ) returns "true", as does RoiDataRequest::isA( "Amessage" ) and RoiDataRequest::isA ( "Message" )
Message* Amessage::clone() const
This is a method which Ptolemy demands you redefine. To make a clone of the object and return a pointer to the base Message class.
None.
DataRequest message . In general
this represents all of the data for a particular event contained by
the Rob.
#include "Message.h"
#include "Amessage.h"
Methods provided in addition to those provided by Amessage are:
NONE
Data( int eventIdentifier,
const Length& length,
double creationTime,
const NodeAddress& sourceAddress,
const NodeAddress& destinationAddress
);
Data( double creationTime,
const NodeAddress& sourceAddress,
const Data&
);
for use when a message is to be copied in order to pass it on. It is
therefore necessary to set the new creator information.
Data( const Data& ) ;
is the simple copy constructor.
#include "Message.h"
#include "Amessage.h"
int roiIdentifier() const
Method to query the unique roi identifier of the roi request which this message represents. An roi identifier should be unique within an event.
const RoiDescriptor* roiDescriptor() const
Method to query the descriptor of the roi which this message asks for.
void targetAddress( const NodeAddress& targetAddress
)
const NodeAddress* targetAddress() const
Metohds to set/query the address of the node to which the data extracted as a result of this request should be sent. This need not necessarily be the same node as the source of the RoiDataRequest message. For example a supervisor may generate roi requests but want the data sent to some other designated processor.
RoiDataRequest(
int eventIdentifier,
const Length& length,
double creationTime,
const NodeAddress& sourceAddress,
const NodeAddress& destinationAddress
int roiIdentifier,
const RoiDescriptor& roiDescriptor,
const NodeAddress& targetAddress
);
RoiDataRequest(
double creationTime,
const NodeAddress& sourceAddress,
const RoiDataRequest&
);
for use when a message is to be copied in order to pass it on. It is
therefore necessary to set the new creator information.
RoiDataRequest( const RoiDataRequest& ) ;
is the simple copy constructor.
#include "Message.h"
#include "Amessage.h"
void targetAddress( const NodeAddress& targetAddress )
const NodeAddress* targetAddress() const
Metohds to set/query the address of the node to which the data extracted as a result of this request should be sent. This need not necessarily be the same node as the source of the RoiDataRequest message. For example a supervisor may generate roi requests but want the data sent to some other designated processor.
DataRequest(
int eventIdentifier,
const Length& length,
double creationTime,
const NodeAddress& sourceAddress,
const NodeAddress& destinationAddress
const NodeAddress& targetAddress
);
DataRequest(
double creationTime,
const NodeAddress& sourceAddress,
const DataRequest&
);
for use when a message is to be copied in order to pass it on. It is
therefore necessary to set the new creator information.
DataRequest( DataRequest& ) ;
is the simple copy constructor.
#include "Message.h"
#include "Amessage.h"
int roiIdentifier( ) const ;
Method to query the unique roi identifier of the roi request which this message represents. An roi identifier should be unique within an event.
RoiData( int eventIdentifier,
const Length& length,
double creationTime,
const NodeAddress& sourceAddress,
const NodeAddress& destinationAddress,
int roiIdentifier
);
RoiData( double creationTime,
const NodeAddress& sourceAddress,
const RoiData&
);
for use when a message is to be copied in order to pass it on. It is therefore
necessary to set the new creator information.
RoiData( const RoiData& ) ;
is the simple copy constructor.
Amessage are:
To query the number of events to be deleted and access the list of
event IDs.
To query / set the node address to which this data should be
forwarded.
To query / set the node address to which this data should be
forwarded.
This is currently a standard Amessage as the only field of interest is
the event ID.
int nEvents ()
operator []
Message name: "RobData"
This message is the same as the Data message except that it has a
target address which is different from its destination address. It
is used within the ROB complex to pass data from the ROB controller
to the network via the ROB-out.
Include files required:
#include "Amessage.h"
Methods:
Methods provided in addition to those provided by
Amessage are:
const NodeAddress* targetAddress() const
void targetAddress( const NodeAddress& targetAddress )Constructors
RobData(
for initial creation of message.
int eventIdentifier,
const Length& length,
double creationTime,
const NodeAddress& sourceAddress,
const NodeAddress& destinationAddress,
const NodeAddress& targetAddress
)
RobData(
for use when a message is to be copied in order to pass it on. It is
therefore necessary to set the new creator information.
double creationTime,
const NodeAddress& sourceAddress,
const RobData& msg
)
RobData( const RobData& msg )
is the simple copy constructor.
Message name: "RobRoiData"
This message is the same as the RoiData message except that it has a
target address which is different from its destination address. It
is used within the ROB complex to pass data from the ROB controller
to the network via the ROB-out.
Include files required:
#include "Amessage.h"
Methods:
Methods provided in addition to those provided by
Amessage are:
const NodeAddress* targetAddress() const
void targetAddress( const NodeAddress& targetAddress )Constructors
RobRoiData(
for initial creation of message.
int eventIdentifier,
const Length& length,
double creationTime,
const NodeAddress& sourceAddress,
const NodeAddress& destinationAddress,
const NodeAddress& targetAddress
int roiId
)
RobRoiData(
for use when a message is to be copied in order to pass it on. It is
therefore necessary to set the new creator information.
double creationTime,
const NodeAddress& sourceAddress,
const RobRoiData& msg
)
RobRoiData( const RobRoiData& msg )
is the simple copy constructor.
Message name: "SteerEvent"
This is currently a standard Amessage as the only field of interest is
the event ID.
Message name:
"SteeringComplete"
This message informs the supervisor that the level 2 processing for
the event is complete.