Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Command_Callback Class Template Reference

Defines a class template that allows us to invoke a GOF command style callback to an object without knowing anything about the object except its type. More...

#include <Functor_T.h>

Inheritance diagram for ACE_Command_Callback:

Inheritance graph
[legend]
Collaboration diagram for ACE_Command_Callback:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Command_Callback (RECEIVER &recvr, ACTION action)
 Constructor: sets the <receiver_> of the Command to recvr, and the <action_> of the Command to <action>. More...

virtual ~ACE_Command_Callback (void)
 Virtual destructor. More...

virtual int execute (void *arg=0)
 Invokes the method <action_> from the object <receiver_>. More...


Private Attributes

RECEIVER & receiver_
 Object where the method resides. More...

ACTION action_
 Method that is going to be invoked. More...


Detailed Description

template<class RECEIVER, class ACTION>
class ACE_Command_Callback< RECEIVER, ACTION >

Defines a class template that allows us to invoke a GOF command style callback to an object without knowing anything about the object except its type.

This class declares an interface to execute operations, binding a RECEIVER object with an ACTION. The RECEIVER knows how to implement the operation. A class can invoke operations without knowing anything about it, or how it was implemented.

Definition at line 56 of file Functor_T.h.


Constructor & Destructor Documentation

template<class RECEIVER, class ACTION>
ACE_Command_Callback< RECEIVER, ACTION >::ACE_Command_Callback RECEIVER &    recvr,
ACTION    action
 

Constructor: sets the <receiver_> of the Command to recvr, and the <action_> of the Command to <action>.

Definition at line 28 of file Functor_T.cpp.

00030   : receiver_ (recvr),
00031     action_ (action)
00032 {
00033 }

template<class RECEIVER, class ACTION>
ACE_Command_Callback< RECEIVER, ACTION >::~ACE_Command_Callback void    [virtual]
 

Virtual destructor.

Definition at line 36 of file Functor_T.cpp.

00037 {
00038 }


Member Function Documentation

template<class RECEIVER, class ACTION>
int ACE_Command_Callback< RECEIVER, ACTION >::execute void *    arg = 0 [virtual]
 

Invokes the method <action_> from the object <receiver_>.

Implements ACE_Command_Base.

Definition at line 43 of file Functor_T.cpp.

References action_, and receiver_.

00044 {
00045   return (receiver_.*action_) (arg);
00046 }


Member Data Documentation

template<class RECEIVER, class ACTION>
ACTION ACE_Command_Callback::action_ [private]
 

Method that is going to be invoked.

Definition at line 74 of file Functor_T.h.

Referenced by execute.

template<class RECEIVER, class ACTION>
RECEIVER& ACE_Command_Callback::receiver_ [private]
 

Object where the method resides.

Definition at line 71 of file Functor_T.h.

Referenced by execute.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:46:38 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002