A list of tables. More...
#include <table.h>
Public Types | |
typedef tableSet::const_iterator | iterator |
typedef std::map< const char *, ibis::table *, ibis::lessi > | tableSet |
Public Member Functions | |
void | add (ibis::table *&tb) |
Add a new table object to the list. More... | |
iterator | begin () const |
Return the iterator to the first table. | |
bool | empty () const |
Is the list empty? Returns true if the list is empty, otherwise returns false. More... | |
iterator | end () const |
Return the iterator to the end of the list. More... | |
const ibis::table * | operator[] (const char *tname) const |
Find the named table. More... | |
void | remove (const char *tname) |
Remove the named data table from the list. More... | |
uint32_t | size () const |
Return the number of tables in the list. | |
tableList () | |
Default constructor. | |
~tableList () | |
Destructor. Delete all table objects. | |
A list of tables.
It supports simple lookup through operator[] and manages the table objects passed to it. Most functions are simply wrappers on std::map.
|
inline |
Add a new table object to the list.
Transfers the control of the object to the tableList. If the name of the table already exists, the existing table will be passed back out, otherwise, the argument tb
is set to null. In either case, the caller can call delete on the variable and should do so to avoid memory leak.
References ibis::table::name().
|
inline |
Is the list empty? Returns true if the list is empty, otherwise returns false.
|
inline |
Return the iterator to the end of the list.
Following STL convention, the end
is always one past the last element in the list.
|
inline |
Find the named table.
Returns null pointer if no table with the given name is found.
|
inline |
Remove the named data table from the list.
The destructor of this function automatically clean up all table objects, there is no need to explicit remove them.