Reference

ACE_Command_Base(3)

Defines an abstract class that allows us to invoke commands without knowing anything about the implementation.

NAME

ACE_Command_Base - Defines an abstract class that allows us to invoke commands without knowing anything about the implementation.

SYNOPSIS

#include <ace/Functor.h>
class ACE_Command_Base
{
  public:
    ACE_Command_Base (void);
    virtual ~ACE_Command_Base (void);
    virtual int execute (void *arg = 0) = 0;
};

DESCRIPTION

Non-templatized classes and class template specializations for
implementing function objects that are used in various places
in ACE. There are currently two major categories of function
objects in ACE: GOF Command Pattern objects, and STL-style
functors for comparison of container elements. The command objects
are invoked via an execute () method, while the STL-style functors are
invoked via an operator() () method. Non-templatized classes for implementing the GOF Command Pattern, also known as functors or function objects.

Initialization and termination methods.

ACE_Command_Base (void);

Default constructor.

virtual ~ACE_Command_Base (void);

Virtaul destructor.

virtual int execute (void *arg = 0) = 0;

Invokes the method encapsulated by the command, passing along the passed argument (if any). Users of classes derived from this class must ensure that the resulting invocation can tolerate a null void pointer being passed, or otherwise ensure that this will never occur.

AUTHOR

Chris Gill [email protected]

Based on Command Pattern implementations originally done by

Carlos O'Ryan [email protected] and Douglas C. Schmidt [email protected] and Sergio Flores-Gaitan [email protected]

and on STL-style functor implementations originally done by

Irfan Pyarali [email protected]

LIBRARY

ace