threaddb  2.0b
A file mapped memory container extension
Public Member Functions | List of all members
tdb::database Class Reference

C++ wrapper class of the threadDB file mapped memory container extension. More...

#include <threaddbCPP.h>

Public Member Functions

 database (size_t PackageSize_p=4096, size_t PackageCacheLimit_p=std::numeric_limits< size_t >::max(), const std::string &rPackagesPath_p="")
 C++ wrapper to construct a threadDB database object see ThreadDB_Create. More...
 
 database (const std::string &rIndexFileUTF8_p, size_t PackageCacheLimit_p=std::numeric_limits< size_t >::max())
 C++ wrapper to construct a threadDB database object from file see ThreadDB_Import. More...
 
 ~database ()
 C++ wrapper to destruct a threadDB database object see ThreadDB_Destroy. More...
 
const char * GetVersionInfo () const
 C++ wrapper to retrieve the version information of the current installation see ThreadDB_GetVersionInfo. More...
 
void Save (const char *pIndexFileUTF8_p)
 C++ wrapper to save the contents of a threadDB database see ThreadDB_Save. More...
 
const char * NewThread (const char *pDataFolder_p, size_t MaxFileSize_p=std::numeric_limits< size_t >::max())
 C++ wrapper to create and register a threadDB worker thread see ThreadDB_NewThread. More...
 
uint64_t NewPackage ()
 C++ wrapper to create and register a threadDB data package see ThreadDB_NewPackage. More...
 
size_t GetThreadCount () const
 C++ wrapper to retrieve the number of running threads see ThreadDB_GetThreadCount. More...
 
size_t GetPackageCount () const
 C++ wrapper to retrieve the number of registered packages see ThreadDB_GetPackageCount. More...
 
size_t GetFileCount () const
 C++ wrapper to retrieve the number of registered temporary database files see ThreadDB_GetFileCount. More...
 
size_t GetPackageSize () const
 C++ wrapper to retrieve the size of the internally allocated package buffers see ThreadDB_GetPackageSize. More...
 
const char * GetDatabaseFilename (size_t FileIndex_p) const
 C++ wrapper to derive the name of the temporary database file with index FileIndex_p ThreadDB_GetDatabaseFileName. More...
 
void RelocateFileTo (size_t FileID_p, const char *pFilePathUTF8_p, threadDB_RelocationType RelocationType_p) const
 C++ wrapper to move a file to a different location or disk see ThreadDB_RelocateFileTo. More...
 
void Store (uint64_t Package_p, size_t Size_p, const char pData_p[], threadDB_ItemInfo *pItemHandle_p=0)
 C++ wrapper to store a data item in the selected package see ThreadDB_Store. More...
 
void Synchronize (uint64_t Package_p)
 C++ wrapper to synchronize the package buffers prior reading see ThreadDB_Synchronize. More...
 
void Synchronize ()
 C++ wrapper to synchronize the package buffers prior reading see ThreadDB_Synchronize. More...
 
tdb::ReadInfo Open (uint64_t Package_p)
 C++ wrapper to open a package for stream reading see ThreadDB_Open. More...
 
tdb::ReadInfo Open (const tdb::ItemInfo &rItemHandle_p)
 C++ wrapper to open a package for stream reading see ThreadDB_OpenItem. More...
 
size_t Recover (size_t Size_p, char pData_p[], tdb::ReadInfo &rReadInfo_p)
 C++ wrapper for stream reading of data items see ThreadDB_RecoverContinous. More...
 
bool End (const tdb::ReadInfo &rReadInfo_p) const
 C++ wrapper for stream end indicator see ThreadDB_PackageEnd. More...
 
void Recover (size_t Size_p, char pData_p[], const tdb::ItemInfo &rItemHandle_p, uint64_t Package_p)
 C++ wrapper for random reading of data items see ThreadDB_RecoverRandom. More...
 
void Replace (size_t Size_p, const char pData_p[], tdb::ItemInfo &rItemHandle_p)
 C++ wrapper for replacing the contents of a data item see ThreadDB_Replace. More...
 

Detailed Description

C++ wrapper class of the threadDB file mapped memory container extension.

Constructor & Destructor Documentation

◆ database() [1/2]

tdb::database::database ( size_t  PackageSize_p = 4096,
size_t  PackageCacheLimit_p = std::numeric_limits<size_t>::max(),
const std::string &  rPackagesPath_p = "" 
)
inline

C++ wrapper to construct a threadDB database object see ThreadDB_Create.

◆ database() [2/2]

tdb::database::database ( const std::string &  rIndexFileUTF8_p,
size_t  PackageCacheLimit_p = std::numeric_limits<size_t>::max() 
)
inline

