xc
Public Member Functions | Protected Member Functions | List of all members
XC::Channel Class Referenceabstract

Channel is an abstract base class which defines the channel interface. More...

#include <Channel.h>

Inheritance diagram for XC::Channel:
XC::FE_Datastore XC::MPI_Channel XC::TCP_Socket XC::TCP_SocketNoDelay XC::UDP_Socket XC::DBDatastore XC::FileDatastore XC::NEESData XC::BerkeleyDbDatastore XC::MySqlDatastore XC::OracleDatastore XC::SQLiteDatastore

Public Member Functions

 Channel (CommandEntity *owr=nullptr)
 Constructor.
 
virtual char * addToProgram (void)=0
 When creating remote actors the channels created in the actor space need to know how to contact the shadows channels. More...
 
virtual int setUpConnection (void)=0
 
virtual int setNextAddress (const ChannelAddress &theAddress)=0
 A method invoked to set specify the next address that the next messages to be sent if {sendMessage()} or received if {recvMessage()} is invoked with a null pointer. More...
 
virtual ChannelAddressgetLastSendersAddress (void)=0
 
virtual bool isDatastore (void) const
 Return true if channel is a data store.
 
virtual int getDbTag (void) const
 Return next available database tag. More...
 
bool checkDbTag (const int &dbTag)
 Check if a dbTag is already used.
 
const IDgetUsedTags (void) const
 Return the list of dbTags already used.
 
void clearDbTags (void)
 Reset used database tags set.
 
int getTag (void) const
 Return the object tag.
 
virtual int sendObj (int commitTag, MovableObject &theObj, ChannelAddress *theAddress=nullptr)=0
 To send the object theObj and the commit tag commitTag to a remote Channel whose address is given by theAddress. More...
 
virtual int recvObj (int commitTag, MovableObject &theObj, FEM_ObjectBroker &theBroker, ChannelAddress *theAddress=nullptr)=0
 To receive the object theObj with the commit tag commitTag from a remote Channel whose address is given by theAddress. More...
 
template<class inputIterator >
int sendObjs (int commitTag, const inputIterator &first, const inputIterator &last, ChannelAddress *theAddress=nullptr)
 Send the objects on interval [first,last).
 
template<class inputIterator >
int recvObjs (int commitTag, const inputIterator &first, const inputIterator &last, FEM_ObjectBroker &, ChannelAddress *theAddress=nullptr)
 Receive an object sequence.
 
virtual int sendMsg (int dbTag, int commitTag, const Message &theMsg, ChannelAddress *theAddress=nullptr)=0
 A method invoked to send the data in the Message object theMsg to another Channel object. More...
 
virtual int recvMsg (int dbTag, int commitTag, Message &theMsg, ChannelAddress *theAddress=nullptr)=0
 Invoked to send the data in the Message object theMsg to another Channel object. More...
 
virtual int sendMatrix (int dbTag, int commitTag, const Matrix &theMatrix, ChannelAddress *theAddress=nullptr)=0
 Invoked to receive the data in the Matrix object theMatrix to another Channel object. More...
 
virtual int recvMatrix (int dbTag, int commitTag, Matrix &theMatrix, ChannelAddress *theAddress=nullptr)=0
 Invoked to receive the data in the Matrix object theMatrix to another Channel object. More...
 
virtual int sendVector (int dbTag, int commitTag, const Vector &theVector, ChannelAddress *theAddress=nullptr)=0
 Invoked to receive the data in the Vector object theVector to another Channel object. More...
 
virtual int recvVector (int dbTag, int commitTag, Vector &theVector, ChannelAddress *theAddress=nullptr)=0
 Invoked to receive the data in the Vector object theVector to another Channel object. More...
 
virtual int sendID (int dbTag, int commitTag, const ID &theID, ChannelAddress *theAddress=nullptr)=0
 Invoked to receive the data in the ID object theID to another Channel object. More...
 
virtual int recvID (int dbTag, int commitTag, ID &theID, ChannelAddress *theAddress=nullptr)=0
 Invoked to receive the data in the ID object theID to another Channel object. More...
 

