Fairport  v1.0.38
fairport::table_impl Class Reference

Table implementation. More...

#include <table.h>

+ Inheritance diagram for fairport::table_impl:
+ Collaboration diagram for fairport::table_impl:

List of all members.

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 nodeget_node ()=0
 Get the node backing this table.
virtual const nodeget_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< byteread_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_idget_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.

Detailed Description

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.

See also:
[MS-PST] 2.3.4

Definition at line 136 of file table.h.


Constructor & Destructor Documentation

virtual fairport::table_impl::~table_impl ( ) [inline, virtual]

Definition at line 139 of file table.h.


Member Function Documentation

const_table_row_iter fairport::table_impl::begin ( ) const [inline]

Get an iterator pointing to the first row.

Returns:
The requested iterator

Definition at line 153 of file table.h.

const_table_row_iter fairport::table_impl::end ( ) const [inline]

Get an end iterator for this table.

Returns:
The requested iterator

Definition at line 157 of file table.h.

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.

Exceptions:
key_not_found<prop_id>If the specified property does not exist on the specified row
out_of_rangeIf the specified row offset is beyond the size of this table
Parameters:
[in]rowThe offset into the table
[in]idThe prop_id to find the cell value of
Returns:
The cell value

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.

Returns:
The node

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.

Returns:
The node

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.

Returns:
A vector all of the column prop_ids

Implemented in fairport::basic_table< T >, and fairport::empty_table.

virtual prop_type fairport::table_impl::get_prop_type ( prop_id  id) const [pure virtual]

Get the type of a property.

Returns:
The property type

Implemented in fairport::basic_table< T >, and fairport::empty_table.

virtual row_id fairport::table_impl::get_row_id ( ulong  row) const [pure virtual]

Get the row id of a specified row.

On disk, the first DWORD is always the row_id.

See also:
[MS-PST] 2.3.4.4.1/dwRowID
Returns:
The row id

Implemented in fairport::basic_table< T >, and fairport::empty_table.

virtual ulong fairport::table_impl::lookup_row ( row_id  id) const [pure virtual]

Find the offset into the table of the given row_id.

Exceptions:
key_not_found<row_id>If the given row_id is not present in this table
Parameters:
[in]idThe row id to lookup
Returns:
The offset into the table

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.

Exceptions:
key_not_found<prop_id>If the specified property does not exist on the specified row
out_of_rangeIf the specified row offset is beyond the size of this table
Note:
This operation is only valid for variable length properties
Parameters:
[in]rowThe offset into the table
[in]idThe prop_id to find the cell value of
Returns:
A device which can be used to construct a stream object

Implemented in fairport::basic_table< T >, and fairport::empty_table.

const_table_row fairport::table_impl::operator[] ( ulong  row) const [inline]

Get the requested table row.

Parameters:
[in]rowThe offset into the table to construct a row for
Returns:
The requested row

Definition at line 149 of file table.h.

virtual bool fairport::table_impl::prop_exists ( ulong  row,
prop_id  id 
) const [pure virtual]

Check to see if a property exists for a given row.

Parameters:
[in]rowThe offset into the table
[in]idThe prop_id
Returns:
true if the property exists

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.

Exceptions:
key_not_found<prop_id>If the specified property does not exist on the specified row
out_of_rangeIf the specified row offset is beyond the size of this table
Parameters:
[in]rowThe offset into the table
[in]idThe prop_id to find the cell value of
Returns:
The raw bytes of the property

Implemented in fairport::basic_table< T >, and fairport::empty_table.

virtual size_t fairport::table_impl::row_prop_size ( ulong  row,
prop_id  id 
) const [pure virtual]

Return the size of a property for a given row.

Note:
This operation is only valid for variable length properties
Parameters:
[in]rowThe offset into the table
[in]idThe prop_id
Returns:
The vector.size() if read_prop were called

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.

Returns:
The number of rows

Implemented in fairport::basic_table< T >, and fairport::empty_table.


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