Fairport
v1.0.38
|
Table implementation. More...
#include <table.h>
Public Member Functions | |
virtual | ~table_impl () |
virtual ulong | lookup_row (row_id id) const =0 |
Find the offset into the table of the given row_id. | |
const_table_row | operator[] (ulong row) const |
Get the requested table row. | |
const_table_row_iter | begin () const |
Get an iterator pointing to the first row. | |
const_table_row_iter | end () const |
Get an end iterator for this table. | |
virtual node & | get_node ()=0 |
Get the node backing this table. | |
virtual const node & | get_node () const =0 |
Get the node backing this table. | |
virtual ulonglong | get_cell_value (ulong row, prop_id id) const =0 |
Get the contents of the specified cell in the specified row. | |
virtual std::vector< byte > | read_cell (ulong row, prop_id id) const =0 |
Get the contents of a indirect property in the specified row. | |
virtual hnid_stream_device | open_cell_stream (ulong row, prop_id id)=0 |
Open a stream over a property in a given row. | |
virtual std::vector< prop_id > | get_prop_list () const =0 |
Get all of the properties on this table. | |
virtual prop_type | get_prop_type (prop_id id) const =0 |
Get the type of a property. | |
virtual row_id | get_row_id (ulong row) const =0 |
Get the row id of a specified row. | |
virtual size_t | size () const =0 |
Get the number of rows in this table. | |
virtual bool | prop_exists (ulong row, prop_id id) const =0 |
Check to see if a property exists for a given row. | |
virtual size_t | row_prop_size (ulong row, prop_id id) const =0 |
Return the size of a property for a given row. |
Table implementation.
Similar to the node and heap classes, the table class is divided into an implementation class and stack based class. Child objects (in this case, table rows) can reference the implementation class and thus safely outlive the stack based class.
A key difference in the table implementation, however, is that there are actually a few different types of tables. So instead of having one impl class, we have one impl base class to which everyone holds a shared pointer to, and several child classes which we instiate depending on the actual underlying table type. This is the table implementation "interface" class.
virtual fairport::table_impl::~table_impl | ( | ) | [inline, virtual] |
const_table_row_iter fairport::table_impl::begin | ( | ) | const [inline] |
const_table_row_iter fairport::table_impl::end | ( | ) | const [inline] |
virtual ulonglong fairport::table_impl::get_cell_value | ( | ulong | row, |
prop_id | id | ||
) | const [pure virtual] |
Get the contents of the specified cell in the specified row.
key_not_found<prop_id> | If the specified property does not exist on the specified row |
out_of_range | If the specified row offset is beyond the size of this table |
[in] | row | The offset into the table |
[in] | id | The prop_id to find the cell value of |
Implemented in fairport::basic_table< T >, and fairport::empty_table.
virtual node& fairport::table_impl::get_node | ( | ) | [pure virtual] |
Get the node backing this table.
Implemented in fairport::basic_table< T >, and fairport::empty_table.
virtual const node& fairport::table_impl::get_node | ( | ) | const [pure virtual] |
Get the node backing this table.
Implemented in fairport::basic_table< T >, and fairport::empty_table.
virtual std::vector<prop_id> fairport::table_impl::get_prop_list | ( | ) | const [pure virtual] |
Get all of the properties on this table.
This returns the properties behind all of the columns which make up this table. This doesn't imply that every property is present on every row, however.
Implemented in fairport::basic_table< T >, and fairport::empty_table.
Get the type of a property.
Implemented in fairport::basic_table< T >, and fairport::empty_table.
Get the row id of a specified row.
On disk, the first DWORD is always the row_id.
Implemented in fairport::basic_table< T >, and fairport::empty_table.
Find the offset into the table of the given row_id.
key_not_found<row_id> | If the given row_id is not present in this table |
[in] | id | The row id to lookup |
Implemented in fairport::basic_table< T >, and fairport::empty_table.
virtual hnid_stream_device fairport::table_impl::open_cell_stream | ( | ulong | row, |
prop_id | id | ||
) | [pure virtual] |
Open a stream over a property in a given row.
key_not_found<prop_id> | If the specified property does not exist on the specified row |
out_of_range | If the specified row offset is beyond the size of this table |
[in] | row | The offset into the table |
[in] | id | The prop_id to find the cell value of |
Implemented in fairport::basic_table< T >, and fairport::empty_table.
const_table_row fairport::table_impl::operator[] | ( | ulong | row | ) | const [inline] |
Check to see if a property exists for a given row.
[in] | row | The offset into the table |
[in] | id | The prop_id |
Implemented in fairport::basic_table< T >, and fairport::empty_table.
virtual std::vector<byte> fairport::table_impl::read_cell | ( | ulong | row, |
prop_id | id | ||
) | const [pure virtual] |
Get the contents of a indirect property in the specified row.
key_not_found<prop_id> | If the specified property does not exist on the specified row |
out_of_range | If the specified row offset is beyond the size of this table |
[in] | row | The offset into the table |
[in] | id | The prop_id to find the cell value of |
Implemented in fairport::basic_table< T >, and fairport::empty_table.
Return the size of a property for a given row.
[in] | row | The offset into the table |
[in] | id | The prop_id |
Implemented in fairport::basic_table< T >, and fairport::empty_table.
virtual size_t fairport::table_impl::size | ( | ) | const [pure virtual] |
Get the number of rows in this table.
Implemented in fairport::basic_table< T >, and fairport::empty_table.