summaryrefslogtreecommitdiff
path: root/ace/Functor.h
blob: 6095dc187429b608855b237d66e289bf33c83066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    ace
//
// = FILENAME
//    Functor.h
//
// = DESCRIPTION
//    Non-templatized classes for implementing the GOF Command Pattern,
//    also known as functors or function objects.
//
// = AUTHOR
//    Chris Gill           <cdgill@cs.wustl.edu>
//
//    Based on Command Pattern implementations originally done by
//
//    Carlos O'Ryan        <coryan@cs.wustl.edu>  and
//    Douglas C. Schmidt   <schmidt@cs.wustl.edu> and
//    Sergio Flores-Gaitan <sergio@cs.wustl.edu>
//
// ============================================================================

#if !defined (ACE_FUNCTOR_H)
#define ACE_FUNCTOR_H

#include "ace/OS.h"

class ACE_Command_Base
{
  // = TITLE
  //    Defines an abstract class that allows us to invoke commands
  //    without knowing anything about the implementation.
  //
  // = DESCRIPTION
  //    This class declares an interface to execute a command
  //    independent of the effect of the command, or the objects used
  //    to implement it.
public:

  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.
};


#if defined (__ACE_INLINE__)
#include "ace/Functor.i"
#endif /* __ACE_INLINE__ */

// Include the templates here.
#include "ace/Functor_T.h"


#endif /* ACE_FUNCTOR_H */

// EOF