#include <table_delta.h>
Public Types | |
typedef std::pair< std::string, dbt_row > | t_line |
typedef std::vector< t_line > | t_ctr |
Public Member Functions | |
table_delta (const std::string &a) | |
table_delta (const std::string &a, const t_ctr &_n, const std::vector< annotation > &_r) | |
table_delta (const table_delta &__d) | |
table_delta (const std::string &a, const std::string &__tn, const dbt_row &__t) | |
table_delta (const std::string &a, const std::string &__tn, const std::vector< dbt_row > &__t) | |
void | add (const t_line &_tl) |
void | add (const std::string &_tn, const dbt_row &_r) |
void | add (const std::vector< t_line > &_tlv) |
void | rm (const annotation &_tr) |
void | rm (const std::vector< annotation > &_trv) |
virtual table_delta * | new_copy () const |
virtual void | destroy_copy (delta_base *__d) const |
virtual void | create_table (work_node &_x, vdbl::standard_table *&ptb, const std::string &__t) const |
virtual bool | apply (work_node &_x, undelta_base *&_u, const delta_id &_did) const |
void | convert (work_node &_x, delta_base *&_u) |
bool | operator== (const delta_base &_c) const |
bool | operator!= (const delta_base &_c) const |
bool | operator== (const table_delta &_c) const |
bool | operator!= (const table_delta &_c) const |
delta | make_delta (const std::string &a) |
const std::string & | get_action () const |
virtual void | unkeep () |
virtual bool | apply3 (work_node &_x, const work_node &_y, undelta_base *&_u, const delta_id &_d) const |
Protected Attributes | |
std::string | _action |
table_undelta
class is needed.
Definition at line 43 of file table_delta.h.
typedef std::vector<t_line> coco::table_delta::t_ctr |
A variable of this type holds the new table entries.
Definition at line 49 of file table_delta.h.
typedef std::pair<std::string,dbt_row> coco::table_delta::t_line |
This type specifies one row in one table.
Definition at line 47 of file table_delta.h.
coco::table_delta::table_delta | ( | const std::string & | a | ) | [inline] |
Standard Constructor, which sets the action descriptor a
Definition at line 59 of file table_delta.h.
coco::table_delta::table_delta | ( | const std::string & | a, | |
const t_ctr & | _n, | |||
const std::vector< annotation > & | _r | |||
) | [inline] |
Full Constructor, setting the action descriptor to a
, the new table rows to _n
, and the annotations that have to be removed to _r
.
Definition at line 64 of file table_delta.h.
coco::table_delta::table_delta | ( | const table_delta & | __d | ) | [inline] |
Standard Copy Constructor
Definition at line 69 of file table_delta.h.
coco::table_delta::table_delta | ( | const std::string & | a, | |
const std::string & | __tn, | |||
const dbt_row & | __t | |||
) | [inline] |
Constructor, setting the action descriptor to a
, and adding one row __t
to the table __tn
.
Definition at line 79 of file table_delta.h.
coco::table_delta::table_delta | ( | const std::string & | a, | |
const std::string & | __tn, | |||
const std::vector< dbt_row > & | __t | |||
) | [inline] |
Constructor, setting the action descriptor to a
, and adding a list of rows __t
to the table __tn
.
Definition at line 85 of file table_delta.h.
void coco::table_delta::add | ( | const std::vector< t_line > & | _tlv | ) | [inline] |
This method adds a list of table rows.
Definition at line 100 of file table_delta.h.
void coco::table_delta::add | ( | const std::string & | _tn, | |
const dbt_row & | _r | |||
) | [inline] |
This method adds one row _r
to the table _tn
.
Definition at line 97 of file table_delta.h.
void coco::table_delta::add | ( | const t_line & | _tl | ) | [inline] |
This method adds one table row.
Definition at line 95 of file table_delta.h.
bool coco::table_delta::apply | ( | work_node & | _x, | |
undelta_base *& | _u, | |||
const delta_id & | _did | |||
) | const [virtual] |
Apply the delta with delta_id _d
to work node _x
. This will never be used, because the point_delta is converted to annotation_delta before the apply is performed.
Reimplemented from coco::delta_base.
Reimplemented in coco::boxes_delta, and coco::point_delta.
Definition at line 35 of file table_delta.cc.
bool coco::delta_base::apply3 | ( | work_node & | _x, | |
const work_node & | _y, | |||
undelta_base *& | _u, | |||
const delta_id & | _d | |||
) | const [inline, virtual, inherited] |
Apply the delta with delta_id _d
to work node _x
, constructing in the process work_node _y
, without changing _x
. In this process the undo information for this delta is stored in _u
. This method should be overloaded in the specializations of this class for maximal efficiency, but it need not since a standard procedure is available, which uses the work_node copy constructur and the apply
method.
Definition at line 88 of file api_delta.h.
void coco::table_delta::convert | ( | work_node & | _x, | |
delta_base *& | _u | |||
) | [virtual] |
This method converts the table delta to an annotation_delta after the information is stored in the search database. The conversion is based on work_node _x
, and the generated annotation_delta is returned via _u
.
Reimplemented from coco::delta_base.
Definition at line 42 of file table_delta.cc.
virtual void coco::table_delta::create_table | ( | work_node & | _x, | |
vdbl::standard_table *& | ptb, | |||
const std::string & | __t | |||
) | const [inline, virtual] |
This method creates the table
with name __t
in the search database for the work_node _x
. A pointer ptb
to the created table is set. This method must be overloaded by the subclasses.
Reimplemented in coco::boxes_delta, and coco::point_delta.
Definition at line 119 of file table_delta.h.
virtual void coco::table_delta::destroy_copy | ( | delta_base * | __d | ) | const [inline, virtual] |
Clone Destructor
Reimplemented in coco::boxes_delta, and coco::point_delta.
Definition at line 114 of file table_delta.h.
const std::string& coco::delta_base::get_action | ( | ) | const [inline, inherited] |
Retrieve the action information (the delta type) for this delta.
Definition at line 184 of file api_deltabase.h.
delta coco::delta_base::make_delta | ( | const std::string & | a | ) | [inline, inherited] |
Construct a delta from this delta_base with the action a
.
Definition at line 175 of file api_deltabase.h.
virtual table_delta* coco::table_delta::new_copy | ( | ) | const [inline, virtual] |
Clone Operation
Reimplemented from coco::delta_base.
Reimplemented in coco::boxes_delta, and coco::point_delta.
Definition at line 111 of file table_delta.h.
bool coco::table_delta::operator!= | ( | const table_delta & | _c | ) | const [inline] |
Definition at line 143 of file table_delta.h.
bool coco::table_delta::operator!= | ( | const delta_base & | _c | ) | const [inline] |
Reimplemented in coco::boxes_delta, and coco::point_delta.
Definition at line 137 of file table_delta.h.
bool coco::table_delta::operator== | ( | const table_delta & | _c | ) | const [inline] |
Comparison operators
Definition at line 142 of file table_delta.h.
bool coco::table_delta::operator== | ( | const delta_base & | _c | ) | const [inline] |
Comparison operators
Reimplemented in coco::boxes_delta, and coco::point_delta.
Definition at line 134 of file table_delta.h.
void coco::table_delta::rm | ( | const std::vector< annotation > & | _trv | ) | [inline] |
This method adds the annotations in _trv
to the list of removed annotations.
Definition at line 107 of file table_delta.h.
void coco::table_delta::rm | ( | const annotation & | _tr | ) | [inline] |
This method adds the annotation _tr
to the list of removed annotations.
Definition at line 104 of file table_delta.h.
virtual void coco::delta_base::unkeep | ( | ) | [inline, virtual, inherited] |
Perform this operation when the delta is released (unkept) from a work_node.
Reimplemented in coco::dag_delta.
Definition at line 194 of file api_deltabase.h.
std::string coco::delta_base::_action [protected, inherited] |
The action (type) of this delta
Definition at line 154 of file api_deltabase.h.