bdmroot.h
Go to the documentation of this file.00001 00014 #ifndef root_H 00015 #define root_H 00016 00017 #include <string> 00018 #include <bitset> 00019 00020 #include "itpp_ext.h" 00021 #include "bdmerror.h" 00022 00023 #ifdef MEX 00024 #include "base/libconfig/lib/libconfig.h++" 00025 // TODO DODELAT A NAHRADIT #include "base/libconfig_mex.h" 00026 #else 00027 #include "base/libconfig/lib/libconfig.h++" 00028 #endif 00029 00030 00031 using namespace libconfig; 00032 using namespace itpp; 00033 using namespace std; 00034 00035 namespace bdm { 00036 00038 void UI_DBG (const Setting &S, const string &spc, ostream &out ); 00039 00040 00042 class logger; 00043 00045 class root { 00046 private: 00048 friend class UI; 00049 00050 protected: 00051 00091 virtual void from_setting ( const Setting &set ) { 00092 } 00093 00127 virtual void to_setting ( Setting &set ) const { 00128 } 00129 00130 public: 00131 00133 root() {}; 00134 00136 virtual ~root() { 00137 } 00138 00140 virtual string to_string() const { 00141 Config C; 00142 Setting &set=C.getRoot(); 00143 this->to_setting(set); 00144 ostringstream os; 00145 UI_DBG(set, "", os); 00146 return os.str(); 00147 } 00149 virtual void log_register ( logger &L, const string &prefix ) { 00150 } 00151 00153 virtual void log_write() const { 00154 } 00155 00188 virtual void validate() { 00189 } 00190 00192 virtual root* _copy() const NOT_IMPLEMENTED(NULL); 00193 00194 }; 00195 00200 class log_level_base : public root { 00201 private: 00203 friend class logger; 00204 00205 protected: 00209 logger * registered_logger; 00210 00212 Vec<ivec> ids; 00213 00214 00216 log_level_base( ) { 00217 registered_logger = NULL; 00218 } 00219 }; 00220 //UIREGISTER IS FORBIDDEN FOR THIS CLASS, AS IT SHOULD BE LOADED ONLY THROUGH THE SPECIALIZED UI::GET(...) METHOD 00221 00222 }; //namespace 00223 #endif // root_H
Generated on 2 Dec 2013 for mixpp by 1.4.7