summaryrefslogtreecommitdiff
path: root/ACE/ace/Monitor_Control_Types.cpp
blob: 6b3227e1e45f780c9909132c90728c1fa4bf6e3e (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
70
71
72
73
74
75
#include "ace/Monitor_Control_Types.h"

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

#include "ace/Monitor_Control_Action.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
{
  namespace Monitor_Control
  {
    Monitor_Control_Types::Data::Data (
      Monitor_Control_Types::Information_Type type)
      : timestamp_ (ACE_Time_Value::zero)
      , value_ (0.0)
      , type_ (type)
      , index_ (0UL)
      , minimum_set_ (false)
      , minimum_ (0.0)
      , maximum_ (0.0)
      , sum_ (0.0)
      , sum_of_squares_ (0.0)
      , last_ (0.0)
    {}

    //=============================================================

    Monitor_Control_Types::Constraint::Constraint (const Constraint& rhs)
      : expr (rhs.expr),
        control_action (rhs.control_action)
    {
      if (control_action != 0)
        {
          control_action->add_ref ();
        }
    }

    Monitor_Control_Types::Constraint::~Constraint ()
    {
      if (this->control_action != 0)
        {
          this->control_action->remove_ref ();
        }
    }

    Monitor_Control_Types::Constraint&
    Monitor_Control_Types::Constraint::operator= (const Constraint& rhs)
    {
      if (this != &rhs)
        {
          if (this->control_action != 0)
            {
              this->control_action->remove_ref ();
            }

          this->expr = rhs.expr;
          this->control_action = rhs.control_action;

          if (this->control_action != 0)
            {
              this->control_action->add_ref ();
            }
        }

      return *this;
    }
  }
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */