#ifndef _CEGOCHECKPOINTDUMP_H_INCLUDED_
#define _CEGOCHECKPOINTDUMP_H_INCLUDED_
///////////////////////////////////////////////////////////////////////////////
//                                                         
// CegoCheckpointDump.h
// --------------------
// Cego Checkpoint dump handler class definition
//                                                         
// Design and Implementation by Bjoern Lemke
//
// (C)opyright 2000-2025 Bjoern Lemke
//
// INTERFACE MODULE
//
// Class: CegoCheckpointDump
// 
// Description: Bufferpool checkpoint dump handling
//
// Status: CLEAN
//
///////////////////////////////////////////////////////////////////////////////

#include <lfcbase/Chain.h>
#include <lfcbase/File.h>

// CEGO INCLUDES
#include "CegoDefs.h"

class CegoCheckpointDump {
    
public:

    CegoCheckpointDump(const Chain& tableSet, const Chain& tsRoot, unsigned pageSize);
    
    void startWrite();
    void dumpPage(PageIdType pageId, unsigned fixStat, char* pageData);
    void finish();
    
    void commitDump();

    void startRead();
    bool readDump(PageIdType& pageId, unsigned& fixStat, char* pageData);
    void remove();

    bool readyDumpExists();

    void cleanUp();

private:

    Chain _tableSet;
    Chain _tsRoot;
    unsigned _pageSize;
    
    File* _pDumpFile;
};
#endif
