2017-07-18 13:16:55 +02:00
|
|
|
/*************** CMGFam H Declares Source Code File (.H) ***************/
|
2020-12-08 01:15:40 +01:00
|
|
|
/* Name: cmgfam.h Version 1.6 */
|
2017-05-23 19:35:50 +02:00
|
|
|
/* */
|
2020-12-08 01:15:40 +01:00
|
|
|
/* (C) Copyright to the author Olivier BERTRAND 2017 - 2020 */
|
2017-05-23 19:35:50 +02:00
|
|
|
/* */
|
|
|
|
/* This file contains the MongoDB access method classes declares. */
|
|
|
|
/***********************************************************************/
|
2017-07-02 22:29:31 +02:00
|
|
|
#include "cmgoconn.h"
|
2017-05-23 19:35:50 +02:00
|
|
|
|
|
|
|
typedef class TXTFAM *PTXF;
|
2017-07-18 13:16:55 +02:00
|
|
|
typedef class CMGFAM *PCMGFAM;
|
2017-05-23 19:35:50 +02:00
|
|
|
typedef class MGODEF *PMGODEF;
|
2017-07-18 13:16:55 +02:00
|
|
|
typedef class TDBCMG *PTDBCMG;
|
2017-05-23 19:35:50 +02:00
|
|
|
|
|
|
|
/***********************************************************************/
|
|
|
|
/* This is the MongoDB Access Method class declaration. */
|
|
|
|
/***********************************************************************/
|
2017-07-18 13:16:55 +02:00
|
|
|
class DllExport CMGFAM : public DOSFAM {
|
2017-05-23 19:35:50 +02:00
|
|
|
friend void mongo_init(bool);
|
|
|
|
public:
|
|
|
|
// Constructor
|
2017-07-18 13:16:55 +02:00
|
|
|
CMGFAM(PJDEF tdp);
|
2020-12-08 01:15:40 +01:00
|
|
|
#if defined(BSON_SUPPORT)
|
|
|
|
CMGFAM(PBDEF tdp);
|
|
|
|
#endif // BSON_SUPPORT
|
2017-07-18 13:16:55 +02:00
|
|
|
CMGFAM(PCMGFAM txfp);
|
2017-05-23 19:35:50 +02:00
|
|
|
|
|
|
|
// Implementation
|
2024-06-12 15:46:26 +02:00
|
|
|
AMT GetAmType(void) override { return TYPE_AM_MGO; }
|
2017-05-23 19:35:50 +02:00
|
|
|
virtual bool GetUseTemp(void) { return false; }
|
|
|
|
virtual int GetPos(void);
|
|
|
|
virtual int GetNextPos(void);
|
2017-07-02 22:29:31 +02:00
|
|
|
void SetTdbp(PTDBDOS tdbp) { Tdbp = tdbp; }
|
2024-06-12 15:46:26 +02:00
|
|
|
PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) CMGFAM(this); }
|
2017-05-23 19:35:50 +02:00
|
|
|
void SetLrecl(int lrecl) { Lrecl = lrecl; }
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
virtual void Reset(void);
|
|
|
|
virtual int GetFileLength(PGLOBAL g);
|
2024-06-12 15:46:26 +02:00
|
|
|
int Cardinality(PGLOBAL g) override;
|
2017-05-23 19:35:50 +02:00
|
|
|
virtual int MaxBlkSize(PGLOBAL g, int s);
|
|
|
|
virtual bool AllocateBuffer(PGLOBAL g) { return false; }
|
|
|
|
virtual int GetRowID(void);
|
|
|
|
virtual bool RecordPos(PGLOBAL g);
|
|
|
|
virtual bool SetPos(PGLOBAL g, int recpos);
|
|
|
|
virtual int SkipRecord(PGLOBAL g, bool header);
|
|
|
|
virtual bool OpenTableFile(PGLOBAL g);
|
|
|
|
virtual int ReadBuffer(PGLOBAL g);
|
|
|
|
virtual int WriteBuffer(PGLOBAL g);
|
|
|
|
virtual int DeleteRecords(PGLOBAL g, int irc);
|
|
|
|
virtual void CloseTableFile(PGLOBAL g, bool abort);
|
|
|
|
virtual void Rewind(void);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool OpenTempFile(PGLOBAL g) { return false; }
|
|
|
|
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b) { return false; }
|
|
|
|
virtual int RenameTempFile(PGLOBAL g) { return RC_OK; }
|
|
|
|
virtual int InitDelete(PGLOBAL g, int fpos, int spos);
|
|
|
|
bool Init(PGLOBAL g);
|
|
|
|
|
|
|
|
// Members
|
2017-07-02 22:29:31 +02:00
|
|
|
CMgoConn *Cmgp; // Points to a C Mongo connection class
|
|
|
|
CMGOPARM Pcg; // Parms passed to Cmgp
|
|
|
|
PFBLOCK To_Fbt; // Pointer to temp file block
|
|
|
|
MODE Mode;
|
|
|
|
bool Done; // Init done
|
2017-07-18 13:16:55 +02:00
|
|
|
}; // end of class CMGFAM
|
2017-05-23 19:35:50 +02:00
|
|
|
|