Rudiments
Public Member Functions | List of all members
table< valuetype > Class Template Reference

#include <table.h>

Inherits tablecollection< valuetype >.

Public Member Functions

 table ()
 
 table (table< valuetype > &a)
 
 table (tablecollection< valuetype > &a)
 
table< valuetype > & operator= (table< valuetype > &a)
 
table< valuetype > & operator= (tablecollection< valuetype > &a)
 
 ~table ()
 
void setCopyColumnNames (bool copy)
 
bool getCopyColumnNames ()
 
void setColumnName (uint64_t col, const char *name)
 
const chargetColumnName (uint64_t col)
 
uint64_t getColumnCount ()
 
void setManageValues (bool manage)
 
bool getManageValues ()
 
void setManageArrayValues (bool manage)
 
bool getManageArrayValues ()
 
void setValue (uint64_t row, uint64_t col, valuetype value)
 
valuetype getValue (uint64_t row, uint64_t col)
 
valuetypegetReference (uint64_t row, uint64_t col)
 
valuetype getValue (uint64_t row, const char *colname)
 
uint64_t getRowCount ()
 
bool getAllRowsAvailable ()
 
bool clear ()
 
- Public Member Functions inherited from tablecollection< valuetype >
 tablecollection ()
 
 tablecollection (tablecollection &c)
 
tablecollectionoperator= (tablecollection &c)
 
virtual ~tablecollection ()
 
virtual const chargetType ()
 
virtual uint64_t getCount ()
 
virtual ssize_t write ()
 
virtual ssize_t write (output *out)
 
virtual ssize_t writeJson ()
 
virtual ssize_t writeJson (bool indent)
 
virtual ssize_t writeJson (output *out)
 
virtual ssize_t writeJson (output *out, bool indent)
 
- Public Member Functions inherited from collection
 collection ()
 
 collection (collection &c)
 
collectionoperator= (collection &c)
 
virtual ~collection ()
 
comparatorgetComparator ()
 
void setComparator (comparator *newcomp)
 
virtual bool isReadOnly ()
 
virtual bool isBlockBased ()
 
virtual uint64_t getBlockSize ()
 
virtual bool isSequentialAccess ()
 
virtual void setManageKeys (bool manage)
 
virtual bool getManageKeys ()
 
virtual void setManageArrayKeys (bool manage)
 
virtual bool getManageArrayKeys ()
 
- Public Member Functions inherited from object
virtual ~object ()
 

Detailed Description

template<class valuetype>
class table< valuetype >

The table class allows you to store an arbitrary number of values in a table. Since the table class is template-based, you can store arbitrary types of values.

Read-write, monolithic, random-access.

Constructor & Destructor Documentation

◆ table() [1/3]

template<class valuetype >
table< valuetype >::table ( )
inline

Creates an instance of the table class.

◆ table() [2/3]

template<class valuetype >
table< valuetype >::table ( table< valuetype > & a)
inline

Creates an instance of the table class that is a copy of "a".

◆ table() [3/3]

Creates an instance of the table class that is a copy of "a".

◆ ~table()

template<class valuetype >
table< valuetype >::~table ( )
inline

Deletes this instance of the table class.

Member Function Documentation

◆ clear()

template<class valuetype >
bool table< valuetype >::clear ( )
inlinevirtual

Removes all values currently stored in the table, such that getValue() will return NULL or 0. Always returns true.

Implements collection.

◆ getAllRowsAvailable()

template<class valuetype >
bool table< valuetype >::getAllRowsAvailable ( )
inlinevirtual

Returns true.

Implements tablecollection< valuetype >.

◆ getColumnCount()

template<class valuetype >
uint64_t table< valuetype >::getColumnCount ( )
inlinevirtual

Returns the current number of columns in the table.

Returns larger and larger values as calls to setColumnName() or setValue() extend the table.

Implements tablecollection< valuetype >.

◆ getColumnName()

template<class valuetype >
const char * table< valuetype >::getColumnName ( uint64_t col)
inlinevirtual

Returns the name of column "col".

Implements tablecollection< valuetype >.

