Nebula
Loading...
Searching...
No Matches
MemDb::Database Class Reference

#include <database.h>

Inherits Core::RefCounted.

Public Member Functions

 Database ()
 constructor
 
 ~Database ()
 destructor
 
TableId CreateTable (TableCreateInfo const &info)
 create new table
 
void DeleteTable (TableId table)
 delete table
 
bool IsValid (TableId table) const
 check if table is valid
 
TableGetTable (TableId tid)
 retrieve a table.
 
TableId FindTable (TableSignature const &signature) const
 find table by signature
 
SizeT GetNumTables () const
 retrieve the number of tables
 
void ForEachTable (std::function< void(TableId)> const &callback)
 run a callback for each table in the db
 
void Reset ()
 performs Clean on all tables.
 
Dataset Query (FilterSet const &filterset)
 Query the database for a dataset of tables.
 
Util::Array< TableIdQuery (TableSignature const &inclusive, TableSignature const &exclusive)
 Query the database for a set of tables that fulfill the requirements.
 
void Copy (Ptr< MemDb::Database > const &dst) const
 copy the database into dst
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 

Static Public Attributes

static constexpr uint32_t MAX_NUM_TABLES = 512
 

Private Member Functions

 __DeclareClass (MemDb::Database)
 

Private Attributes

Ids::IdGenerationPool tableIdPool
 id pool for table ids
 
Table tables [MAX_NUM_TABLES]
 all tables within the database
 
SizeT numTables = 0
 number of tables existing currently
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 

Constructor & Destructor Documentation

◆ Database()

MemDb::Database::Database ( )

constructor

◆ ~Database()

MemDb::Database::~Database ( )

destructor

Member Function Documentation

◆ __DeclareClass()

MemDb::Database::__DeclareClass ( MemDb::Database )
private

◆ Copy()

void MemDb::Database::Copy ( Ptr< MemDb::Database > const & dst) const

copy the database into dst

Note that this function will override an old table if the signature exists.

◆ CreateTable()

TableId MemDb::Database::CreateTable ( TableCreateInfo const & info)

create new table

◆ DeleteTable()

void MemDb::Database::DeleteTable ( TableId table)

delete table

◆ FindTable()

TableId MemDb::Database::FindTable ( TableSignature const & signature) const

find table by signature

◆ ForEachTable()

void MemDb::Database::ForEachTable ( std::function< void(TableId)> const & callback)

run a callback for each table in the db

◆ GetNumTables()

SizeT MemDb::Database::GetNumTables ( ) const
inline

retrieve the number of tables

◆ GetTable()

Table & MemDb::Database::GetTable ( TableId tid)

retrieve a table.

◆ IsValid()

bool MemDb::Database::IsValid ( TableId table) const

check if table is valid

◆ Query() [1/2]

Dataset MemDb::Database::Query ( FilterSet const & filterset)

Query the database for a dataset of tables.

◆ Query() [2/2]

Util::Array< TableId > MemDb::Database::Query ( TableSignature const & inclusive,
TableSignature const & exclusive )

Query the database for a set of tables that fulfill the requirements.

◆ Reset()

void MemDb::Database::Reset ( )

performs Clean on all tables.

Member Data Documentation

◆ MAX_NUM_TABLES

uint32_t MemDb::Database::MAX_NUM_TABLES = 512
staticconstexpr

◆ numTables

SizeT MemDb::Database::numTables = 0
private

number of tables existing currently

◆ tableIdPool

Ids::IdGenerationPool MemDb::Database::tableIdPool
private

id pool for table ids

◆ tables

Table MemDb::Database::tables[MAX_NUM_TABLES]
private

all tables within the database


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