summaryrefslogtreecommitdiff
path: root/ACE/ace/Monitor_Control_Action.h
blob: aea10b43b46b6b0600128b33be3311e006532469 (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
// -*- C++ -*-

//=============================================================================
/**
 * @file Monitor_Control_Action.h
 *
 * @author Jeff Parsons <j.parsons@vanderbilt.edu>
 */
//=============================================================================

#ifndef MONITOR_CONTROL_ACTION_H
#define MONITOR_CONTROL_ACTION_H

#include /**/ "ace/pre.h"

#include "ace/Refcountable_T.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
{
  namespace Monitor_Control
  {
    /**
     * @class ControlAction
     *
     * @brief Base class for control actions initiated by the
     * application or by constraint evaluation trigger.
     *
     * This class is extended by the application developer or
     * by the MC service itself to create a concrete class.
     */
    class ACE_Export Control_Action
      : private ACE_Refcountable_T<ACE_SYNCH_MUTEX>
    {
    public:
      /// To be implemented by the concrete derived class.
      virtual void execute (const char* command = 0) = 0;

      /// Refcounting methods.
      void add_ref (void);
      void remove_ref (void);

    protected:
      Control_Action ();
      ~Control_Action () override = default;
    };
  }
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */

#include /**/ "ace/post.h"

#endif // MONITOR_CONTROL_ACTION_H