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 FE_Datastore_h
00027 #define FE_Datastore_h
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include <Channel.h>
00043
00044 class Domain;
00045 class FEM_ObjectBroker;
00046
00047 class FE_Datastore: public Channel
00048 {
00049 public:
00050 FE_Datastore(Domain &theDomain, FEM_ObjectBroker &theBroker);
00051 virtual ~FE_Datastore();
00052
00053
00054 char *addToProgram(void);
00055 int setUpConnection(void);
00056 int setNextAddress(const ChannelAddress &otherChannelAddress);
00057 ChannelAddress *getLastSendersAddress(void);
00058
00059
00060 int sendObj(int commitTag,
00061 MovableObject &theObject,
00062 ChannelAddress *theAddress =0);
00063
00064 int recvObj(int commitTag,
00065 MovableObject &theObject,
00066 FEM_ObjectBroker &theBroker,
00067 ChannelAddress *theAddress =0);
00068
00069
00070
00071 int getDbTag(void);
00072 virtual int isDatastore(void);
00073
00074 virtual int commitState(int commitTag);
00075 virtual int restoreState(int commitTag);
00076
00077 virtual int createTable(const char *tableName, int numColumns, char *columns[]);
00078 virtual int insertData(const char *tableName, char *columns[],
00079 int commitTag, const Vector &data);
00080 virtual int getData(const char *tableName, char *columns[],
00081 int commitTag, Vector &data);
00082
00083 protected:
00084 FEM_ObjectBroker *getObjectBroker(void);
00085
00086 private:
00087 FEM_ObjectBroker *theObjectBroker;
00088 Domain *theDomain;
00089 static int lastDbTag;
00090
00091 };
00092
00093
00094 #endif
00095