Public Types | Public Member Functions | List of all members
ibis::tableList Class Reference

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::tableoperator[] (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.
 

Detailed Description

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.

Member Function Documentation

void ibis::tableList::add ( ibis::table *&  tb)
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().

bool ibis::tableList::empty ( ) const
inline

Is the list empty? Returns true if the list is empty, otherwise returns false.

iterator ibis::tableList::end ( ) const
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.

const ibis::table* ibis::tableList::operator[] ( const char *  tname) const
inline

Find the named table.

Returns null pointer if no table with the given name is found.

void ibis::tableList::remove ( const char *  tname)
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.


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

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive