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 #ifndef BerkeleyDbDatastore_h
00026 #define BerkeleyDbDatastore_h
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <FE_Datastore.h>
00040 #include <db.h>
00041
00042 class BerkeleyDbDatastore: public FE_Datastore
00043 {
00044 public:
00045 BerkeleyDbDatastore(const char *projectName,
00046 Domain &theDomain,
00047 FEM_ObjectBroker &theBroker,
00048 char *type = NULL);
00049
00050 ~BerkeleyDbDatastore();
00051
00052
00053 int getDbTag(void);
00054
00055
00056 int sendMsg(int dbTag, int commitTag,
00057 const Message &,
00058 ChannelAddress *theAddress =0);
00059 int recvMsg(int dbTag, int commitTag,
00060 Message &,
00061 ChannelAddress *theAddress =0);
00062
00063 int sendMatrix(int dbTag, int commitTag,
00064 const Matrix &theMatrix,
00065 ChannelAddress *theAddress =0);
00066 int recvMatrix(int dbTag, int commitTag,
00067 Matrix &theMatrix,
00068 ChannelAddress *theAddress =0);
00069
00070 int sendVector(int dbTag, int commitTag,
00071 const Vector &theVector,
00072 ChannelAddress *theAddress =0);
00073 int recvVector(int dbTag, int commitTag,
00074 Vector &theVector,
00075 ChannelAddress *theAddress =0);
00076
00077 int sendID(int dbTag, int commitTag,
00078 const ID &theID,
00079 ChannelAddress *theAddress =0);
00080 int recvID(int dbTag, int commitTag,
00081 ID &theID,
00082 ChannelAddress *theAddress =0);
00083
00084 protected:
00085
00086 private:
00087 int dbTag;
00088
00089 DB_ENV *dbenv;
00090 DB *dbMatrix;
00091 DB *dbVector;
00092 DB *dbID;
00093
00094 bool connection;
00095
00096 DBT key, data;
00097 char query[128];
00098
00099 char *project;
00100 };
00101
00102 #endif