C++ wrapper to construct a threadDB database object from file see ThreadDB_Import.

◆ ~database()

tdb::database::~database ( )
inline

C++ wrapper to destruct a threadDB database object see ThreadDB_Destroy.

Member Function Documentation

◆ End()

bool tdb::database::End ( const tdb::ReadInfo rReadInfo_p) const
inline

C++ wrapper for stream end indicator see ThreadDB_PackageEnd.

returns flag if package end reached.

◆ GetDatabaseFilename()

const char* tdb::database::GetDatabaseFilename ( size_t  FileIndex_p) const
inline

C++ wrapper to derive the name of the temporary database file with index FileIndex_p ThreadDB_GetDatabaseFileName.

◆ GetFileCount()

size_t tdb::database::GetFileCount ( ) const
inline

C++ wrapper to retrieve the number of registered temporary database files see ThreadDB_GetFileCount.

◆ GetPackageCount()

size_t tdb::database::GetPackageCount ( ) const
inline

C++ wrapper to retrieve the number of registered packages see ThreadDB_GetPackageCount.

◆ GetPackageSize()

size_t tdb::database::GetPackageSize ( ) const
inline

C++ wrapper to retrieve the size of the internally allocated package buffers see ThreadDB_GetPackageSize.

◆ GetThreadCount()

size_t tdb::database::GetThreadCount ( ) const
inline

C++ wrapper to retrieve the number of running threads see ThreadDB_GetThreadCount.

◆ GetVersionInfo()

const char* tdb::database::GetVersionInfo ( ) const
inline

C++ wrapper to retrieve the version information of the current installation see ThreadDB_GetVersionInfo.

◆ NewPackage()

uint64_t tdb::database::NewPackage ( )
inline

C++ wrapper to create and register a threadDB data package see ThreadDB_NewPackage.

◆ NewThread()

const char* tdb::database::NewThread ( const char *  pDataFolder_p,
size_t  MaxFileSize_p = std::numeric_limits<size_t>::max() 
)
inline

C++ wrapper to create and register a threadDB worker thread see ThreadDB_NewThread.

◆ Open() [1/2]

tdb::ReadInfo tdb::database::Open ( const tdb::ItemInfo rItemHandle_p)
inline

C++ wrapper to open a package for stream reading see ThreadDB_OpenItem.

return The threadDB_ReadInfo handle.

◆ Open() [2/2]

tdb::ReadInfo tdb::database::Open ( uint64_t  Package_p)
inline

C++ wrapper to open a package for stream reading see ThreadDB_Open.

return The threadDB_ReadInfo handle.

◆ Recover() [1/2]

void tdb::database::Recover ( size_t  Size_p,
char  pData_p[],
const tdb::ItemInfo rItemHandle_p,
uint64_t  Package_p 
)
inline

C++ wrapper for random reading of data items see ThreadDB_RecoverRandom.

returns The threadDB_ItemInfo handle.

◆ Recover() [2/2]

size_t tdb::database::Recover ( size_t  Size_p,
char  pData_p[],
tdb::ReadInfo rReadInfo_p 
)
inline

C++ wrapper for stream reading of data items see ThreadDB_RecoverContinous.

returns The number of read bytes.

◆ RelocateFileTo()

void tdb::database::RelocateFileTo ( size_t  FileID_p,
const char *  pFilePathUTF8_p,
threadDB_RelocationType  RelocationType_p 
) const
inline

C++ wrapper to move a file to a different location or disk see ThreadDB_RelocateFileTo.

◆ Replace()

void tdb::database::Replace ( size_t  Size_p,
const char  pData_p[],
tdb::ItemInfo rItemHandle_p 
)
inline

C++ wrapper for replacing the contents of a data item see ThreadDB_Replace.

◆ Save()

void tdb::database::Save ( const char *  pIndexFileUTF8_p)
inline

C++ wrapper to save the contents of a threadDB database see ThreadDB_Save.

◆ Store()

void tdb::database::Store ( uint64_t  Package_p,
size_t  Size_p,
const char  pData_p[],
threadDB_ItemInfo pItemHandle_p = 0 
)
inline

C++ wrapper to store a data item in the selected package see ThreadDB_Store.

◆ Synchronize() [1/2]

void tdb::database::Synchronize ( )
inline

C++ wrapper to synchronize the package buffers prior reading see ThreadDB_Synchronize.

◆ Synchronize() [2/2]

void tdb::database::Synchronize ( uint64_t  Package_p)
inline

C++ wrapper to synchronize the package buffers prior reading see ThreadDB_Synchronize.


The documentation for this class was generated from the following file: