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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
// -*- C++ -*-
//=============================================================================
/**
* @file Monitor_Control_Types.h
*
* @author Jeff Parsons <j.parsons@vanderbilt.edu>
*/
//=============================================================================
#ifndef MONITOR_CONTROL_TYPES_H
#define MONITOR_CONTROL_TYPES_H
#include /**/ "ace/pre.h"
#include "ace/Vector_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)
#include "ace/Array_Map.h"
#include "ace/SString.h"
#include "ace/Time_Value.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
namespace ACE
{
namespace Monitor_Control
{
class Control_Action;
struct ACE_Export Monitor_Control_Types
{
/// A monitor can hold various types of data and maintains stats
/// differently depending upon the type of information stored.
enum Information_Type
{
MC_COUNTER,
MC_NUMBER,
MC_TIME,
MC_INTERVAL,
MC_LIST,
MC_GROUP
};
/**
* @brief An instance is contained by each enabled monitor point.
*/
struct ACE_Export Data
{
Data (Monitor_Control_Types::Information_Type type);
ACE_Time_Value timestamp_;
double value_;
ACE_Array_Base<char *> list_;
Information_Type type_;
size_t index_;
bool minimum_set_;
double minimum_;
double maximum_;
double sum_;
double sum_of_squares_;
double last_;
};
/**
* @brief Bundles the constrain string with its associated
* trigger action.
*/
struct ACE_Export Constraint
{
Constraint (void);
~Constraint (void);
/// Implemented explicitly so reference counting of control
/// actions can be managed.
Constraint (const Constraint& rhs);
Constraint& operator= (const Constraint& rhs);
ACE_CString expr;
Control_Action* control_action;
};
/**
* @brief Used by the admin class as a container for the data from
* a group of monitor points.
*/
typedef ACE_Vector<Data> DataList;
/**
* @brief Used in various places to pass around a set of string names.
*/
typedef ACE_Vector<ACE_CString> NameList;
/**
* @brief Holder for a monitor point's constraints.
*/
#if defined (ACE_HAS_ALLOC_HOOKS)
typedef ACE_Array_Map<long, Constraint, std::equal_to<long>, ACE_Allocator_Std_Adapter<std::pair<long, Constraint> > > ConstraintList;
#else
typedef ACE_Array_Map<long, Constraint> ConstraintList;
#endif /* ACE_HAS_ALLOC_HOOKS */
};
}
}
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */
#include /**/ "ace/post.h"
#endif // MONITOR_CONTROL_TYPES_H
|