Protected Member Functions

int sendMovable (int commitTag, MovableObject &)
 Send theObject.
 
int receiveMovable (int commitTag, MovableObject &, FEM_ObjectBroker &)
 Receive theObject.
 

Detailed Description

Channel is an abstract base class which defines the channel interface.

is a point of communication in a program, a mailbox to/from which data enters/leaves a program. Channels are objects through which the objects in the current processes address space can interact with objects in another processes address space. A channel in one process space is associated with a channel in the address space of another process space. The interaction is in the form of data sent between the two processes along the connection line.

Member Function Documentation

§ addToProgram()

virtual char* XC::Channel::addToProgram ( void  )
pure virtual

When creating remote actors the channels created in the actor space need to know how to contact the shadows channels.

This information is provided in the string returned from this method. It is used by the machine broker when starting the remote process. It places this information as the last arguments to the program.

Implemented in XC::TCP_SocketNoDelay, XC::UDP_Socket, XC::TCP_Socket, XC::FE_Datastore, XC::MPI_Channel, and XC::OracleDatastore.

§ getDbTag()

int XC::Channel::getDbTag ( void  ) const
virtual

Return next available database tag.

Return the next available database tag, must be an integer value greater than 0, 0 is used by the objects to check if they have yet been assigned a database tag. The method defined for the Channel base class always returns 0, only database channel objects need worry about assigning unique integer values.

Reimplemented in XC::FE_Datastore, XC::NEESData, and XC::BerkeleyDbDatastore.

§ recvID()

virtual int XC::Channel::recvID ( int  dbTag,
int  commitTag,
ID theID,
ChannelAddress theAddress = nullptr 
)
pure virtual

Invoked to receive the data in the ID object theID to another Channel object.

The object will obtain the data and size of the data to be sent by invoking getData() and getSize() on theID. The channel object is then responsible for sending that data to the remote channel address given by theAddress. If theAddress is 0, the Channel sends to the Channel with the address last set in a send..()}, recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::MPI_Channel, XC::OracleDatastore, and XC::SQLiteDatastore.

§ recvMatrix()

virtual int XC::Channel::recvMatrix ( int  dbTag,
int  commitTag,
Matrix theMatrix,
ChannelAddress theAddress = nullptr 
)
pure virtual

Invoked to receive the data in the Matrix object theMatrix to another Channel object.

The object will obtain the data and size of the data to be sent by invoking getData() and getSize() on theMatrix. The channel object is then responsible for sending that data to the remote channel address given by theAddress. If theAddress is 0, the Channel sends to the Channel with the address last set in a send..()}, recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::MPI_Channel, XC::OracleDatastore, and XC::SQLiteDatastore.

§ recvMsg()

virtual int XC::Channel::recvMsg ( int  dbTag,
int  commitTag,
Message theMsg,
ChannelAddress theAddress = nullptr 
)
pure virtual

Invoked to send the data in the Message object theMsg to another Channel object.

The object will obtain the the size of the data that is being received by invoking getSize() on theMsg. The channel object is then responsible for receiving that amount of data from the channel whose address is given by theAddress. If theAddress is 0, the Channel receives from the Channel with the address last set in a send..(), recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::OracleDatastore, XC::MPI_Channel, and XC::SQLiteDatastore.

§ recvObj()

virtual int XC::Channel::recvObj ( int  commitTag,
MovableObject theObj,
FEM_ObjectBroker theBroker,
ChannelAddress theAddress = nullptr 
)
pure virtual

To receive the object theObj with the commit tag commitTag from a remote Channel whose address is given by theAddress.

If theAddress is 0, the Channel receives from the Channel with the address last set in a send..(), recv..()}, or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::UDP_Socket, XC::TCP_Socket, XC::FE_Datastore, XC::MPI_Channel, and XC::OracleDatastore.

§ recvVector()

virtual int XC::Channel::recvVector ( int  dbTag,
int  commitTag,
Vector theVector,
ChannelAddress theAddress = nullptr 
)
pure virtual

