00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef Actor_h
00027 #define Actor_h
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <ObjectBroker.h>
00042 #include <Message.h>
00043 #include <Channel.h>
00044 #include <ChannelAddress.h>
00045 #include <MovableObject.h>
00046 #include <Matrix.h>
00047 #include <Vector.h>
00048 #include <ID.h>
00049
00062 class ActorMethod
00063 {
00064 public:
00066 int tag;
00067
00069 int (*theMethod)();
00070 };
00071
00072 #include <FEM_ObjectBroker.h>
00073
00075 class Actor
00076 {
00077 public:
00079 Actor(Channel &theChannel,
00080 FEM_ObjectBroker &theBroker,
00081 int numActorMethods);
00082
00084 virtual ~Actor();
00085
00087 virtual int addMethod(int tag, int (*fp)());
00089 virtual int getMethod();
00091 virtual int processMethod(int tag);
00092
00094 virtual int sendObject(MovableObject &theObject,
00095 ChannelAddress *theAddress =0);
00097 virtual int recvObject(MovableObject &theObject,
00098 ChannelAddress *theAddress =0);
00099
00101 virtual int sendMessage(const Message &theMessage,
00102 ChannelAddress *theAddress =0);
00104 virtual int recvMessage(Message &theMessage,
00105 ChannelAddress *theAddress =0);
00106
00108 virtual int sendMatrix(const Matrix &theMatrix,
00109 ChannelAddress *theAddress =0);
00111 virtual int recvMatrix(Matrix &theMatrix,
00112 ChannelAddress *theAddress =0);
00113
00115 virtual int sendVector(const Vector &theVector,
00116 ChannelAddress *theAddress =0);
00118 virtual int recvVector(Vector &theVector,
00119 ChannelAddress *theAddress =0);
00120
00122 virtual int sendID(const ID &theID,
00123 ChannelAddress *theAddress =0);
00125 virtual int recvID(ID &theID,
00126 ChannelAddress *theAddress =0);
00127
00129 Channel *getChannelPtr(void) const;
00131 FEM_ObjectBroker *getObjectBrokerPtr(void) const;
00133 ChannelAddress *getShadowsAddressPtr(void) const;
00134
00135 protected:
00137 FEM_ObjectBroker *theBroker;
00139 Channel *theChannel;
00140
00141 private:
00143 int numMethods, maxNumMethods;
00145 ActorMethod **actorMethods;
00147 ChannelAddress *theRemoteShadowsAddress;
00148
00149 };
00150
00151 #endif
00152