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 _REPORT_MODULE_H
00030 #define _REPORT_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 <ie_rettype.h>
00041 #include <api_exception.h>
00042
00043 using namespace vgtl;
00044
00045 namespace coco {
00046
00048
00054 class report_module_exception : public api_exception
00055 {
00056 public:
00058 report_module_exception(const std::string& msg) :
00059 api_exception(apiee_report_module, msg) {}
00061 report_module_exception(const char* msg) :
00062 api_exception(apiee_report_module, msg) {}
00063
00065 virtual ~report_module_exception() throw() {}
00066 };
00067
00069
00074 class report_module
00075 {
00076 protected:
00078 std::string __name;
00080 const gptr<work_node>* __wnode;
00082 const gptr<search_graph>* __sgraph;
00084 search_inspector* __sgroot;
00086 const gptr<vdbl::database>* __dbase;
00089 const work_node_context* __wnc;
00091 const vdbl::viewdbase* __vdb;
00093 const ie_return_type* __ier;
00094
00095 public:
00102 report_module(const std::string& __n,
00103 const gptr<work_node>& wnode,
00104 const gptr<search_graph>& sgraph,
00105 const search_inspector& si,
00106 const gptr<vdbl::database>& dbase,
00107 const ie_return_type& _ir)
00108 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00109 __sgroot(new search_inspector(si)),
00110 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00111 __vdb(&(*wnode).get_viewdbase()),
00112 __ier(&_ir)
00113 {}
00114
00121 report_module(const std::string& __n,
00122 const gptr<work_node>& wnode, const gptr<search_graph>& sgraph,
00123 const search_inspector& si,
00124 const gptr<vdbl::database>& dbase,
00125 const ie_return_type& _ir, bool norestrict)
00126 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00127 __sgroot(new search_inspector(si)),
00128 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00129 __vdb(&(*wnode).get_fullviewdbase()),
00130 __ier(&_ir)
00131 {}
00132
00138 report_module(const std::string& __n,
00139 const gptr<work_node>& wnode, const search_inspector& si,
00140 const gptr<vdbl::database>& dbase,
00141 const ie_return_type& _ir)
00142 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00143 __sgroot(new search_inspector(si)),
00144 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00145 __vdb(&(*wnode).get_viewdbase()),
00146 __ier(&_ir)
00147 {}
00148
00155 report_module(const std::string& __n,
00156 const gptr<work_node>& wnode, const search_inspector& si,
00157 const gptr<vdbl::database>& dbase,
00158 const ie_return_type& _ir, bool norestrict)
00159 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00160 __sgroot(new search_inspector(si)),
00161 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00162 __vdb(&(*wnode).get_fullviewdbase()),
00163 __ier(&_ir)
00164 {}
00165
00170 report_module(const std::string& __n, const gptr<search_graph>& sgraph,
00171 const search_inspector& si,
00172 const gptr<vdbl::database>& dbase,
00173 const ie_return_type& _ir)
00174 : __name(__n), __wnode(NULL), __sgraph(&sgraph),
00175 __sgroot(new search_inspector(si)),
00176 __dbase(&dbase), __wnc(NULL), __vdb(NULL),
00177 __ier(&_ir)
00178 {}
00179
00185 report_module(const std::string& __n, const gptr<work_node>& wnode,
00186 const gptr<search_graph>& sgraph,
00187 const gptr<vdbl::database>& dbase,
00188 const ie_return_type& _ir)
00189 : __name(__n), __wnode(&wnode), __sgraph(&sgraph), __sgroot(NULL),
00190 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00191 __vdb(&(*wnode).get_viewdbase()),
00192 __ier(&_ir)
00193 {}
00194
00201 report_module(const std::string& __n, const gptr<work_node>& wnode,
00202 const gptr<search_graph>& sgraph,
00203 const gptr<vdbl::database>& dbase,
00204 const ie_return_type& _ir, bool norestrict)
00205 : __name(__n), __wnode(&wnode), __sgraph(&sgraph), __sgroot(NULL),
00206 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00207 __vdb(&(*wnode).get_fullviewdbase()),
00208 __ier(&_ir)
00209 {}
00210
00216 report_module(const std::string& __n, const gptr<work_node>& wnode,
00217 const gptr<search_graph>& sgraph,
00218 const search_inspector& si, const ie_return_type& _ir)
00219 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00220 __sgroot(new search_inspector(si)),
00221 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00222 __vdb(&(*wnode).get_viewdbase()),
00223 __ier(&_ir)
00224 {}
00225
00232 report_module(const std::string& __n, const gptr<work_node>& wnode,
00233 const gptr<search_graph>& sgraph,
00234 const search_inspector& si, const ie_return_type& _ir,
00235 bool norestrict)
00236 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00237 __sgroot(new search_inspector(si)),
00238 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00239 __vdb(&(*wnode).get_fullviewdbase()),
00240 __ier(&_ir)
00241 {}
00242
00248 report_module(const std::string& __n, const gptr<work_node>& wnode,
00249 const gptr<search_graph>& sgraph,
00250 const search_inspector& si, const gptr<vdbl::database>& dbase)
00251 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00252 __sgroot(new search_inspector(si)),
00253 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00254 __vdb(&(*wnode).get_viewdbase()),
00255 __ier(NULL)
00256 {}
00257
00264 report_module(const std::string& __n, const gptr<work_node>& wnode,
00265 const gptr<search_graph>& sgraph,
00266 const search_inspector& si, const gptr<vdbl::database>& dbase,
00267 bool norestrict)
00268 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00269 __sgroot(new search_inspector(si)),
00270 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00271 __vdb(&(*wnode).get_fullviewdbase()),
00272 __ier(NULL)
00273 {}
00274
00278 report_module(const std::string& __n, const gptr<search_graph>& sgraph,
00279 const gptr<vdbl::database>& dbase,
00280 const ie_return_type& _ir)
00281 : __name(__n), __wnode(NULL), __sgraph(&sgraph), __sgroot(NULL),
00282 __dbase(&dbase), __wnc(NULL), __vdb(NULL),
00283 __ier(&_ir)
00284 {}
00285
00289 report_module(const std::string& __n, const gptr<search_graph>& sgraph,
00290 const search_inspector& si, const ie_return_type& _ir)
00291 : __name(__n), __wnode(NULL), __sgraph(&sgraph),
00292 __sgroot(new search_inspector(si)),
00293 __dbase(NULL), __wnc(NULL), __vdb(NULL), __ier(&_ir)
00294 {}
00295
00299 report_module(const std::string& __n, const gptr<search_graph>& sgraph,
00300 const search_inspector& si, const gptr<vdbl::database>& dbase)
00301 : __name(__n), __wnode(NULL), __sgraph(&sgraph),
00302 __sgroot(new search_inspector(si)),
00303 __dbase(&dbase), __wnc(NULL), __vdb(NULL), __ier(NULL)
00304 {}
00305
00311 report_module(const std::string& __n, const gptr<work_node>& wnode,
00312 const gptr<search_graph>& sgraph, const ie_return_type& _ir)
00313 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00314 __sgroot(NULL), __dbase(NULL),
00315 __wnc((*wnode).get_work_node_context()),
00316 __vdb(&(*wnode).get_viewdbase()),
00317 __ier(&_ir)
00318 {}
00319
00326 report_module(const std::string& __n, const gptr<work_node>& wnode,
00327 const gptr<search_graph>& sgraph,
00328 const ie_return_type& _ir, bool norestrict)
00329 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00330 __sgroot(NULL), __dbase(NULL),
00331 __wnc((*wnode).get_work_node_context()),
00332 __vdb(&(*wnode).get_fullviewdbase()),
00333 __ier(&_ir)
00334 {}
00335
00341 report_module(const std::string& __n, const gptr<work_node>& wnode,
00342 const gptr<search_graph>& sgraph,
00343 const gptr<vdbl::database>& dbase)
00344 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00345 __sgroot(NULL), __dbase(&dbase),
00346 __wnc((*wnode).get_work_node_context()),
00347 __vdb(&(*wnode).get_viewdbase()),
00348 __ier(NULL)
00349 {}
00350
00357 report_module(const std::string& __n, const gptr<work_node>& wnode,
00358 const gptr<search_graph>& sgraph,
00359 const gptr<vdbl::database>& dbase, bool norestrict)
00360 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00361 __sgroot(NULL), __dbase(&dbase),
00362 __wnc((*wnode).get_work_node_context()),
00363 __vdb(&(*wnode).get_fullviewdbase()),
00364 __ier(NULL)
00365 {}
00366
00372 report_module(const std::string& __n, const gptr<work_node>& wnode,
00373 const gptr<search_graph>& sgraph,
00374 const search_inspector& si)
00375 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00376 __sgroot(new search_inspector(si)),
00377 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00378 __vdb(&(*wnode).get_viewdbase()),
00379 __ier(NULL)
00380 {}
00381
00388 report_module(const std::string& __n, const gptr<work_node>& wnode,
00389 const gptr<search_graph>& sgraph,
00390 const search_inspector& si, bool norestrict)
00391 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00392 __sgroot(new search_inspector(si)),
00393 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00394 __vdb(&(*wnode).get_fullviewdbase()),
00395 __ier(NULL)
00396 {}
00397
00401 report_module(const std::string& __n, const gptr<search_graph>& sgraph,
00402 const ie_return_type& _ir)
00403 : __name(__n), __wnode(NULL), __sgraph(&sgraph), __sgroot(NULL),
00404 __dbase(NULL), __wnc(NULL), __vdb(NULL), __ier(&_ir)
00405 {}
00406
00410 report_module(const std::string& __n, const gptr<search_graph>& sgraph,
00411 const gptr<vdbl::database>& dbase)
00412 : __name(__n), __wnode(NULL), __sgraph(&sgraph), __sgroot(NULL),
00413 __dbase(&dbase), __wnc(NULL), __vdb(NULL), __ier(NULL)
00414 {}
00415
00419 report_module(const std::string& __n, const gptr<search_graph>& sgraph,
00420 const search_inspector& si)
00421 : __name(__n), __wnode(NULL), __sgraph(&sgraph),
00422 __sgroot(new search_inspector(si)),
00423 __dbase(NULL), __wnc(NULL), __vdb(NULL), __ier(NULL)
00424 {}
00425
00430 report_module(const std::string& __n, const gptr<work_node>& wnode,
00431 const gptr<search_graph>& sgraph)
00432 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00433 __sgroot(NULL), __dbase(NULL),
00434 __wnc((*wnode).get_work_node_context()),
00435 __vdb(&(*wnode).get_viewdbase()),
00436 __ier(NULL)
00437 {}
00438
00444 report_module(const std::string& __n, const gptr<work_node>& wnode,
00445 const gptr<search_graph>& sgraph, bool norestrict)
00446 : __name(__n), __wnode(&wnode), __sgraph(&sgraph),
00447 __sgroot(NULL), __dbase(NULL),
00448 __wnc((*wnode).get_work_node_context()),
00449 __vdb(&(*wnode).get_fullviewdbase()),
00450 __ier(NULL)
00451 {}
00452
00457 report_module(const std::string& __n, const search_inspector& si,
00458 const gptr<vdbl::database>& dbase,
00459 const ie_return_type& _ir)
00460 : __name(__n), __wnode(NULL), __sgraph(NULL),
00461 __sgroot(new search_inspector(si)),
00462 __dbase(&dbase), __wnc(NULL), __vdb(NULL),
00463 __ier(&_ir)
00464 {}
00465
00471 report_module(const std::string& __n, const gptr<work_node>& wnode,
00472 const gptr<vdbl::database>& dbase,
00473 const ie_return_type& _ir)
00474 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00475 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00476 __vdb(&(*wnode).get_viewdbase()),
00477 __ier(&_ir)
00478 {}
00479
00486 report_module(const std::string& __n, const gptr<work_node>& wnode,
00487 const gptr<vdbl::database>& dbase,
00488 const ie_return_type& _ir, bool norestrict)
00489 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00490 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00491 __vdb(&(*wnode).get_fullviewdbase()),
00492 __ier(&_ir)
00493 {}
00494
00500 report_module(const std::string& __n, const gptr<work_node>& wnode,
00501 const search_inspector& si, const ie_return_type& _ir)
00502 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00503 __sgroot(new search_inspector(si)),
00504 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00505 __vdb(&(*wnode).get_viewdbase()),
00506 __ier(&_ir)
00507 {}
00508
00515 report_module(const std::string& __n, const gptr<work_node>& wnode,
00516 const search_inspector& si, const ie_return_type& _ir,
00517 bool norestrict)
00518 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00519 __sgroot(new search_inspector(si)),
00520 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00521 __vdb(&(*wnode).get_fullviewdbase()),
00522 __ier(&_ir)
00523 {}
00524
00530 report_module(const std::string& __n, const gptr<work_node>& wnode,
00531 const search_inspector& si, const gptr<vdbl::database>& dbase)
00532 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00533 __sgroot(new search_inspector(si)),
00534 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00535 __vdb(&(*wnode).get_viewdbase()),
00536 __ier(NULL)
00537 {}
00538
00545 report_module(const std::string& __n, const gptr<work_node>& wnode,
00546 const search_inspector& si, const gptr<vdbl::database>& dbase,
00547 bool norestrict)
00548 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00549 __sgroot(new search_inspector(si)),
00550 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00551 __vdb(&(*wnode).get_fullviewdbase()),
00552 __ier(NULL)
00553 {}
00554
00558 report_module(const std::string& __n, const gptr<vdbl::database>& dbase,
00559 const ie_return_type& _ir)
00560 : __name(__n), __wnode(NULL), __sgraph(NULL), __sgroot(NULL),
00561 __dbase(&dbase), __wnc(NULL), __vdb(NULL),
00562 __ier(&_ir)
00563 {}
00564
00568 report_module(const std::string& __n, const search_inspector& si,
00569 const ie_return_type& _ir)
00570 : __name(__n), __wnode(NULL), __sgraph(NULL),
00571 __sgroot(new search_inspector(si)),
00572 __dbase(NULL), __wnc(NULL), __vdb(NULL), __ier(&_ir)
00573 {}
00574
00578 report_module(const std::string& __n, const search_inspector& si,
00579 const gptr<vdbl::database>& dbase)
00580 : __name(__n), __wnode(NULL), __sgraph(NULL),
00581 __sgroot(new search_inspector(si)),
00582 __dbase(&dbase), __wnc(NULL), __vdb(NULL), __ier(NULL)
00583 {}
00584
00590 report_module(const std::string& __n, const gptr<work_node>& wnode,
00591 const ie_return_type& _ir)
00592 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00593 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00594 __vdb(&(*wnode).get_viewdbase()),
00595 __ier(&_ir)
00596 {}
00597
00604 report_module(const std::string& __n, const gptr<work_node>& wnode,
00605 const ie_return_type& _ir, bool norestrict)
00606 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00607 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00608 __vdb(&(*wnode).get_fullviewdbase()),
00609 __ier(&_ir)
00610 {}
00611
00617 report_module(const std::string& __n, const gptr<work_node>& wnode,
00618 const gptr<vdbl::database>& dbase)
00619 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00620 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00621 __vdb(&(*wnode).get_viewdbase()),
00622 __ier(NULL)
00623 {}
00624
00631 report_module(const std::string& __n, const gptr<work_node>& wnode,
00632 const gptr<vdbl::database>& dbase, bool norestrict)
00633 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00634 __dbase(&dbase), __wnc((*wnode).get_work_node_context()),
00635 __vdb(&(*wnode).get_fullviewdbase()),
00636 __ier(NULL)
00637 {}
00638
00644 report_module(const std::string& __n, const gptr<work_node>& wnode,
00645 const search_inspector& si)
00646 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00647 __sgroot(new search_inspector(si)),
00648 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00649 __vdb(&(*wnode).get_viewdbase()),
00650 __ier(NULL)
00651 {}
00652
00659 report_module(const std::string& __n, const gptr<work_node>& wnode,
00660 const search_inspector& si, bool norestrict)
00661 : __name(__n), __wnode(&wnode), __sgraph(NULL),
00662 __sgroot(new search_inspector(si)),
00663 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00664 __vdb(&(*wnode).get_fullviewdbase()),
00665 __ier(NULL)
00666 {}
00667
00671 report_module(const std::string& __n, const ie_return_type& _ir)
00672 : __name(__n), __wnode(NULL), __sgraph(NULL), __sgroot(NULL),
00673 __dbase(NULL), __wnc(NULL), __vdb(NULL), __ier(&_ir)
00674 {}
00675
00679 report_module(const std::string& __n, const gptr<vdbl::database>& dbase)
00680 : __name(__n), __wnode(NULL), __sgraph(NULL), __sgroot(NULL),
00681 __dbase(&dbase), __wnc(NULL), __vdb(NULL), __ier(NULL)
00682 {}
00683
00687 report_module(const std::string& __n, const search_inspector& si)
00688 : __name(__n), __wnode(NULL), __sgraph(NULL),
00689 __sgroot(new search_inspector(si)),
00690 __dbase(NULL), __wnc(NULL), __vdb(NULL), __ier(NULL)
00691 {}
00692
00697 report_module(const std::string& __n, const gptr<work_node>& wnode)
00698 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00699 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00700 __vdb(&(*wnode).get_viewdbase()),
00701 __ier(NULL)
00702 {}
00703
00709 report_module(const std::string& __n, const gptr<work_node>& wnode,
00710 bool norestrict)
00711 : __name(__n), __wnode(&wnode), __sgraph(NULL), __sgroot(NULL),
00712 __dbase(NULL), __wnc((*wnode).get_work_node_context()),
00713 __vdb(&(*wnode).get_fullviewdbase()),
00714 __ier(NULL)
00715 {}
00716
00718 virtual ~report_module()
00719 { if(__sgroot) delete __sgroot; }
00720
00722 const model* get_model() const
00723 { return (*__wnode)->get_model(); }
00724
00729 virtual void print(const control_data& __c, std::ostream& o = std::cout) const
00730 { std::cerr << "called the virtual print function" << std::endl; }
00731
00733 const std::string& get_name() const { return __name; }
00734 };
00735
00736 }
00737
00738 #endif