Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

terimber_memtable Class Reference

abstract interface to memory table More...

#include <memdbacc.h>

Inheritance diagram for terimber_memtable:

terimber_log_helper terimber_log memtable

List of all members.

Public Member Functions

virtual ~terimber_memtable ()
 destructor user is responsible for destoying the memtable object
virtual const char * get_last_error ()=0
 returns the last occured error
virtual bool populate (dbserver *server, size_t start_row, size_t max_rows)=0
 creates internal table structure from server object db_server has to be after executing query or stored procedure and ready to fetch data memtable automatically detects the list of columns in recordset and creates a table in the memory with the same columns' order and types. max_rows sets a restriction on max rows to be retrived, -1 - all of them start_row means absolute number of row to start with unless you specify 0, then memtable starts with the current row to create an empty table, the fake select can be used for instanse, select CAST(0 as NUMBER) as col1, CAST('' as VARCHAR2(255)) as col2 from dual; or you can specifiy the max_rows = 0
virtual bool create (size_t columns, const terimber_table_column_desc desc[])=0
 the other alternative is to create an empty table in the memory is specification the list of columns descriptions explicitly
virtual void refresh ()=0
 resets all new, updates rows status to original, removes deleted rows updates all indexes
virtual size_t get_row_count ()=0
 after populating and at any time after that you can request the number of rows in table
virtual size_t get_column_count () const =0
 columns description is pretty much the same as db_server provides
virtual dbtypes get_column_type (size_t index) const =0
 returns the virtual terimber dbtype like db_bool, ...
virtual const char * get_column_name (size_t index) const =0
 returns the name of the column
virtual bool get_column_nullable (size_t index) const =0
 returns the nullable - database specific
virtual size_t get_column_scale (size_t index) const =0
 returns the scale
virtual size_t get_column_precision (size_t index) const =0
 returns the precision
virtual size_t get_column_max_length (size_t index) const =0
 returns the length of the column (only for fixed length columns)
virtual terimber_memindexadd_index (size_t columns, const terimber_index_column_info info[])=0
 create index to perform the quick search columns the size of index info - array of index column descriptions returns the new created memindex object user must not to use object after returning it back or after memtable will be destoyed this is an expensive operation in order to consume memory and CPU time
virtual bool remove_index (terimber_memindex *obj)=0
 destroys index memtable data is still valid all memlookups on the current index will be destroyed!
virtual terimber_db_value_vectorallocate_db_values (size_t count)=0
 requests value array
virtual void destroy_db_values (terimber_db_value_vector *obj)=0
 destroys value array


Detailed Description

abstract interface to memory table

Definition at line 406 of file memdbacc.h.


Constructor & Destructor Documentation

virtual terimber_memtable::~terimber_memtable (  )  [inline, virtual]

destructor user is responsible for destoying the memtable object

Definition at line 412 of file memdbacc.h.


Member Function Documentation

virtual const char* terimber_memtable::get_last_error (  )  [pure virtual]

returns the last occured error

Implemented in memtable.

virtual bool terimber_memtable::populate ( dbserver server,
size_t  start_row,
size_t  max_rows 
) [pure virtual]

creates internal table structure from server object db_server has to be after executing query or stored procedure and ready to fetch data memtable automatically detects the list of columns in recordset and creates a table in the memory with the same columns' order and types. max_rows sets a restriction on max rows to be retrived, -1 - all of them start_row means absolute number of row to start with unless you specify 0, then memtable starts with the current row to create an empty table, the fake select can be used for instanse, select CAST(0 as NUMBER) as col1, CAST('' as VARCHAR2(255)) as col2 from dual; or you can specifiy the max_rows = 0

Parameters:
server  dbserver instance, connected to database and opened the recordset
start_row  row to fetch from, 0 - current row
max_rows  max row to fetch

Implemented in memtable.

virtual bool terimber_memtable::create ( size_t  columns,
const terimber_table_column_desc  desc[] 
) [pure virtual]

the other alternative is to create an empty table in the memory is specification the list of columns descriptions explicitly

Parameters:
columns  number of columns
desc  array of columns' descriptors

Implemented in memtable.

virtual void terimber_memtable::refresh (  )  [pure virtual]

resets all new, updates rows status to original, removes deleted rows updates all indexes

Implemented in memtable.

virtual size_t terimber_memtable::get_row_count (  )  [pure virtual]

after populating and at any time after that you can request the number of rows in table

Implemented in memtable.

virtual size_t terimber_memtable::get_column_count (  )  const [pure virtual]

columns description is pretty much the same as db_server provides

gets column count

Implemented in memtable.

virtual dbtypes terimber_memtable::get_column_type ( size_t  index  )  const [pure virtual]

returns the virtual terimber dbtype like db_bool, ...

Parameters:
index  index

Implemented in memtable.

virtual const char* terimber_memtable::get_column_name ( size_t  index  )  const [pure virtual]

returns the name of the column

Parameters:
index  index

Implemented in memtable.

virtual bool terimber_memtable::get_column_nullable ( size_t  index  )  const [pure virtual]

returns the nullable - database specific

Parameters:
index  index

Implemented in memtable.

virtual size_t terimber_memtable::get_column_scale ( size_t  index  )  const [pure virtual]

returns the scale

Parameters:
index  index

Implemented in memtable.

virtual size_t terimber_memtable::get_column_precision ( size_t  index  )  const [pure virtual]

returns the precision

Parameters:
index  index

Implemented in memtable.

virtual size_t terimber_memtable::get_column_max_length ( size_t  index  )  const [pure virtual]

returns the length of the column (only for fixed length columns)

Parameters:
index  index

Implemented in memtable.

virtual terimber_memindex* terimber_memtable::add_index ( size_t  columns,
const terimber_index_column_info  info[] 
) [pure virtual]

create index to perform the quick search columns the size of index info - array of index column descriptions returns the new created memindex object user must not to use object after returning it back or after memtable will be destoyed this is an expensive operation in order to consume memory and CPU time

index management there are no connections between indexes in the memory and indexes in database

Parameters:
columns  columns in index
info  array of index columns' descriptions

Implemented in memtable.

virtual bool terimber_memtable::remove_index ( terimber_memindex obj  )  [pure virtual]

destroys index memtable data is still valid all memlookups on the current index will be destroyed!

Parameters:
obj  index pointer

Implemented in memtable.

virtual terimber_db_value_vector* terimber_memtable::allocate_db_values ( size_t  count  )  [pure virtual]

requests value array

Parameters:
count  array size

Implemented in memtable.

virtual void terimber_memtable::destroy_db_values ( terimber_db_value_vector obj  )  [pure virtual]

destroys value array

Parameters:
obj  value array pointer

Implemented in memtable.


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


© Copyright Terimber 2003-.