-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSSTInfoData.h
369 lines (287 loc) · 12.7 KB
/
SSTInfoData.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
////////////////////////////////////////////////////////////////////////
// Copyright 2009-2018 NTESS. Under the terms
// of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Copyright (c) 2009-2018, NTESS
// All rights reserved.
//
// Portions are copyright of other developers:
// See the file CONTRIBUTORS.TXT in the top level directory
// the distribution for more information.
//
// This file is part of the SST software package. For license
// information, see the LICENSE file in the top level directory of the
// distribution.
////////////////////////////////////////////////////////////////////////
#ifndef SSTINFODATA_H
#define SSTINFODATA_H
#include "GlobalIncludes.h"
//////////////////////////////////////////////////////////////////////
class SSTInfoDataParam
{
public:
// Constructor / Destructor
SSTInfoDataParam(QString ParamName, QString DefaultValue = "");
SSTInfoDataParam(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataParam();
// Parameter Name, Description and Default Value
void SetParamDesc(QString NewDesc) {m_ParamDesc = NewDesc;}
QString GetParamName() {return m_ParamName;}
QString GetParamDesc() {return m_ParamDesc;}
QString GetDefaultValue() {return m_ParamDefaultValue;}
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
QString m_ParamName;
QString m_ParamDesc;
QString m_ParamDefaultValue;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataPort
{
public:
// Constructor / Destructor
SSTInfoDataPort(QString PortName);
SSTInfoDataPort(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataPort();
// Port Name and Description
void SetPortDesc(QString NewDesc) {m_PortDesc = NewDesc;}
QString GetPortName() {return m_PortName;}
QString GetPortDesc() {return m_PortDesc;}
// Port Events
void AddPortValidEvent(QString Event) {m_PortValidEvents.append(Event);}
int GetNumPortValidEvents() {return m_PortValidEvents.count();}
QString GetPortValidEvent(int Index) {return m_PortValidEvents.at(Index);}
QStringList& GetPortValidEvents() {return m_PortValidEvents;}
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
QString m_PortName;
QString m_PortDesc;
QStringList m_PortValidEvents;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataComponent
{
public:
// Enumerations for Identifying the component type (NOTE: COMP_END MUST ALWAYS BE LAST)
enum ComponentType { COMP_SSTSTARTUPCONFIGURATION, COMP_UNCATEGORIZED, COMP_PROCESSOR, COMP_MEMORY, COMP_NETWORK, COMP_SYSTEM, COMP_END };
// Constructor / Destructor
SSTInfoDataComponent(QString ParentElementName, QString ComponentName, ComponentType Type, int NumAllowedInstances = -1);
SSTInfoDataComponent(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataComponent();
// Component Names, Type & Description
QString GetParentElementName() const {return m_ParentElementName;}
QString GetComponentName() const {return m_ComponentName;}
ComponentType GetComponentType() {return m_ComponentType;}
static QString GetComponentTypeName(ComponentType Type);
QString GetComponentDesc() const {return m_ComponentDesc;}
void SetComponentDesc(QString NewDesc) {m_ComponentDesc = NewDesc;}
// Parameters and Ports
int GetNumOfParams() {return m_ParamNameList.count();}
int GetNumOfPorts() {return m_PortNameList.count();}
SSTInfoDataParam* GetParam(int index) {return m_ParamNameList.at(index);}
SSTInfoDataPort* GetPort(int index) {return m_PortNameList.at(index);}
void AddParam(SSTInfoDataParam* NewParam);
void AddParam(QString NewParamName, QString DefaultValue, QString Desc = "");
void AddParam(QString NewParamName);
void AddPort(SSTInfoDataPort* NewPort);
void AddPort(QString NewPortName);
// The allowed number of instances of this component
int GetAllowedNumberOfInstances() {return m_AllowedNumberOfInstances;}
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
// Info from SST Info
QString m_ParentElementName;
QString m_ComponentName;
QString m_ComponentDesc;
ComponentType m_ComponentType;
QList<SSTInfoDataParam*> m_ParamNameList;
QList<SSTInfoDataPort*> m_PortNameList;
// Info that SSTWorkbench needs
int m_AllowedNumberOfInstances;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataIntrospector
{
public:
// Constructor / Destructor
SSTInfoDataIntrospector(QString ParentElementName, QString IntrospectorName);
SSTInfoDataIntrospector(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataIntrospector();
// Element Name and Description
void SetIntrospectorDesc(QString NewDesc) {m_IntrospectorDesc = NewDesc;}
QString GetParentElementName() const {return m_ParentElementName;}
QString GetIntrospectorName() const {return m_IntrospectorName;}
QString GetIntrospectorDesc() const {return m_IntrospectorDesc;}
// Parameters
int GetNumOfParams() {return m_ParamNameList.count();}
SSTInfoDataParam* GetParam(int index) {return m_ParamNameList.at(index);}
void AddParam(SSTInfoDataParam* NewParam);
void AddParam(QString NewParamName, QString DefaultValue, QString Desc = "");
void AddParam(QString NewParamName);
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
// Info from SST Info
QString m_ParentElementName;
QString m_IntrospectorName;
QString m_IntrospectorDesc;
QList<SSTInfoDataParam*> m_ParamNameList;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataEvent
{
public:
// Constructor / Destructor
SSTInfoDataEvent(QString ParentElementName, QString EventName);
SSTInfoDataEvent(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataEvent();
// Event Name & description
void SetEventDesc(QString NewDesc) {m_EventDesc = NewDesc;}
QString GetParentElementName() const {return m_ParentElementName;}
QString GetEventName() const {return m_EventName;}
QString GetEventDesc() const {return m_EventDesc;}
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
// Info from SST Info
QString m_ParentElementName;
QString m_EventName;
QString m_EventDesc;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataModule
{
public:
// Constructor / Destructor
SSTInfoDataModule(QString ParentElementName, QString ModuleName);
SSTInfoDataModule(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataModule();
// Data Name and Description
void SetModuleDesc(QString NewDesc) {m_ModuleDesc = NewDesc;}
QString GetParentElementName() const {return m_ParentElementName;}
QString GetModuleName() const {return m_ModuleName;}
QString GetModuleDesc() const {return m_ModuleDesc;}
// Parameters
int GetNumOfParams() {return m_ParamNameList.count();}
SSTInfoDataParam* GetParam(int index) {return m_ParamNameList.at(index);}
void AddParam(SSTInfoDataParam* NewParam);
void AddParam(QString NewParamName, QString DefaultValue, QString Desc = "");
void AddParam(QString NewParamName);
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
// Info from SST Info
QString m_ParentElementName;
QString m_ModuleName;
QString m_ModuleDesc;
QList<SSTInfoDataParam*> m_ParamNameList;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataPartitioner
{
public:
// Constructor / Destructor
SSTInfoDataPartitioner(QString ParentElementName, QString PartitionerName);
SSTInfoDataPartitioner(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataPartitioner();
// Partitioner Name & Description
void SetPartitionerDesc(QString NewDesc) {m_PartitionerDesc = NewDesc;}
QString GetParentElementName() const {return m_ParentElementName;}
QString GetPartitionerName() const {return m_PartitionerName;}
QString GetPartitionerDesc() const {return m_PartitionerDesc;}
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
// Info from SST Info
QString m_ParentElementName;
QString m_PartitionerName;
QString m_PartitionerDesc;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataGenerator
{
public:
// Constructor / Destructor
SSTInfoDataGenerator(QString ParentElementName, QString GeneratorName);
SSTInfoDataGenerator(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataGenerator();
// Generator Name & Description
void SetGeneratorDesc(QString NewDesc) {m_GeneratorDesc = NewDesc;}
QString GetParentElementName() const {return m_ParentElementName;}
QString GetGeneratorName() const {return m_GeneratorName;}
QString GetGeneratorDesc() const {return m_GeneratorDesc;}
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
// Info from SST Info
QString m_ParentElementName;
QString m_GeneratorName;
QString m_GeneratorDesc;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoDataElement
{
public:
// Constructor / Destructor
SSTInfoDataElement(QString ElementName);
SSTInfoDataElement(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoDataElement();
// Element Name & Description
void SetElementDesc(QString NewDesc) {m_ElementDesc = NewDesc;}
QString GetElementName() const {return m_ElementName;}
QString GetElementDesc() const {return m_ElementDesc;}
// Sub-objects manipulation
int GetNumOfComponents() {return m_ComponentList.count();}
int GetNumOfIntrospectors() {return m_IntrospectorList.count();}
int GetNumOfEvents() {return m_EventList.count();}
int GetNumOfModules() {return m_ModuleList.count();}
int GetNumOfPartitionerss() {return m_PartitionerList.count();}
int GetNumOfGenerators() {return m_GeneratorList.count();}
SSTInfoDataComponent* GetComponent(int index) {return m_ComponentList.at(index);}
SSTInfoDataIntrospector* GetIntrospector(int index) {return m_IntrospectorList.at(index);}
SSTInfoDataEvent* GetEvent(int index) {return m_EventList.at(index);}
SSTInfoDataModule* GetModule(int index) {return m_ModuleList.at(index);}
SSTInfoDataPartitioner* GetPartitioner(int index) {return m_PartitionerList.at(index);}
SSTInfoDataGenerator* GetGenerator(int index) {return m_GeneratorList.at(index);}
void AddComponent(SSTInfoDataComponent* NewComponent);
void AddIntrospector(SSTInfoDataIntrospector* NewIntrospector);
void AddEvent(SSTInfoDataEvent* NewEvent);
void AddModule(SSTInfoDataModule* NewModule);
void AddPartitioner(SSTInfoDataPartitioner* NewPartitioner);
void AddGenerator(SSTInfoDataGenerator* NewGenerator);
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
QString m_ElementName;
QString m_ElementDesc;
QList<SSTInfoDataComponent*> m_ComponentList;
QList<SSTInfoDataIntrospector*> m_IntrospectorList;
QList<SSTInfoDataEvent*> m_EventList;
QList<SSTInfoDataModule*> m_ModuleList;
QList<SSTInfoDataPartitioner*> m_PartitionerList;
QList<SSTInfoDataGenerator*> m_GeneratorList;
};
//////////////////////////////////////////////////////////////////////
class SSTInfoData
{
public:
// Constructor / Destructor
SSTInfoData();
SSTInfoData(QDataStream& DataStreamIn); // Only used for serialization
~SSTInfoData();
int GetNumOfElements() {return m_ElementList.count();}
SSTInfoDataElement* GetElement(int index) {return m_ElementList.at(index);}
void AddElement(SSTInfoDataElement* NewElement);
QString GetSSTInfoVersion() {return m_SSTInfoVersion;}
void SetSSTInfoVersion(QString Ver) {m_SSTInfoVersion = Ver;}
// Serialization
void SaveData(QDataStream& DataStreamOut);
private:
QList<SSTInfoDataElement*> m_ElementList;
QString m_SSTInfoVersion;
};
#endif // SSTINFODATA_H