Show
Ignore:
Timestamp:
06/19/09 17:57:53 (15 years ago)
Author:
smidl
Message:

compilation fixes - UI_build use exceptions now!!!!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/user_info.h

    r390 r392  
    1111#include "itpp/itbase.h" 
    1212 
     13#include <stdexcept> 
    1314 
    1415using std::string; 
     
    2728namespace bdm 
    2829{ 
     30         
     31        //! exception used in UI::build if it fails it can be caught and handled - see merger_mex.h 
     32class UIbuildException : public std::invalid_argument { 
     33        public: 
     34                UIbuildException() : std::invalid_argument("class name") { } 
     35}; 
     36         
    2937class UI_File : public Config 
    3038{ 
     
    153161 
    154162                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(); 
    158167                } 
    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//               
    164173                try 
    165174                {