Nebula
|
#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 | |
Table & | GetTable (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< TableId > | Query (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::String & | GetClassName () 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) | |
MemDb::Database::Database | ( | ) |
constructor
MemDb::Database::~Database | ( | ) |
destructor
|
private |
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.
TableId MemDb::Database::CreateTable | ( | TableCreateInfo const & | info | ) |
create new table
void MemDb::Database::DeleteTable | ( | TableId | table | ) |
delete table
TableId MemDb::Database::FindTable | ( | TableSignature const & | signature | ) | const |
find table by signature
void MemDb::Database::ForEachTable | ( | std::function< void(TableId)> const & | callback | ) |
run a callback for each table in the db
|
inline |
retrieve the number of tables
bool MemDb::Database::IsValid | ( | TableId | table | ) | const |
check if table is valid
Query the database for a dataset of tables.
Util::Array< TableId > MemDb::Database::Query | ( | TableSignature const & | inclusive, |
TableSignature const & | exclusive ) |
Query the database for a set of tables that fulfill the requirements.
void MemDb::Database::Reset | ( | ) |
performs Clean on all tables.
|
staticconstexpr |
|
private |
number of tables existing currently
|
private |
id pool for table ids
|
private |
all tables within the database