Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Message Class Reference

#include <Message.h>

List of all members.

Public Methods

 Message ()
 Message (double *, int)
 Message (int *, int)
 Message (char *, int)
virtual ~Message ()
virtual int putData (char *theData, int startLoc, int endLoc)
virtual const char* getData (void)
virtual int getSize (void)


Detailed Description

Messages are objects that can be sent between Channels. They are provided to allow data of arbitrary length and type, e.g. structs, to be sent between processes running on similar machine architectures. WARNING Sending Messages between machines with different architectures can result in erroniuos data being received. Each Message object keeps a pointer to the data it represents and an integer outlining the data size. There is no copy of the data kept by the Message. \

{\bf Constructors} \ Constructors \ {Message();} \ {Message(double *, int num);}\ {Message(int *, int num);}\ {Message(char *, int num);} \ \ Destructor \ {virtual~ Message();}\ \ Public Member Functions \ {virtual int putData(char *theData, int startLoc, int endLoc);}; \ {virtual const char *getData(void);}\ {virtual int getSize(void);} \

{\bf Constructors} \ {Message();} \ To construct an empty message. \

{Message(double *data, int num);}\ To construct a message for sending/receiving an array containing {num} doubles. \

{Message(int *data, int num);}\ To construct a message for sending/receiving an array containing {num} ints. \

{Message(char *data, int num);} \ To construct a message for sending/receiving a string of {num} characters or a struct. \

{\bf Destructor} \ {virtual~ Message();}\ Does nothing. \

{\bf Public Methods } \ {virtual int putData(char *theData, int startLoc, int endLoc);}; \ A method which will put the data given by the character pointer {theData} of size {endLoc -startLoc} into the data array pointed to by the Message starting at location in this array. Returns if successful; an error message is printed and a is returned if not. The routine {bcopy()} is used to copy the data. \

{virtual const char *getData(void);}\ A method which returns a const char * pointer to the messages data. \

{virtual int getSize(void);} \ A method to get the size of the array. The unit of size is that of a character.

Definition at line 99 of file Message.h.


Constructor & Destructor Documentation

Message::Message ( )
 

Definition at line 32 of file Message.cpp.

Message::Message ( double * data,
int num )
 

Definition at line 38 of file Message.cpp.

Message::Message ( int * data,
int num )
 

Definition at line 44 of file Message.cpp.

Message::Message ( char * data,
int num )
 

Definition at line 50 of file Message.cpp.

Message::~Message ( ) [virtual]
 

Definition at line 56 of file Message.cpp.


Member Function Documentation

const char * Message::getData ( void ) [virtual]
 

Definition at line 79 of file Message.cpp.

int Message::getSize ( void ) [virtual]
 

Definition at line 85 of file Message.cpp.

int Message::putData ( char * theData,
int startLoc,
int endLoc ) [virtual]
 

Definition at line 64 of file Message.cpp.


The documentation for this class was generated from the following files:
Copyright Contact Us