1
- /* *********** MONGO FAM C++ Program Source Code File (.CPP) ************/
2
- /* PROGRAM NAME: mongofam .cpp */
1
+ /* ************* CMGFAM C++ Program Source Code File (.CPP) * ************/
2
+ /* PROGRAM NAME: cmgfam .cpp */
3
3
/* ------------- */
4
- /* Version 1.3 */
4
+ /* Version 1.4 */
5
5
/* */
6
6
/* COPYRIGHT: */
7
7
/* ---------- */
30
30
#include " filamtxt.h"
31
31
#include " tabdos.h"
32
32
#include " tabjson.h"
33
- #include " mongofam .h"
33
+ #include " cmgfam .h"
34
34
35
35
#if defined(UNIX) || defined(UNIV_LINUX)
36
36
#include " osutil.h"
37
37
#endif
38
38
39
- /* --------------------------- Class MGOFAM -------------------------- */
39
+ /* --------------------------- Class CMGFAM -------------------------- */
40
40
41
41
/* **********************************************************************/
42
42
/* Constructors. */
43
43
/* **********************************************************************/
44
- MGOFAM::MGOFAM (PJDEF tdp) : DOSFAM((PDOSDEF)NULL)
44
+ CMGFAM::CMGFAM (PJDEF tdp) : DOSFAM((PDOSDEF)NULL)
45
45
{
46
46
Cmgp = NULL ;
47
47
Pcg.Tdbp = NULL ;
@@ -66,20 +66,20 @@ MGOFAM::MGOFAM(PJDEF tdp) : DOSFAM((PDOSDEF)NULL)
66
66
Mode = MODE_ANY;
67
67
Done = false ;
68
68
Lrecl = tdp->Lrecl + tdp->Ending ;
69
- } // end of MGOFAM standard constructor
69
+ } // end of CMGFAM standard constructor
70
70
71
- MGOFAM::MGOFAM (PMGOFAM tdfp) : DOSFAM(tdfp)
71
+ CMGFAM::CMGFAM (PCMGFAM tdfp) : DOSFAM(tdfp)
72
72
{
73
73
Pcg = tdfp->Pcg ;
74
74
To_Fbt = tdfp->To_Fbt ;
75
75
Mode = tdfp->Mode ;
76
76
Done = tdfp->Done ;
77
- } // end of MGOFAM copy constructor
77
+ } // end of CMGFAM copy constructor
78
78
79
79
/* **********************************************************************/
80
80
/* Reset: reset position values at the beginning of file. */
81
81
/* **********************************************************************/
82
- void MGOFAM ::Reset (void )
82
+ void CMGFAM ::Reset (void )
83
83
{
84
84
TXTFAM::Reset ();
85
85
Fpos = Tpos = Spos = 0 ;
@@ -88,7 +88,7 @@ void MGOFAM::Reset(void)
88
88
/* **********************************************************************/
89
89
/* MGO GetFileLength: returns file size in number of bytes. */
90
90
/* **********************************************************************/
91
- int MGOFAM ::GetFileLength (PGLOBAL g)
91
+ int CMGFAM ::GetFileLength (PGLOBAL g)
92
92
{
93
93
return 0 ;
94
94
} // end of GetFileLength
@@ -98,7 +98,7 @@ int MGOFAM::GetFileLength(PGLOBAL g)
98
98
/* This function can be called with a null argument to test the */
99
99
/* availability of Cardinality implementation (1 yes, 0 no). */
100
100
/* **********************************************************************/
101
- int MGOFAM ::Cardinality (PGLOBAL g)
101
+ int CMGFAM ::Cardinality (PGLOBAL g)
102
102
{
103
103
if (!g)
104
104
return 1 ;
@@ -109,15 +109,15 @@ int MGOFAM::Cardinality(PGLOBAL g)
109
109
/* **********************************************************************/
110
110
/* Note: This function is not really implemented yet. */
111
111
/* **********************************************************************/
112
- int MGOFAM ::MaxBlkSize (PGLOBAL, int s)
112
+ int CMGFAM ::MaxBlkSize (PGLOBAL, int s)
113
113
{
114
114
return s;
115
115
} // end of MaxBlkSize
116
116
117
117
/* **********************************************************************/
118
118
/* Init: initialize MongoDB processing. */
119
119
/* **********************************************************************/
120
- bool MGOFAM ::Init (PGLOBAL g)
120
+ bool CMGFAM ::Init (PGLOBAL g)
121
121
{
122
122
if (Done)
123
123
return false ;
@@ -141,7 +141,7 @@ bool MGOFAM::Init(PGLOBAL g)
141
141
/* **********************************************************************/
142
142
/* OpenTableFile: Open a MongoDB table. */
143
143
/* **********************************************************************/
144
- bool MGOFAM ::OpenTableFile (PGLOBAL g)
144
+ bool CMGFAM ::OpenTableFile (PGLOBAL g)
145
145
{
146
146
Mode = Tdbp->GetMode ();
147
147
@@ -165,31 +165,31 @@ bool MGOFAM::OpenTableFile(PGLOBAL g)
165
165
/* **********************************************************************/
166
166
/* GetRowID: return the RowID of last read record. */
167
167
/* **********************************************************************/
168
- int MGOFAM ::GetRowID (void )
168
+ int CMGFAM ::GetRowID (void )
169
169
{
170
170
return Rows;
171
171
} // end of GetRowID
172
172
173
173
/* **********************************************************************/
174
174
/* GetPos: return the position of last read record. */
175
175
/* **********************************************************************/
176
- int MGOFAM ::GetPos (void )
176
+ int CMGFAM ::GetPos (void )
177
177
{
178
178
return Fpos;
179
179
} // end of GetPos
180
180
181
181
/* **********************************************************************/
182
182
/* GetNextPos: return the position of next record. */
183
183
/* **********************************************************************/
184
- int MGOFAM ::GetNextPos (void )
184
+ int CMGFAM ::GetNextPos (void )
185
185
{
186
186
return Fpos; // TODO
187
187
} // end of GetNextPos
188
188
189
189
/* **********************************************************************/
190
190
/* SetPos: Replace the table at the specified position. */
191
191
/* **********************************************************************/
192
- bool MGOFAM ::SetPos (PGLOBAL g, int pos)
192
+ bool CMGFAM ::SetPos (PGLOBAL g, int pos)
193
193
{
194
194
Fpos = pos;
195
195
Placed = true ;
@@ -199,33 +199,33 @@ bool MGOFAM::SetPos(PGLOBAL g, int pos)
199
199
/* **********************************************************************/
200
200
/* Record file position in case of UPDATE or DELETE. */
201
201
/* **********************************************************************/
202
- bool MGOFAM ::RecordPos (PGLOBAL g)
202
+ bool CMGFAM ::RecordPos (PGLOBAL g)
203
203
{
204
- strcpy (g->Message , " MGOFAM ::RecordPos NIY" );
204
+ strcpy (g->Message , " CMGFAM ::RecordPos NIY" );
205
205
return true ;
206
206
} // end of RecordPos
207
207
208
208
/* **********************************************************************/
209
209
/* Initialize Fpos and the current position for indexed DELETE. */
210
210
/* **********************************************************************/
211
- int MGOFAM ::InitDelete (PGLOBAL g, int fpos, int spos)
211
+ int CMGFAM ::InitDelete (PGLOBAL g, int fpos, int spos)
212
212
{
213
- strcpy (g->Message , " MGOFAM ::InitDelete NIY" );
213
+ strcpy (g->Message , " CMGFAM ::InitDelete NIY" );
214
214
return RC_FX;
215
215
} // end of InitDelete
216
216
217
217
/* **********************************************************************/
218
218
/* Skip one record in file. */
219
219
/* **********************************************************************/
220
- int MGOFAM ::SkipRecord (PGLOBAL g, bool header)
220
+ int CMGFAM ::SkipRecord (PGLOBAL g, bool header)
221
221
{
222
222
return RC_OK; // Dummy
223
223
} // end of SkipRecord
224
224
225
225
/* **********************************************************************/
226
226
/* ReadBuffer: Get next document from a collection. */
227
227
/* **********************************************************************/
228
- int MGOFAM ::ReadBuffer (PGLOBAL g)
228
+ int CMGFAM ::ReadBuffer (PGLOBAL g)
229
229
{
230
230
int rc = Cmgp->ReadNext (g);
231
231
@@ -239,23 +239,23 @@ int MGOFAM::ReadBuffer(PGLOBAL g)
239
239
/* **********************************************************************/
240
240
/* WriteBuffer: File write routine for MGO access method. */
241
241
/* **********************************************************************/
242
- int MGOFAM ::WriteBuffer (PGLOBAL g)
242
+ int CMGFAM ::WriteBuffer (PGLOBAL g)
243
243
{
244
244
return Cmgp->Write (g);
245
245
} // end of WriteBuffer
246
246
247
247
/* **********************************************************************/
248
248
/* Data Base delete line routine for MGO and BLK access methods. */
249
249
/* **********************************************************************/
250
- int MGOFAM ::DeleteRecords (PGLOBAL g, int irc)
250
+ int CMGFAM ::DeleteRecords (PGLOBAL g, int irc)
251
251
{
252
252
return (irc == RC_OK) ? WriteBuffer (g) : RC_OK;
253
253
} // end of DeleteRecords
254
254
255
255
/* **********************************************************************/
256
256
/* Table file close routine for MGO access method. */
257
257
/* **********************************************************************/
258
- void MGOFAM ::CloseTableFile (PGLOBAL g, bool )
258
+ void CMGFAM ::CloseTableFile (PGLOBAL g, bool )
259
259
{
260
260
Cmgp->Close ();
261
261
Done = false ;
@@ -264,7 +264,7 @@ void MGOFAM::CloseTableFile(PGLOBAL g, bool)
264
264
/* **********************************************************************/
265
265
/* Rewind routine for MGO access method. */
266
266
/* **********************************************************************/
267
- void MGOFAM ::Rewind (void )
267
+ void CMGFAM ::Rewind (void )
268
268
{
269
269
Cmgp->Rewind ();
270
270
} // end of Rewind
0 commit comments