xc
|
Remote object associated with a shadow (local) object. More...
#include <Actor.h>
Public Member Functions | |
Actor (Channel &theChannel, FEM_ObjectBroker &theBroker, int numActorMethods=0) | |
Constructor to init the list. More... | |
Actor (const Actor &) | |
Copy constructor. | |
Actor & | operator= (const Actor &) |
Assignment operator. | |
virtual | ~Actor (void) |
Destructor. | |
virtual int | run (void)=0 |
virtual int | addMethod (int tag, int(*fp)()) |
Method to add a function to the list of available actor methods. More... | |
virtual int | getMethod () |
Method to return the integer tag of the next method the actor has been asked to invoke. More... | |
virtual int | processMethod (int tag) |
Method to process the function whose id is tag. More... | |
virtual int | sendObject (MovableObject &theObject, ChannelAddress *theAddress=0) |
Sends object theObject . More... | |
virtual int | recvObject (MovableObject &theObject, ChannelAddress *theAddress=0) |
Receives object theObject . More... | |
virtual int | sendMessage (const Message &theMessage, ChannelAddress *theAddress=0) |
Sends the message. More... | |
virtual int | recvMessage (Message &theMessage, ChannelAddress *theAddress=0) |
Receives the message. More... | |
virtual int | sendMatrix (const Matrix &theMatrix, ChannelAddress *theAddress=0) |
Sends the matrix. More... | |
virtual int | recvMatrix (Matrix &theMatrix, ChannelAddress *theAddress=0) |
Receives the matrix. More... | |
virtual int | sendVector (const Vector &theVector, ChannelAddress *theAddress=0) |
Sends the vector. More... | |
virtual int | recvVector (Vector &theVector, ChannelAddress *theAddress=0) |
Receive the vector. More... | |
virtual int | sendID (const ID &theID, ChannelAddress *theAddress=0) |
Send the vector of integerstheID . More... | |
virtual int | recvID (ID &theID, ChannelAddress *theAddress=0) |
Receive the integer vectortheID . More... | |
ChannelAddress * | getShadowsAddressPtr (void) const |
Return a pointer to the channel address for the shadow object that created the actor. More... | |
Public Member Functions inherited from XC::ShadowActorBase | |
ShadowActorBase (Channel &theChannel, FEM_ObjectBroker &) | |
Constructor. More... | |
ShadowActorBase (int actorType, FEM_ObjectBroker &myBroker, MachineBroker &theMachineBroker, int compDemand) | |
Constructor. More... | |
void | setCommitTag (int commitTag) |
Set the value for #commitTag. | |
int | getCommitTag (void) const |
Return the #commitTag member. | |
Channel * | getChannelPtr (void) const |
Returns a pointer to the object channel theChannel. | |
virtual int | barrierCheck (int result) |
barrier check. | |
Public Member Functions inherited from XC::ObjectWithObjBroker | |
ObjectWithObjBroker (FEM_ObjectBroker *) | |
Object broker to use. More... | |
ObjectWithObjBroker (FEM_ObjectBroker &) | |
Constructor. Sets the broker. | |
FEM_ObjectBroker * | getObjectBrokerPtr (void) const |
Returns a pointer to the broker #theBroker. | |
Additional Inherited Members | |
Protected Attributes inherited from XC::ShadowActorBase | |
Channel * | theChannel |
Communication channel to use. | |
Protected Attributes inherited from XC::ObjectWithObjBroker | |
FEM_ObjectBroker * | theBroker |
Remote object associated with a shadow (local) object.
An actor is associated with a shadow object. The shadow acts like a normal object in the users address space, data and processing that is done by the shadow may be stored and processed in a remote process, the actor resides in this remote address space. The actor and the shadow both have a channel, a communication port. This allows the two to communicate with each other.
XC::Actor::Actor | ( | Channel & | theChan, |
FEM_ObjectBroker & | myBroker, | ||
int | numActorMethods = 0 |
||
) |
Constructor to init the list.
This is called by the remote process upon initialization to construct the local actor object. It is used to create an Actor object in that remote address space which will communicate with objects in other processes through a channel object, theChan
and which uses myBroker
to receive movable objects sent from other processes. The subclass will be able to add at most numActorMethods
actor methods using addMethod() call. The base classes constructor invokes setUpActor() on theChannel object. It then sets the Address of the remote shadow object which created the actor process by invoking getLastSendersAddress() on theChannel.
|
virtual |
Method to add a function to the list of available actor methods.
Aadd as a function to the actor object the function fp
, this function is identified by the tag
value. This function will be invoked by the actor on invocation of processMethod()} with tag
as the argument. The object checks to see that the tag
has not been used previously. If it has not and the number of functions so far added is less than #numActorMethods the function is added and $0$ is returned, otherwise a $-1$ (if tag
was already used) or $-2$ (if #numActorMethods already added) or a $-3$ (if running out of space) is returned to indicate the function was not added.
|
virtual |
Method to return the integer tag of the next method the actor has been asked to invoke.
A method which returns the next integer value sitting in the actors channel. This int value corresponds to the tag of the next method that the shadow object wants the actor to perform. If an error occurs $-1$ will be returned.
XC::ChannelAddress * XC::Actor::getShadowsAddressPtr | ( | void | ) | const |
Return a pointer to the channel address for the shadow object that created the actor.
|
virtual |
Method to process the function whose id is tag.
This causes the actor object to invoke the function that was added to the actor with the {tag} identifier. If no method with {tag} exists a $-1$ is returned.
|
virtual |
Receive the integer vectortheID
.
A method which will receive theID
from the actors channel either from the address given by theAddress
or from the address of the shadow object that created the actor if no address is specified. Returns the result of invoking recvID(0,0,theID,theAddress) on the actors channel object if an address is specified, otherwise the result of invoking recvID(0,0,theID,this->getShadowAdressPtr()) on the actors channel object is returned.
|
virtual |
Receives the matrix.
A method which will receive theMatrix
from the actors channel either from the address given by theAddress
or from the address of the shadow object that created the actor if no address is specified. Returns the result of invoking recvMatrix(0,0,theMatrix,theAddress) on the actors channel object if an address is specified, otherwise the result of invoking recvMatrix(0,0,theMatrix,this->getShadowAdressPtr()) on the actors channel object is returned.
|
virtual |
Receives the message.
A method which will receive the data in the theMessage
from the actors channel either from the address given by theAddress
or from the address of the shadow object that created the actor if no address is specified. Returns the result of invoking recvMsg(0,0,theMessage,theAddress)} on the actors channel object if an address is specified, otherwise the result of invoking recvMsg(0,0,theMessage,this->getShadowAdressPtr())} on the actors channel object is returned.
|
virtual |
Receives object theObject
.
A method which will receive theObject
from the actors channel either from the address given by theAddress
or from the address of the shadow object that created the actor if no address is specified. Returns the result of invoking recvObj(0, theObject,theBroker,theAddress)} on the actors channel object if an address is specified, otherwise the result of invoking recvObj(theMessage,theBroker,this->getShadowAdressPtr()) on the actors channel object is returned.
|
virtual |
Receive the vector.
A method which will receive theVector
from the actors channel either from the address given by theAddress
or from the address of the shadow object that created the actor if no address is specified. Returns the result of invoking recvVector(0,0,theVector,theAddress) on the actors channel object if an address is specified, otherwise the result of invoking recvVector(0,0,theVector,this->getShadowAdressPtr()) on the actors channel object is returned.
|
virtual |
Send the vector of integerstheID
.
A method which will send theID
through the actors channel either to the address given by theAddress
or to the address of the shadow object that created the actor if no address is specified. Returns the result of invoking sendID(0,0,theID,theAddress) on the actors channel object if an address is specified, otherwise the result of invoking sendID(0,0,theID,this->getShadowAdressPtr())} on the actors channel object is returned.
|
virtual |
Sends the matrix.
A method which will send theMatrix
through the actors channel either to the address given by theAddress
or to the address of the shadow object that created the actor if no address is specified. Returns the result of invoking sendMatrix(0,0,theMatrix,theAddress)} on the actors channel object if an address is specified, otherwise the result of invoking sendMatrix(0,0,theMatrix,this->getShadowAdressPtr()) on the actors channel object is returned.
|
virtual |
Sends the message.
A method which will send the data in the theMessage
through the actors channel either to the address given by theAddress
or to the address of the shadow object that created the actor if no address is specified. Returns the result of invoking sendMsg(0,0,theMessage,theAddress) on the actors channel object if an address is specified, otherwise the result of invoking sendMsg(theMessage,this->getShadowAdressPtr())} on the actors channel object is returned.
|
virtual |
Sends object theObject
.
A method which will send #theObject through the actors channel either to the address given by theAddress
or to the address of the shadow object that created the actor if no address is specified. Returns the result of invoking sendObj(0, theObject,theBroker,theAddress) on the actors channel object if an address is specified, otherwise the result of invoking sendObj(theMessage,theBroker,this->getShadowAdressPtr()) on the actors channel object is returned.
|
virtual |
Sends the vector.
A method which will send theVector
through the actors channel either to the address given by theAddress
or to the address of the shadow object that created the actor if no address is specified. Returns the result of invoking sendVector(0,0,theVector,theAddress) on the actors channel object if an address is specified, otherwise the result of invoking sendVector(0,0,theVector,this->getShadowAdressPtr())} on the actors channel object is returned.