Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::genstruct::Table< T > Class Template Reference

#include <elm/genstruct/Table.h>

+ Inheritance diagram for elm::genstruct::Table< T >:

Classes

class  Iterator
 

Public Member Functions

 Table (void)
 
 Table (T *table, int count)
 
 Table (const Table< T > &table)
 
int size (void) const
 
const T & get (int index) const
 
T & get (int index)
 
void set (int index, const T &value)
 
bool isEmpty (void) const
 
void copy (const Table< T > &table)
 
const T & operator[] (int index) const
 
T & operator[] (int index)
 
Table< T > & operator= (const Table &table)
 
 operator bool (void) const
 
const T * operator* (void) const
 
T * operator* (void)
 
int count (void) const
 
const T * table (void) const
 
T * table (void)
 

Static Public Attributes

static Table< T > EMPTY
 

Protected Attributes

T * tab
 
int cnt
 

Detailed Description

template<class T>
class elm::genstruct::Table< T >

This class allows handling simple table stored as C tables with an item count.

Parameters
TType of the items in the table.

Constructor & Destructor Documentation

template<class T>
elm::genstruct::Table< T >::Table ( void  )
template<class T>
elm::genstruct::Table< T >::Table ( T *  table,
int  count 
)

Build a new table.

Parameters
tableC table containings items.
countItem count.
template<class T>
elm::genstruct::Table< T >::Table ( const Table< T > &  table)

Member Function Documentation

template<class T>
T elm::genstruct::Table< T >::get ( int  index) const

Get a table item.

Parameters
indexIndex of the item to get.
Returns
Value of the item.
template<class T>
T & elm::genstruct::Table< T >::get ( int  index)

Get a reference on a table item.

Parameters
indexIndex of the item to get.
Returns
Reference of the item.
template<class T>
elm::genstruct::Table< T >::operator bool ( void  ) const
template<class T>
const T* elm::genstruct::Table< T >::operator* ( void  ) const
template<class T>
T* elm::genstruct::Table< T >::operator* ( void  )
template<class T>
Table< T > & elm::genstruct::Table< T >::operator= ( const Table< T > &  table)

Implements assignment for tables.

Parameters
tableTable to assign.
Returns
Current table.
template<class T>
T elm::genstruct::Table< T >::operator[] ( int  index) const

Same as Table::get() const.

template<class T>
T & elm::genstruct::Table< T >::operator[] ( int  index)

Same as Table:get().

template<class T>
void elm::genstruct::Table< T >::set ( int  index,
const T &  value 
)

Set the value of an item.

Parameters
indexItem index.
valueItem value.
template<class T>
int elm::genstruct::Table< T >::size ( void  ) const
template<class T>
const T * elm::genstruct::Table< T >::table ( void  ) const

Get the C table as writable.

Returns
Writeable C table.
template<class T>
T * elm::genstruct::Table< T >::table ( void  )

Get the C table as read-only.

Returns
Read-only C table.

Member Data Documentation

template<class T>
Table< T > elm::genstruct::Table< T >::EMPTY
static

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