Changeset 392 for library/bdm/base/user_info.h
- Timestamp:
- 06/19/09 17:57:53 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/base/user_info.h
r390 r392 11 11 #include "itpp/itbase.h" 12 12 13 #include <stdexcept> 13 14 14 15 using std::string; … … 27 28 namespace bdm 28 29 { 30 31 //! exception used in UI::build if it fails it can be caught and handled - see merger_mex.h 32 class UIbuildException : public std::invalid_argument { 33 public: 34 UIbuildException() : std::invalid_argument("class name") { } 35 }; 36 29 37 class UI_File : public Config 30 38 { … … 153 161 154 162 instance = NULL; 155 try 156 { 157 instance = (T*) typeless_instance ; 163 //try catch does not work!!! 164 instance = dynamic_cast<T*>(typeless_instance); 165 if (!instance){ 166 throw UIbuildException(); 158 167 } 159 catch(...)160 {161 it_error ( "UI error: class " + class_name + " is not a descendant of the desired output class. Try to call the UI::build function with a different type parameter." );162 }163 168 // catch(...) 169 // { 170 // it_error ( "UI error: class " + class_name + " is not a descendant of the desired output class. Try to call the UI::build function with a different type parameter." ); 171 // } 172 // 164 173 try 165 174 {