]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/functor.txx
creaButtonContainer: new structure to make easy the button settings
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / model / functor.txx
index f4c812147cc05a948ec82ed12951c92be4409923..2c761358f1f489622e617ddfb68765097791eca5 100644 (file)
@@ -2,39 +2,55 @@
  * @file functor.cxx
  * @brief Implements TFunctor class and it propose is Call_Back Functions
  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * @date  2011-05-19
+ * @date  2011-05-24
 */
 
 namespace creaButtonContainer
 {
-       namespace model
-       {
-               // constructor - takes pointer to an object and pointer to a member and stores
-               // them in two private variables
-               // -------------------------------------------------------------------------------
-               template< typename TClass >
-                       TConcreteFunctor< TClass >::TConcreteFunctor( TClass* _pt2Object, void
-                       (TClass::*_fpt)( const ButtonIDType &buttonName ) )
-                       {
-                               this->pt2Object = _pt2Object;
-                               this->fpt = _fpt;
-                       }
-               // -------------------------------------------------------------------------------
-               // override operator "()" // execute member functions
-               template< typename TClass >
-                       void
-                       TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )
-                       {
-                               ( *pt2Object.*fpt )( buttonName );
-                       }
-               // -------------------------------------------------------------------------------
-               // override function "Call" // execute member function
-               template< typename TClass >
-                       void
-                       TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )
-                       {
-                               ( *pt2Object.*fpt )( buttonName );
-                       }
-       }//ecapseman
+  namespace model
+  {
+         // constructor - takes pointer to an object and pointer to a member and stores
+         // them in two private variables
+         // -------------------------------------------------------------------------------
+         template< typename TClass >
+         TConcreteFunctor< TClass >::TConcreteFunctor( TClass* _pt2Object, void
+         (TClass::*_fpt)( const ButtonIDType &buttonName ) )
+         {
+                 this->pt2Object = _pt2Object;
+                 this->fpt = _fpt;
+         }
+         // -------------------------------------------------------------------------------
+         // override operator "()" // execute member functions
+         template< typename TClass >
+         void
+         TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )
+         {
+           try
+           {
+                 ( *pt2Object.*fpt )( buttonName );
+           }//yrt
+           catch ( std::exception& e )
+           {
+                 std::cerr<< "TConcreteFunctor< TClass >::operator()( const ButtonIDType &buttonName )"
+                                 <<" exception: " << e.what( ) << std::endl;
+           }//hctac
+         }
+         // -------------------------------------------------------------------------------
+         // override function "Call" // execute member function
+         template< typename TClass >
+         void
+         TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )
+         {
+           try
+           {
+                 ( *pt2Object.*fpt )( buttonName );
+           }//yrt
+           catch ( std::exception& e )
+           {
+                 std::cerr<< "TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )"
+                                 <<" exception: " << e.what( ) << std::endl;
+           }//hctac
+         }
+  }//ecapseman
 }//ecapseman