forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MonitorData.h
156 lines (116 loc) · 3.86 KB
/
MonitorData.h
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
*
*
* Distributed under the OpenDDS License.
* See: http://www.opendds.org/license.html
*/
#ifndef MONITORDATA_H
#define MONITORDATA_H
#include "dds/Versioned_Namespace.h"
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
namespace OpenDDS { namespace DCPS {
struct GUID_t;
struct ServiceParticipantReport;
struct DomainParticipantReport;
struct TopicReport;
struct PublisherReport;
struct SubscriberReport;
struct DataWriterReport;
struct DataWriterPeriodicReport;
struct DataReaderReport;
struct DataReaderPeriodicReport;
struct TransportReport;
}} // End of namespace OpenDDS::DCPS
namespace DDS {
struct ParticipantBuiltinTopicData;
struct TopicBuiltinTopicData;
struct PublicationBuiltinTopicData;
struct SubscriptionBuiltinTopicData;
} // End of namespace DDS
OPENDDS_END_VERSIONED_NAMESPACE_DECL
class QString;
template< class T> class QList;
namespace Monitor {
class Options;
class MonitorDataModel;
class MonitorDataStorage;
class MonitorTask;
class TreeNode;
/**
* @class MonitorData
*
* brief mediate the interaction between the GUI and the DDS service.
*
* This class provides the mechanism for the GUI to send messages to the
* DDS service and the service to send messages to the GUI. This class
* also stores the data used by the data model so that it can be accessed
* by the GUI data model as well as by the service.
*/
class MonitorData {
public:
/// Construct with an IOR only.
MonitorData( const Options& options, MonitorDataModel* model, bool mapExistingIORKeys = true);
virtual ~MonitorData();
/// Disable operation for orderly shutdown.
void disable();
/// @name Messages and queries to DDS.
/// @{
/// Obtain a list of existing repository IOR values.
void getIorList( QList<QString>& iorList);
/// Establish a binding to a repository. There can be only one per IOR.
bool setRepoIor( const QString& ior);
/// Remove a binding to a repository. There should be only one with this IOR.
bool removeRepo( const QString& ior);
/// Evict the currently monitored repository.
bool clearData();
/// Stop processing inbound instrumentation data.
bool stopInstrumentation();
/// @NOTE: the following methods are not templated to reduce
/// dependencies, since the implementation would need to be
/// visible from this header.
/// Obtain Builtin Topic data for a Participant.
bool getBuiltinTopicData(
const OpenDDS::DCPS::GUID_t& id,
DDS::ParticipantBuiltinTopicData& data
);
/// Obtain Builtin Topic data for a Topic.
bool getBuiltinTopicData(
const OpenDDS::DCPS::GUID_t& id,
DDS::TopicBuiltinTopicData& data
);
/// Obtain Builtin Topic data for a Publication.
bool getBuiltinTopicData(
const OpenDDS::DCPS::GUID_t& id,
DDS::PublicationBuiltinTopicData& data
);
/// Obtain Builtin Topic data for a Subscription.
bool getBuiltinTopicData(
const OpenDDS::DCPS::GUID_t& id,
DDS::SubscriptionBuiltinTopicData& data
);
/// @}
/// @name Messages and queries to GUI.
/// @{
/// Grab the root of the model tree.
TreeNode* modelRoot();
/// Update data values for a single node.
void updated( TreeNode* node, int column);
/// Update data values for a range of nodes.
void updated( TreeNode* left, int lcol, TreeNode* right, int rcol);
/// Modify the layout of the GUI.
void changed();
/// @}
private:
/// Enabled flag.
bool enabled_;
/// Configuration information.
const Options& options_;
/// The GUI model.
MonitorDataModel* model_;
/// The DDS data source.
MonitorTask* dataSource_;
/// The instrumentation data storage.
MonitorDataStorage* storage_;
};
} // End of namespace Monitor
#endif /* MONITORDATA_H */