StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StDbBufferI.h
1 
2 /***************************************************************************
3  *
4  * $Id: StDbBufferI.h,v 1.7 2001/10/24 04:05:20 porter Exp $
5  *
6  * Author: Laurent Conin & Jeff Porter
7  ***************************************************************************
8  *
9  * Description: Buffer Interface to negotiate data I/O between database
10  *
11  ***************************************************************************
12  *
13  * $Log: StDbBufferI.h,v $
14  * Revision 1.7 2001/10/24 04:05:20 porter
15  * added long long type to I/O and got rid of obsolete dataIndex table
16  *
17  * Revision 1.6 2001/01/22 18:37:51 porter
18  * Update of code needed in next year running. This update has little
19  * effect on the interface (only 1 method has been changed in the interface).
20  * Code also preserves backwards compatibility so that old versions of
21  * StDbLib can read new table structures.
22  * -Important features:
23  * a. more efficient low-level table structure (see StDbSql.cc)
24  * b. more flexible indexing for new systems (see StDbElememtIndex.cc)
25  * c. environment variable override KEYS for each database
26  * d. StMessage support & clock-time logging diagnostics
27  * -Cosmetic features
28  * e. hid stl behind interfaces (see new *Impl.* files) to again allow rootcint access
29  * f. removed codes that have been obsolete for awhile (e.g. db factories)
30  * & renamed some classes for clarity (e.g. tableQuery became StDataBaseI
31  * and mysqlAccessor became StDbSql)
32  *
33  * Revision 1.5 2000/03/28 17:03:18 porter
34  * Several upgrades:
35  * 1. configuration by timestamp for Conditions
36  * 2. query by whereClause made more systematic
37  * 3. conflict between db-stored comments & number lists resolved
38  * 4. ensure endtime is correct for certain query falures
39  * 5. dbstl.h->handles ObjectSpace & RogueWave difference (Online vs Offline)
40  *
41  * Revision 1.4 1999/12/29 13:49:34 porter
42  * fix for Solaris-CC4.2 within StRoot make (cons)...
43  * replaced #include <config.h> with #include <ospace/config.h>
44  *
45  * Revision 1.3 1999/12/28 21:31:41 porter
46  * added 'using std::vector' and 'using std::list' for Solaris CC5 compilation.
47  * Also fixed some warnings arising from the CC5 compiles
48  *
49  * Revision 1.2 1999/09/30 02:06:01 porter
50  * add StDbTime to better handle timestamps, modify SQL content (mysqlAccessor)
51  * allow multiple rows (StDbTable), & Added the comment sections at top of
52  * each header and src file
53  *
54  **************************************************************************/
55 #ifndef STDBBUFFERI_H
56 #define STDBBUFFERI_H
57 
58 class StDbBufferI {
59 
60 public:
61 
62  virtual ~StDbBufferI(){};
63  virtual void SetClientMode() = 0;
64  virtual void SetStorageMode() = 0;
65  virtual bool IsClientMode() = 0;
66  virtual bool IsStorageMode() = 0;
67 
68  virtual bool ReadScalar(char &c, const char *aName) = 0;
69  virtual bool ReadScalar(unsigned char &c, const char *) = 0;
70  virtual bool ReadScalar(short &h, const char *) = 0;
71  virtual bool ReadScalar(unsigned short &h, const char *) = 0;
72  virtual bool ReadScalar(int &i, const char *) = 0;
73  virtual bool ReadScalar(unsigned int &i, const char *) = 0;
74  virtual bool ReadScalar(long &l, const char *) = 0;
75  virtual bool ReadScalar(unsigned long &l, const char *) = 0;
76  virtual bool ReadScalar(long long &l, const char *) = 0;
77  virtual bool ReadScalar(float &f, const char *) = 0;
78  virtual bool ReadScalar(double &d, const char *) = 0;
79  virtual bool ReadScalar(char *&c, const char *) = 0;
80 
81  virtual bool WriteScalar(const char c, const char *) = 0;
82  virtual bool WriteScalar(const unsigned char c, const char *) = 0;
83  virtual bool WriteScalar(const short h, const char *) = 0;
84  virtual bool WriteScalar(const unsigned short h, const char *) = 0;
85  virtual bool WriteScalar(const int i, const char *) = 0;
86  virtual bool WriteScalar(const unsigned int i, const char *) = 0;
87  virtual bool WriteScalar(const long l, const char *) = 0;
88  virtual bool WriteScalar(const unsigned long l, const char *) = 0;
89  virtual bool WriteScalar(const long long l, const char *) = 0;
90  virtual bool WriteScalar(const float f, const char *) = 0;
91  virtual bool WriteScalar(const double d, const char *) = 0;
92  virtual bool WriteScalar(const char *c, const char *) = 0;
93 
94  virtual bool ReadArray(char *&c, int &len, const char *) = 0;
95  virtual bool ReadArray(unsigned char *&c, int &len, const char *) = 0;
96  virtual bool ReadArray( short *&c, int &len, const char *) = 0;
97  virtual bool ReadArray( unsigned short *&c, int &len, const char *) = 0;
98  virtual bool ReadArray(int *&c, int &len, const char *) = 0;
99  virtual bool ReadArray(unsigned int *&c, int &len, const char *) = 0;
100  virtual bool ReadArray(long *&c, int &len, const char *) = 0;
101  virtual bool ReadArray(unsigned long *&c, int &len, const char *) = 0;
102  virtual bool ReadArray(long long *&c, int &len, const char *) = 0;
103  virtual bool ReadArray(float *&c, int &len, const char *) = 0;
104  virtual bool ReadArray(double *&c, int &len, const char *) = 0;
105  virtual bool ReadArray(char **&c, int &len, const char *) = 0;
106 
107  virtual bool WriteArray(char *c, int len, const char *) = 0;
108  virtual bool WriteArray(unsigned char *c, int len, const char *) = 0;
109  virtual bool WriteArray(short *c, int len, const char *) = 0;
110  virtual bool WriteArray(unsigned short *c, int len, const char *) = 0;
111  virtual bool WriteArray(int *c, int len, const char *) = 0;
112  virtual bool WriteArray(unsigned int *c, int len, const char *) = 0;
113  virtual bool WriteArray(long *c, int len, const char *) = 0;
114  virtual bool WriteArray(unsigned long *c, int len, const char *) = 0;
115  virtual bool WriteArray(long long *c, int len, const char *) = 0;
116  virtual bool WriteArray(float *c, int len, const char *) = 0;
117  virtual bool WriteArray(double *c, int len, const char *) = 0;
118  virtual bool WriteArray(char **c, int len, const char *) = 0;
119 };
120 #endif