1 /***************************************************************
3 * Purpose: Call_Back Functions
4 * Author: Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
6 * Copyright: Diego CACERES (http://www.creatis.insa-lyon.fr/~caceres/)
8 **************************************************************/
15 namespace creaButtonContainer
19 typedef std::string ButtonIDType;
20 // abstract base class
24 // two possible functions to call member function. virtual cause derived
25 // classes will use a pointer to an object and a pointer to a member function
26 // to make the function call
28 operator()( const ButtonIDType &buttonName )=0; // call using operator
30 Call( const ButtonIDType &buttonName )=0;
31 // call using function
34 // derived template class
35 template< typename TClass >
36 class TConcreteFunctor : public TFunctor
39 // constructor - takes pointer to an object and pointer to a member and stores
40 // them in two private variables
41 TConcreteFunctor( TClass* _pt2Object, void
42 (TClass::*_fpt)( const ButtonIDType &buttonName ) );
43 // override operator "()" // execute member function
45 operator()( const ButtonIDType &buttonName );
46 // override function "Call" // execute member function
48 Call( const ButtonIDType &buttonName );
51 (TClass::*fpt)( const ButtonIDType &buttonName );
52 // pointer to member function
60 #include "functor.txx"
62 #endif /* TFUNCTOR_H_ */