◆ getCopyColumnNames()

template<class valuetype >
bool table< valuetype >::getCopyColumnNames ( )
inlinevirtual

Returns whether or not this instance of the tablecollection class is configured to make copies of the values that are passed in to setColumnName().

Returns true if it is and false if it is not.

Reimplemented from tablecollection< valuetype >.

◆ getManageArrayValues()

template<class valuetype >
bool table< valuetype >::getManageArrayValues ( )
inlinevirtual

Returns whether or not this instance of the table class is configured to array-delete the values that are stored at each location in the table when clear() is called.

Returns true if it is and false if it is not.

Reimplemented from collection.

◆ getManageValues()

template<class valuetype >
bool table< valuetype >::getManageValues ( )
inlinevirtual

Returns whether or not this instance of the table class is configured to delete the values that are stored at each location in the table when clear() is called.

Returns true if it is and false if it is not.

Reimplemented from collection.

◆ getReference()

template<class valuetype >
valuetype & table< valuetype >::getReference ( uint64_t row,
uint64_t col )
inlinevirtual

Returns a reference to the value at "row", "col".

Implements tablecollection< valuetype >.

◆ getRowCount()

template<class valuetype >
uint64_t table< valuetype >::getRowCount ( )
inlinevirtual

Returns the current number of rows in the table.

Returns larger and larger values as calls to setValue() extend the table.

Implements tablecollection< valuetype >.

◆ getValue() [1/2]

template<class valuetype >
valuetype table< valuetype >::getValue ( uint64_t row,
const char * colname )
inlinevirtual

Returns the value at "row", "colname". Returns NULL or 0 if there is no value at that address.

Implements tablecollection< valuetype >.

◆ getValue() [2/2]

template<class valuetype >
valuetype table< valuetype >::getValue ( uint64_t row,
uint64_t col )
inlinevirtual

Returns the value at "row", "col". Returns NULL or 0 if there is no value at that address.

Implements tablecollection< valuetype >.

◆ operator=() [1/2]

template<class valuetype >
table< valuetype > & table< valuetype >::operator= ( table< valuetype > & a)
inline

Makes this instance of the table class identical to "a".

◆ operator=() [2/2]

Makes this instance of the table class identical to "a".

◆ setColumnName()

template<class valuetype >
void table< valuetype >::setColumnName ( uint64_t col,
const char * name )
inlinevirtual

Sets the name of column "col" to "name"

Implements tablecollection< valuetype >.

◆ setCopyColumnNames()

template<class valuetype >
void table< valuetype >::setCopyColumnNames ( bool copy)
inlinevirtual

Indicates whether or not this instance of the tablecollection class should make copies the values that are passed in to setColumnName().

Defaults to "false".

Reimplemented from tablecollection< valuetype >.

◆ setManageArrayValues()

template<class valuetype >
void table< valuetype >::setManageArrayValues ( bool manage)
inlinevirtual

Indicates whether or not this instance of the table class should array-delete the values that are stored at each location in the table when clear() is called.

Setting "manage" to true causes the instance to array-delete the values that are stored at each location in the table when clear() is called.

Setting "manage" to false causes the instance not to array-delete the values that are stored at each location in the table when clear() is called.

Defaults to "false".

Note that setting this true implies setManageValues(false);

Reimplemented from collection.

◆ setManageValues()

template<class valuetype >
void table< valuetype >::setManageValues ( bool manage)
inlinevirtual

Indicates whether or not this instance of the table class should delete the values that are stored at each location in the table when clear() is called.

Setting "manage" to true causes the instance to delete the values that are stored at each location in the table when clear() is called.

Setting "manage" to false causes the instance not to delete the values that are stored at each location in the table when clear() is called.

Defaults to "false".

Note that setting this true implies setManageArrayValues(false);

Reimplemented from collection.

◆ setValue()

template<class valuetype >
void table< valuetype >::setValue ( uint64_t row,
uint64_t col,
valuetype value )
inlinevirtual

Sets the value at "row", "col" to "value".

Implements tablecollection< valuetype >.