]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/functor.txx
DFCH: Manual paint changes!
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / model / functor.txx
index 42e660bfcc67e7f187db8c743eefc462f0e2a195..0fdf49640b20a8ed6c7df54fa6074ce076dbbfc1 100644 (file)
@@ -1,42 +1,56 @@
-/************************************************************************************//*!
- * Name:      @file functor.cxx
- * Purpose:   @brief implements TFunctor class and it propose is Call_Back Functions
- * Author:    @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
- * Modified:  2011-05-18
- * Copyright:
- * License:
- ***************************************************************************************/
+/*!
+ * @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-06-02
+*/
 
 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 ( const 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 ( const std::exception& e )
+           {
+                 std::cerr<< "TConcreteFunctor< TClass >::Call( const ButtonIDType &buttonName )"
+                                 <<" exception: " << e.what( ) << std::endl;
+           }//hctac
+         }
+  }//ecapseman
 }//ecapseman