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 _PFSTAR_HOOK_H
00029 #define _PFSTAR_HOOK_H
00030
00031 #include <comp_hook.h>
00032 #include <pfstar.h>
00033
00034 namespace coco {
00035
00037
00043 class pfstar_hook : public wnc_hook_base
00044 {
00045 public:
00047 pfstar_hook()
00048 : wnc_hook_base("pfstar")
00049 {}
00050
00052 virtual ~pfstar_hook() {}
00053
00055 pfstar_hook* new_copy() const
00056 { return new pfstar_hook(*this); }
00057
00059 void operator()(const work_node& wn, dbt_row& dbr,
00060 std::list<delta>* add_ds = NULL,
00061 std::list<certificate>* add_cs = NULL) const {}
00062
00064 bool init_columns(vdbl::standard_table& stable)
00065 {
00066 bool ret(true);
00067
00068 vdbl::colid _l(stable.get_col_id("obj lowbound")),
00069 _w(stable.get_col_id("obj diameter"));
00070 if(_l == vdbl::colid() || _w == vdbl::colid())
00071 ret = false;
00072 else
00073 {
00074 ret = stable.add_col("pfstar", vdbl::method_col<calc_pf_star>(
00075 calc_pf_star(_l, _w)),
00076 vdbl::colflags(true));
00077 }
00078 return ret;
00079 }
00080
00082 bool drop_columns(vdbl::standard_table& stable)
00083 { return _drop_columns(stable); }
00084 };
00085
00086 }
00087
00088 #endif // _PFSTAR_HOOK_H