00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00028 #ifndef _BOXES_DELTA_H_
00029 #define _BOXES_DELTA_H_
00030
00031 #include <api_delta.h>
00032 #include <table_delta.h>
00033
00034 namespace coco {
00035
00037
00044 class boxes_delta : public table_delta
00045 {
00046 private:
00048 typedef table_delta _Base;
00049
00050 public:
00053 boxes_delta(bool _add=true) : _Base(_add ? "add box" : "exclusion box") {}
00054
00067 boxes_delta(const dbt_row& _b, bool _add=true) :
00068 _Base(std::string(_add ? "add box" : "exclusion box"),
00069 std::string("box"), _b) {}
00070
00084 boxes_delta(const std::vector<dbt_row>& _b, bool _add=true) :
00085 _Base(std::string(_add ? "add box" : "exclusion box"),
00086 std::string("box"), _b) {}
00087
00089 boxes_delta(const boxes_delta& __d) : _Base(__d) {}
00090
00092 boxes_delta* new_copy() const { return new boxes_delta(*this); }
00093
00095 void destroy_copy(delta_base* __d) const { delete (boxes_delta*)__d; }
00096
00100 void create_table(work_node& _x, vdbl::standard_table *&ptb,
00101 const std::string& __t) const;
00102
00106 bool apply(work_node& _x, undelta_base*& _u, const delta_id& _did) const;
00107
00109 bool operator==(const delta_base& _c) const
00110 { return _c.get_action() == get_action() &&
00111 this->operator==(*(boxes_delta*)&_c); }
00112 bool operator!=(const delta_base& _c) const
00113 { return _c.get_action() != get_action() ||
00114 this->operator!=(*(boxes_delta*)&_c); }
00115
00117 bool operator==(const boxes_delta& _c) const
00118 { return ((_Base*)this)->operator==(*(_Base*)&_c); }
00119 bool operator!=(const boxes_delta& _c) const
00120 { return ((_Base*)this)->operator!=(*(_Base*)&_c); }
00121 };
00122
00123 }
00124
00125 #endif