- 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 ) )
- {
- pt2Object = _pt2Object;
- 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