NDEVR
API Documentation
Database

Provides access to a set of named database tables. More...

Collaboration diagram for Database:
[legend]

Public Member Functions

virtual void addTable (DynamicPointer< Table > &table)
 Adds a table to the database.
virtual DynamicPointer< Table > & getTable (const String &name)
 Retrieves a table by name from the database.
virtual Dictionary< String, DynamicPointer< Table > > & tables ()
 Returns a mutable reference to the dictionary of all tables.
virtual const Dictionary< String, DynamicPointer< Table > > & tables () const
 Returns a const reference to the dictionary of all tables.

Protected Attributes

Dictionary< String, DynamicPointer< Table > > m_tables
 Maps table names to their corresponding Table pointers.

Detailed Description

Provides access to a set of named database tables.


See also
Table, TableColumn, BinaryFileTableInfo

Definition at line 43 of file Database.h.

Member Function Documentation

◆ addTable()

virtual void Database::addTable ( DynamicPointer< Table > & table)
virtual

Adds a table to the database.


The table is registered using the name it already carries internally.

Parameters
[in]tableA reference to the DynamicPointer<Table> to add.

◆ getTable()

virtual DynamicPointer< Table > & Database::getTable ( const String & name)
inlinevirtual

Retrieves a table by name from the database.


If the table does not already exist in the dictionary, this will default-construct an entry for the given name and return a reference to it.

Parameters
[in]nameThe unique name identifying the table.
Returns
A reference to the DynamicPointer<Table> associated with the given name.

Definition at line 54 of file Database.h.

References m_tables, and name.

◆ tables() [1/2]

virtual Dictionary< String, DynamicPointer< Table > > & Database::tables ( )
inlinevirtual

Returns a mutable reference to the dictionary of all tables.


Returns
A reference to the Dictionary mapping table names to their DynamicPointer<Table> objects.

Definition at line 71 of file Database.h.

References m_tables.

◆ tables() [2/2]

virtual const Dictionary< String, DynamicPointer< Table > > & Database::tables ( ) const
inlinevirtual

Returns a const reference to the dictionary of all tables.


Returns
A const reference to the Dictionary mapping table names to their DynamicPointer<Table> objects.

Definition at line 80 of file Database.h.

References m_tables.


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