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
00027 #pragma once
00028 #ifndef __SYSTAB_CLOUD_H__
00029 #define __SYSTAB_CLOUD_H__
00030
00031 #include "cslib/CSMutex.h"
00032
00033 #include "defs_ms.h"
00034 #include "system_table_ms.h"
00035 #include "discover_ms.h"
00036
00037 class MSCloudTable : public MSOpenSystemTable {
00038 public:
00039 MSCloudTable(MSSystemTableShare *share, TABLE *table);
00040 ~MSCloudTable();
00041
00042 void use();
00043 void unuse();
00044 void seqScanInit();
00045 bool seqScanNext(char *buf);
00046 int getRefLen() { return sizeof(iCloudIndex);}
00047 void seqScanPos(unsigned char *pos );
00048 void seqScanRead(unsigned char *pos , char *buf);
00049
00050 void updateRow(char *old_data, char *new_data);
00051 void insertRow(char *data);
00052 void deleteRow(char *data);
00053
00054 static void startUp();
00055 static void shutDown();
00056
00057 static void transferTable(MSDatabase *from_db, MSDatabase *to_db);
00058 static CSStringBuffer *dumpTable(MSDatabase *db);
00059 static void restoreTable(MSDatabase *db, const char *data, size_t size, bool reload = true);
00060 static void removeTable(CSString *db_path);
00061
00062 static void saveTable(MSDatabase *db);
00063 static void loadTable(MSDatabase *db);
00064 static const uint8_t tableID = 0X01;
00065 static const uint16_t tableVersion = 0X0001;
00066
00067
00068 private:
00069 uint32_t iCloudIndex;
00070 };
00071
00072 #define CLOUD_TABLE_NAME "pbms_cloud"
00073 extern DT_FIELD_INFO pbms_cloud_info[];
00074 extern DT_KEY_INFO pbms_cloud_keys[];
00075
00076 #endif // __SYSTAB_CLOUD_H__