00001 // Search Node logvolume computation hook implementation -*- C++ -*- 00002 00003 // $Id: logvol_hook.h 601 2008-04-29 23:18:57Z herman $ 00004 // Copyright (C) 2003 Hermann Schichl 00005 // 00006 // This file is part of the COCONUT API. This library 00007 // is free software; you can redistribute it and/or modify it under the 00008 // terms of the Library GNU General Public License as published by the 00009 // Free Software Foundation; either version 2, or (at your option) 00010 // any later version. 00011 00012 // This library is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // Library GNU General Public License for more details. 00016 00017 // As a special exception, you may use this file as part of a free software 00018 // library without restriction. Specifically, if other files instantiate 00019 // templates or use macros or inline functions from this file, or you compile 00020 // this file and link it with other files to produce an executable, this 00021 // file does not by itself cause the resulting executable to be covered by 00022 // the Library GNU General Public License. This exception does not however 00023 // invalidate any other reasons why the executable file might be covered by 00024 // the Library GNU General Public License. 00025 00028 #ifndef _LOGVOL_HOOK_H 00029 #define _LOGVOL_HOOK_H 00030 00031 #include <comp_hook.h> 00032 00033 namespace coco { 00034 00036 00042 class logvol_comp_hook : public wnc_hook_base 00043 { 00044 public: 00046 logvol_comp_hook() : wnc_hook_base("logvol") {} 00047 00049 virtual ~logvol_comp_hook() {} 00050 00052 logvol_comp_hook* new_copy() const { return new logvol_comp_hook(*this); } 00053 00056 void operator()(const work_node& wn, dbt_row& dbr, 00057 std::list<delta>* a=NULL, std::list<certificate>* b=NULL) const 00058 { 00059 dbr.add("logvol", wn.log_volume()); 00060 } 00061 00064 bool init_columns(vdbl::standard_table& stable) 00065 { return _init_column(stable, "logvol", COCO_INF); } 00066 00069 bool drop_columns(vdbl::standard_table& stable) 00070 { return _drop_columns(stable); } 00071 }; 00072 00073 } // namespace coco 00074 00075 #endif // _LOGVOL_HOOK_H