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
00029 #ifndef _MANAGEMENT_MODULE_H
00030 #define _MANAGEMENT_MODULE_H
00031
00032 #include <iostream>
00033 #include <coconut_config.h>
00034 #include <search_graph.h>
00035 #include <gptr.h>
00036 #include <string>
00037 #include <dbtools.h>
00038 #include <viewdbase>
00039 #include <control_data.h>
00040 #include <api_exception.h>
00041
00042 using namespace vgtl;
00043
00044 namespace coco {
00045
00047
00053 class management_module_exception : public api_exception
00054 {
00055 public:
00057 management_module_exception(const std::string& msg) :
00058 api_exception(apiee_management_module, msg) {}
00060 management_module_exception(const char* msg) :
00061 api_exception(apiee_management_module, msg) {}
00062
00064 virtual ~management_module_exception() throw() {}
00065 };
00066
00068
00073 class management_module
00074 {
00075 protected:
00077 std::string __name;
00079 gptr<work_node>* __wnode;
00081 search_focus* __sfocus;
00083 const search_inspector* __sinsp;
00085 gptr<vdbl::database>* __dbase;
00087 gptr<search_graph>* __sgraph;
00088
00089 public:
00094 management_module(const std::string& __n,
00095 gptr<work_node>& wnode,
00096 search_focus& sfoc,
00097 const search_inspector* sinsp,
00098 gptr<search_graph>& sgraph,
00099 gptr<vdbl::database>& dbase)
00100 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(sinsp),
00101 __dbase(&dbase), __sgraph(&sgraph)
00102 {}
00103
00108 management_module(const std::string& __n,
00109 gptr<work_node>& wnode,
00110 search_focus& sfoc,
00111 const search_inspector* sinsp,
00112 gptr<search_graph>& sgraph)
00113 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(sinsp),
00114 __dbase(NULL), __sgraph(&sgraph)
00115 {}
00116
00121 management_module(const std::string& __n,
00122 gptr<work_node>& wnode,
00123 search_focus& sfoc,
00124 const search_inspector* sinsp,
00125 gptr<vdbl::database>& dbase)
00126 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(sinsp),
00127 __dbase(&dbase), __sgraph(NULL)
00128 {}
00129
00134 management_module(const std::string& __n,
00135 gptr<work_node>& wnode,
00136 const search_inspector* sinsp,
00137 gptr<search_graph>& sgraph,
00138 gptr<vdbl::database>& dbase)
00139 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(sinsp),
00140 __dbase(&dbase), __sgraph(&sgraph)
00141 {}
00142
00147 management_module(const std::string& __n,
00148 search_focus& sfoc,
00149 const search_inspector* sinsp,
00150 gptr<search_graph>& sgraph,
00151 gptr<vdbl::database>& dbase)
00152 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(sinsp),
00153 __dbase(&dbase), __sgraph(&sgraph)
00154 {}
00155
00160 management_module(const std::string& __n,
00161 gptr<work_node>& wnode,
00162 search_focus& sfoc,
00163 const search_inspector* sinsp)
00164 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(sinsp),
00165 __dbase(NULL), __sgraph(NULL)
00166 {}
00167
00172 management_module(const std::string& __n,
00173 gptr<work_node>& wnode,
00174 const search_inspector* sinsp,
00175 gptr<vdbl::database>& dbase)
00176 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(sinsp),
00177 __dbase(&dbase), __sgraph(NULL)
00178 {}
00179
00184 management_module(const std::string& __n,
00185 gptr<work_node>& wnode,
00186 const search_inspector* sinsp,
00187 gptr<search_graph>& sgraph)
00188 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(sinsp),
00189 __dbase(NULL), __sgraph(&sgraph)
00190 {}
00191
00196 management_module(const std::string& __n,
00197 search_focus& sfoc,
00198 const search_inspector* sinsp,
00199 gptr<search_graph>& sgraph)
00200 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(sinsp),
00201 __dbase(NULL), __sgraph(&sgraph)
00202 {}
00203
00208 management_module(const std::string& __n,
00209 search_focus& sfoc,
00210 const search_inspector* sinsp,
00211 gptr<vdbl::database>& dbase)
00212 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(sinsp),
00213 __dbase(&dbase), __sgraph(NULL)
00214 {}
00215
00220 management_module(const std::string& __n,
00221 const search_inspector* sinsp,
00222 gptr<search_graph>& sgraph,
00223 gptr<vdbl::database>& dbase)
00224 : __name(__n), __wnode(NULL), __sfocus(NULL), __sinsp(sinsp),
00225 __dbase(&dbase), __sgraph(&sgraph)
00226 {}
00227
00231 management_module(const std::string& __n, gptr<work_node>& wnode,
00232 const search_inspector* sinsp)
00233 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(sinsp),
00234 __dbase(NULL), __sgraph(NULL)
00235 {}
00236
00240 management_module(const std::string& __n, search_focus& sfoc,
00241 const search_inspector* sinsp)
00242 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(sinsp),
00243 __dbase(NULL), __sgraph(NULL)
00244 {}
00245
00249 management_module(const std::string& __n, const search_inspector* sinsp,
00250 gptr<search_graph>& sgraph)
00251 : __name(__n), __wnode(NULL), __sfocus(NULL), __sinsp(sinsp),
00252 __dbase(NULL), __sgraph(&sgraph)
00253 {}
00254
00258 management_module(const std::string& __n, const search_inspector* sinsp,
00259 gptr<vdbl::database>& dbase)
00260 : __name(__n), __wnode(NULL), __sfocus(NULL), __sinsp(sinsp),
00261 __dbase(&dbase), __sgraph(NULL)
00262 {}
00263
00268 management_module(const std::string& __n,
00269 gptr<work_node>& wnode,
00270 search_focus& sfoc,
00271 gptr<search_graph>& sgraph,
00272 gptr<vdbl::database>& dbase)
00273 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(NULL),
00274 __dbase(&dbase), __sgraph(&sgraph)
00275 {}
00276
00281 management_module(const std::string& __n,
00282 gptr<work_node>& wnode,
00283 search_focus& sfoc,
00284 gptr<search_graph>& sgraph)
00285 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(NULL),
00286 __dbase(NULL), __sgraph(&sgraph)
00287 {}
00288
00293 management_module(const std::string& __n,
00294 gptr<work_node>& wnode,
00295 search_focus& sfoc,
00296 gptr<vdbl::database>& dbase)
00297 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(NULL),
00298 __dbase(&dbase), __sgraph(NULL)
00299 {}
00300
00305 management_module(const std::string& __n,
00306 gptr<work_node>& wnode,
00307 gptr<search_graph>& sgraph,
00308 gptr<vdbl::database>& dbase)
00309 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(NULL),
00310 __dbase(&dbase), __sgraph(&sgraph)
00311 {}
00312
00317 management_module(const std::string& __n,
00318 search_focus& sfoc,
00319 gptr<search_graph>& sgraph,
00320 gptr<vdbl::database>& dbase)
00321 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(NULL),
00322 __dbase(&dbase), __sgraph(&sgraph)
00323 {}
00324
00328 management_module(const std::string& __n,
00329 gptr<work_node>& wnode,
00330 search_focus& sfoc)
00331 : __name(__n), __wnode(&wnode), __sfocus(&sfoc), __sinsp(NULL),
00332 __dbase(NULL), __sgraph(NULL)
00333 {}
00334
00338 management_module(const std::string& __n,
00339 gptr<work_node>& wnode,
00340 gptr<vdbl::database>& dbase)
00341 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(NULL),
00342 __dbase(&dbase), __sgraph(NULL)
00343 {}
00344
00348 management_module(const std::string& __n,
00349 gptr<work_node>& wnode,
00350 gptr<search_graph>& sgraph)
00351 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(NULL),
00352 __dbase(NULL), __sgraph(&sgraph)
00353 {}
00354
00358 management_module(const std::string& __n,
00359 search_focus& sfoc,
00360 gptr<search_graph>& sgraph)
00361 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(NULL),
00362 __dbase(NULL), __sgraph(&sgraph)
00363 {}
00364
00368 management_module(const std::string& __n,
00369 search_focus& sfoc,
00370 gptr<vdbl::database>& dbase)
00371 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(NULL),
00372 __dbase(&dbase), __sgraph(NULL)
00373 {}
00374
00378 management_module(const std::string& __n,
00379 gptr<search_graph>& sgraph,
00380 gptr<vdbl::database>& dbase)
00381 : __name(__n), __wnode(NULL), __sfocus(NULL), __sinsp(NULL),
00382 __dbase(&dbase), __sgraph(&sgraph)
00383 {}
00384
00388 management_module(const std::string& __n, gptr<work_node>& wnode)
00389 : __name(__n), __wnode(&wnode), __sfocus(NULL), __sinsp(NULL),
00390 __dbase(NULL), __sgraph(NULL)
00391 {}
00392
00396 management_module(const std::string& __n, search_focus& sfoc)
00397 : __name(__n), __wnode(NULL), __sfocus(&sfoc), __sinsp(NULL),
00398 __dbase(NULL), __sgraph(NULL)
00399 {}
00400
00404 management_module(const std::string& __n, const search_inspector* sinsp)
00405 : __name(__n), __wnode(NULL), __sfocus(NULL), __sinsp(sinsp),
00406 __dbase(NULL), __sgraph(NULL)
00407 {}
00408
00412 management_module(const std::string& __n, gptr<search_graph>& sgraph)
00413 : __name(__n), __wnode(NULL), __sfocus(NULL), __sinsp(NULL),
00414 __dbase(NULL), __sgraph(&sgraph)
00415 {}
00416
00420 management_module(const std::string& __n, gptr<vdbl::database>& dbase)
00421 : __name(__n), __wnode(NULL), __sfocus(NULL), __sinsp(NULL),
00422 __dbase(&dbase), __sgraph(NULL)
00423 {}
00424
00426 virtual ~management_module() {}
00427
00429 const model* get_model() const
00430 { return (*__wnode)->get_model(); }
00431
00434 const std::string& get_name() const { return __name; }
00435
00441 virtual int manage(const control_data& _c)
00442 { std::cerr << "called the virtual manage function" << std::endl;
00443 return 0;
00444 }
00445 };
00446
00447 }
00448
00449 #endif