Invoked to receive the data in the Vector object theVector to another Channel object.

The object will obtain the data and size of the data to be sent by invoking getData() and getSize() on theVector. The channel object is then responsible for sending that data to the remote channel address given by theAddress. If theAddress is 0, the Channel sends to the Channel with the address last set in a send..()}, recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::MPI_Channel, XC::OracleDatastore, and XC::SQLiteDatastore.

§ sendID()

virtual int XC::Channel::sendID ( int  dbTag,
int  commitTag,
const ID theID,
ChannelAddress theAddress = nullptr 
)
pure virtual

Invoked to receive the data in the ID object theID to another Channel object.

The object will obtain the data and size of the data to be sent by invoking getData() and getSize() on theID. The channel object is then responsible for sending that data to the remote channel address given by theAddress. If theAddress is 0, the Channel sends to the Channel with the address last set in a send..()}, recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::MPI_Channel, XC::OracleDatastore, and XC::SQLiteDatastore.

§ sendMatrix()

virtual int XC::Channel::sendMatrix ( int  dbTag,
int  commitTag,
const Matrix theMatrix,
ChannelAddress theAddress = nullptr 
)
pure virtual

Invoked to receive the data in the Matrix object theMatrix to another Channel object.

The object will obtain the data and size of the data to be sent by invoking getData() and getSize() on theMatrix. The channel object is then responsible for sending that data to the remote channel address given by theAddress. If theAddress is 0, the Channel sends to the Channel with the address last set in a send..()}, recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::MPI_Channel, XC::OracleDatastore, and XC::SQLiteDatastore.

§ sendMsg()

virtual int XC::Channel::sendMsg ( int  dbTag,
int  commitTag,
const Message theMsg,
ChannelAddress theAddress = nullptr 
)
pure virtual

A method invoked to send the data in the Message object theMsg to another Channel object.

The object will obtain the data and size of the data to be sent by invoking getData() and getSize() on theMsg. The channel object is then responsible for sending that data to the remote channel address given by theAddress. If theAddress is 0, the Channel sends to the Channel with the address last set in a send..()}, recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::MPI_Channel, XC::OracleDatastore, and XC::SQLiteDatastore.

§ sendObj()

virtual int XC::Channel::sendObj ( int  commitTag,
MovableObject theObj,
ChannelAddress theAddress = nullptr 
)
pure virtual

To send the object theObj and the commit tag commitTag to a remote Channel whose address is given by theAddress.

If theAddress is 0, the Channel sends to the Channel with the address last set in a send..(), recv..(), or {setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::UDP_Socket, XC::TCP_Socket, XC::FE_Datastore, XC::OracleDatastore, and XC::MPI_Channel.

§ sendVector()

virtual int XC::Channel::sendVector ( int  dbTag,
int  commitTag,
const Vector theVector,
ChannelAddress theAddress = nullptr 
)
pure virtual

Invoked to receive the data in the Vector object theVector to another Channel object.

The object will obtain the data and size of the data to be sent by invoking getData() and getSize() on theVector. The channel object is then responsible for sending that data to the remote channel address given by theAddress. If theAddress is 0, the Channel sends to the Channel with the address last set in a send..()}, recv..(), or setNextAddress() operation. To return 0 if successful, a negative number if not.

Implemented in XC::FileDatastore, XC::UDP_Socket, XC::TCP_Socket, XC::NEESData, XC::BerkeleyDbDatastore, XC::MySqlDatastore, XC::MPI_Channel, XC::OracleDatastore, and XC::SQLiteDatastore.

§ setNextAddress()

virtual int XC::Channel::setNextAddress ( const ChannelAddress theAddress)
pure virtual

A method invoked to set specify the next address that the next messages to be sent if {sendMessage()} or received if {recvMessage()} is invoked with a null pointer.

Implemented in XC::UDP_Socket, XC::TCP_Socket, XC::FE_Datastore, XC::TCP_SocketNoDelay, XC::MPI_Channel, and XC::OracleDatastore.


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