diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-12-15 11:09:41 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-12-15 11:09:41 +0000 |
commit | 9d1004206324867a4287e99b9675d24e536fa090 (patch) | |
tree | 89d59383f294627917ee3cf054f347884a914f32 /ACE/ace/Functor_T.h | |
parent | b8d69007a4e25977f11cc3de8eb3793c0c61161a (diff) | |
download | ATCD-9d1004206324867a4287e99b9675d24e536fa090.tar.gz |
Thu Dec 15 11:00:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
Merged timer_policy branch.
Diffstat (limited to 'ACE/ace/Functor_T.h')
-rw-r--r-- | ACE/ace/Functor_T.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ACE/ace/Functor_T.h b/ACE/ace/Functor_T.h index 53c06261acd..f8a215c078e 100644 --- a/ACE/ace/Functor_T.h +++ b/ACE/ace/Functor_T.h @@ -79,6 +79,38 @@ private: ACTION action_; }; +/** + * @class ACE_Member_Function_Command + * + * @brief Defines a class template that allows us to invoke a member + * function using the GoF command style callback. + * + */ +template <class RECEIVER> +class ACE_Member_Function_Command : public ACE_Command_Base +{ +public: + typedef void (RECEIVER::*PTMF)(void); + + /// Con Constructor: sets the <receiver_> of the Command to recvr, and the + /// <action_> of the Command to <action>. + ACE_Member_Function_Command (RECEIVER &recvr, PTMF ptmf); + + /// Virtual destructor. + virtual ~ACE_Member_Function_Command (void); + + /// Invokes the method <action_> from the object <receiver_>. The + /// parameter is ignored + virtual int execute (void *); + +private: + /// Object where the method resides. + RECEIVER &receiver_; + + /// Method that is going to be invoked. + PTMF ptmf_; +}; + ///////////////////////////////// // STL-style Functor Templates // ///////////////////////////////// |