| 2263 |
kivins |
1 |
//## begin module%1.7%.codegen_version preserve=yes
|
|
|
2 |
// Read the documentation to learn more about C++ code generator
|
|
|
3 |
// versioning.
|
|
|
4 |
//## end module%1.7%.codegen_version
|
|
|
5 |
|
|
|
6 |
//## begin module%41F607FA0261.cm preserve=no
|
|
|
7 |
//## end module%41F607FA0261.cm
|
|
|
8 |
|
|
|
9 |
//## begin module%41F607FA0261.cp preserve=no
|
|
|
10 |
// C O P Y R I G H T N O T I C E
|
|
|
11 |
// This material is confidential to ERG and may not be disclosed in whole
|
|
|
12 |
// or in part to any third party nor used in any manner whatsoever other
|
|
|
13 |
// than for the purposes expressly consented to by ERG in writing.
|
|
|
14 |
//
|
|
|
15 |
// This material is also copyright and may not be reproduced, stored in a
|
|
|
16 |
// retrieval system or transmitted in any form or by any means in whole or
|
|
|
17 |
// in part without the express written consent of ERG.
|
|
|
18 |
//## end module%41F607FA0261.cp
|
|
|
19 |
|
|
|
20 |
//## Module: TransactionSpecification%41F607FA0261; Pseudo Package specification
|
|
|
21 |
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
|
|
|
22 |
//## Source file: Z:\MASS_Dev\Tools\TxnTestManager\src\TransactionSpecification.h
|
|
|
23 |
|
|
|
24 |
#ifndef TransactionSpecification_h
|
|
|
25 |
#define TransactionSpecification_h 1
|
|
|
26 |
|
|
|
27 |
//## begin module%41F607FA0261.additionalIncludes preserve=no
|
|
|
28 |
//## end module%41F607FA0261.additionalIncludes
|
|
|
29 |
|
|
|
30 |
//## begin module%41F607FA0261.includes preserve=yes
|
|
|
31 |
#include <map>
|
|
|
32 |
#include <string>
|
|
|
33 |
#include <vector>
|
|
|
34 |
//## end module%41F607FA0261.includes
|
|
|
35 |
|
|
|
36 |
|
|
|
37 |
namespace XMLSchema {
|
|
|
38 |
class IXmlSchemaWrapperString;
|
|
|
39 |
} // namespace XMLSchema
|
|
|
40 |
|
|
|
41 |
class TestScenario;
|
|
|
42 |
class ProgressBar;
|
|
|
43 |
namespace XMLSchema {
|
|
|
44 |
class IXmlSchemaWrapperElement;
|
|
|
45 |
} // namespace XMLSchema
|
|
|
46 |
|
|
|
47 |
class TransactionSpecificationValue;
|
|
|
48 |
class EvaluationContext;
|
|
|
49 |
class TransactionStream;
|
|
|
50 |
class TransactionStructure;
|
|
|
51 |
|
|
|
52 |
//## begin module%41F607FA0261.additionalDeclarations preserve=yes
|
|
|
53 |
//## end module%41F607FA0261.additionalDeclarations
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
//## begin TransactionSpecification%41F607FA0261.preface preserve=yes
|
|
|
57 |
//## end TransactionSpecification%41F607FA0261.preface
|
|
|
58 |
|
|
|
59 |
//## Class: TransactionSpecification%41F607FA0261; private
|
|
|
60 |
// A transaction specification. During transaction generation, specifications
|
|
|
61 |
// are instantiated by evaluating its values.
|
|
|
62 |
//## Category: TransactionTestManager::Transaction Specification%41FD9D7902B3
|
|
|
63 |
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
|
|
|
64 |
//## Persistence: Transient
|
|
|
65 |
//## Cardinality/Multiplicity: n
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
//## Uses: <unnamed>%4204641103B1;Iteration { -> }
|
|
|
70 |
//## Uses: <unnamed>%4204646E03E0;XMLSchema::IXmlSchemaWrapperSchema { -> }
|
|
|
71 |
//## Uses: <unnamed>%4204675A008D;XMLSchema::IXmlSchemaWrapperFactory { -> }
|
|
|
72 |
//## Uses: <unnamed>%42081AA001ED;TransactionStream { -> F}
|
|
|
73 |
//## Uses: <unnamed>%420892B9002C;ProgressBar { -> F}
|
|
|
74 |
//## Uses: <unnamed>%4211735E0064;EvaluationContext { -> F}
|
|
|
75 |
//## Uses: <unnamed>%4211BFAD03A0;EvaluationCallback { -> }
|
|
|
76 |
//## Uses: <unnamed>%4211D1FE0324;TimeEstimate { -> }
|
|
|
77 |
//## Uses: <unnamed>%4212E27501FC;MacQualification { -> }
|
|
|
78 |
//## Uses: <unnamed>%4212E76E027F;XMLSchema::IXmlSchemaWrapperByteArray { -> }
|
|
|
79 |
//## Uses: <unnamed>%4212E8CF00AA;IMessageDigest { -> }
|
|
|
80 |
//## Uses: <unnamed>%423695CE02A1;XMLSchema::IXmlSchemaWrapperStream { -> }
|
|
|
81 |
//## Uses: <unnamed>%4288499E035A;IHash { -> }
|
|
|
82 |
|
|
|
83 |
class TransactionSpecification
|
|
|
84 |
{
|
|
|
85 |
//## begin TransactionSpecification%41F607FA0261.initialDeclarations preserve=yes
|
|
|
86 |
//## end TransactionSpecification%41F607FA0261.initialDeclarations
|
|
|
87 |
|
|
|
88 |
public:
|
|
|
89 |
//## Constructors (specified)
|
|
|
90 |
//## Operation: TransactionSpecification%41F7060D0204
|
|
|
91 |
// This constructor creates a schema-less instance.
|
|
|
92 |
TransactionSpecification (const int &transactionSpecificationNumber // The transaction specification number of this transaction.
|
|
|
93 |
);
|
|
|
94 |
|
|
|
95 |
//## Operation: TransactionSpecification%42045473030D
|
|
|
96 |
// This constructor creates an instance bound to a scenario.
|
|
|
97 |
TransactionSpecification (const int &transactionSpecificationNumber, // The transaction specification number of this transaction.
|
|
|
98 |
const std::string &payloadStructureName, // The name of the structure that describes the payload of this transaction.
|
|
|
99 |
TestScenario& scenario // The scenario for which this transaction is defined. While we do not accept
|
|
|
100 |
// ownership over this instance, we do assume its validity for the remainder
|
|
|
101 |
// of our lifetime.
|
|
|
102 |
);
|
|
|
103 |
|
|
|
104 |
//## Destructor (generated)
|
|
|
105 |
virtual ~TransactionSpecification();
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
//## Other Operations (specified)
|
|
|
109 |
//## Operation: addMacField%4212DBC1031E
|
|
|
110 |
// Add the given schema element to the collection of elements to which the MAC
|
|
|
111 |
// of the structure is to be assigned.
|
|
|
112 |
void addMacField (XMLSchema::IXmlSchemaWrapperElement &element // The element.
|
|
|
113 |
);
|
|
|
114 |
|
|
|
115 |
//## Operation: addValue%41F70652035C
|
|
|
116 |
// Add the value with the given xpath to this transaction. When the value
|
|
|
117 |
// cannot be added, raise an exception.
|
|
|
118 |
void addValue (const std::string &xPath, // The xpath of the value.
|
|
|
119 |
const std::string &value, // The value.
|
|
|
120 |
const bool &obsolete // Of value true when the value is obsolete, and of value false otherwise.
|
|
|
121 |
);
|
|
|
122 |
|
|
|
123 |
//## Operation: clearMarks%41F705790276
|
|
|
124 |
// Unmark all values.
|
|
|
125 |
void clearMarks ();
|
|
|
126 |
|
|
|
127 |
//## Operation: generate%4204564D02F3
|
|
|
128 |
// Generate this transaction and evaluate to true, or to false when any
|
|
|
129 |
// transaction cannot be evaluated.
|
|
|
130 |
const bool generate (TransactionStream& stream, // The stream into which to generate.
|
|
|
131 |
const bool &generateHeaders, // When true, the transaction stream contains transaction header. Otherwise,
|
|
|
132 |
// the transaction steam does not contain transaction headers.
|
|
|
133 |
EvaluationContext& evaluationContext // The evaluation context.
|
|
|
134 |
);
|
|
|
135 |
|
|
|
136 |
//## Operation: getCurrentStructure%4213183F01DD
|
|
|
137 |
// Evaluate to the current structure being traversed.
|
|
|
138 |
const TransactionStructure & getCurrentStructure () const;
|
|
|
139 |
|
|
|
140 |
//## Operation: getFormatVersion%4208BB80011D
|
|
|
141 |
// Evaluate to the format version of the schema that defines this structure.
|
|
|
142 |
const int & getFormatVersion () const;
|
|
|
143 |
|
|
|
144 |
//## Operation: getScenario%420471B00192
|
|
|
145 |
// Evaluate to the scenario for which this transaction is defined.
|
|
|
146 |
const TestScenario & getScenario () const;
|
|
|
147 |
|
|
|
148 |
//## Operation: getTransactionField%4204283B033E
|
|
|
149 |
// Evaluate to the given transaction field. When the object doesn't already
|
|
|
150 |
// exist, create it.
|
|
|
151 |
TransactionSpecificationValue& getTransactionField (const std::string &xpath // The xpath of the field.
|
|
|
152 |
);
|
|
|
153 |
|
|
|
154 |
//## Operation: getTransactionSpecificationNumber%41F71AD2002F
|
|
|
155 |
// Evaluate to the transaction specification number of this transaction.
|
|
|
156 |
const int & getTransactionSpecificationNumber () const;
|
|
|
157 |
|
|
|
158 |
//## Operation: getUdSubtype%4208AFAF01F7
|
|
|
159 |
// Evaluate to the UD subtype of this transaction.
|
|
|
160 |
const unsigned short & getUdSubtype () const;
|
|
|
161 |
|
|
|
162 |
//## Operation: getUdType%4208AFAF0245
|
|
|
163 |
// Evaluate to the UD type of this transaction.
|
|
|
164 |
const unsigned short & getUdType () const;
|
|
|
165 |
|
|
|
166 |
//## Operation: getValues%41F705A600AC
|
|
|
167 |
// Get the collection of defined values.
|
|
|
168 |
const std::map< std::string, TransactionSpecificationValue * > & getValues () const;
|
|
|
169 |
|
|
|
170 |
//## Operation: isContained%41F70575014E
|
|
|
171 |
// Evaluate to true when a value with the given xpath is defined, and to false
|
|
|
172 |
// otherwise.
|
|
|
173 |
const bool isContained (const std::string &xPath // The xpath of the value.
|
|
|
174 |
) const;
|
|
|
175 |
|
|
|
176 |
//## Operation: isMarked%41F708CB0307
|
|
|
177 |
// Evaluate to true when the value with the given xPath is marked, and to false
|
|
|
178 |
// otherwise. When no value with the given xPath is contained, raise an
|
|
|
179 |
// exception.
|
|
|
180 |
const bool isMarked (const std::string &xPath // The xpath of the value.
|
|
|
181 |
) const;
|
|
|
182 |
|
|
|
183 |
//## Operation: markValue%41F7069E002F
|
|
|
184 |
// Mark the value with the given xpath. When no value with the given xPath is
|
|
|
185 |
// contained, raise an exception.
|
|
|
186 |
void markValue (const std::string &xPath // The xpath of the value.
|
|
|
187 |
);
|
|
|
188 |
|
|
|
189 |
//## Operation: setUdSubtype%42044110019A
|
|
|
190 |
// Set the UD subtype and evaluate to the resulting value.
|
|
|
191 |
const unsigned short & setUdSubtype (const unsigned short &value // The value.
|
|
|
192 |
);
|
|
|
193 |
|
|
|
194 |
//## Operation: setUdType%420440DE038E
|
|
|
195 |
// Set the UD type and evaluate to the resulting value.
|
|
|
196 |
const unsigned short & setUdType (const unsigned short &value // The value.
|
|
|
197 |
);
|
|
|
198 |
|
|
|
199 |
//## Operation: evaluate%4205C6F500FC
|
|
|
200 |
// Evaluate the given field using the given context.
|
|
|
201 |
virtual const bool evaluate (XMLSchema::IXmlSchemaWrapperElement &element, // The schema element being visited.
|
|
|
202 |
EvaluationContext& context // The context.
|
|
|
203 |
);
|
|
|
204 |
|
|
|
205 |
// Additional Public Declarations
|
|
|
206 |
//## begin TransactionSpecification%41F607FA0261.public preserve=yes
|
|
|
207 |
//## end TransactionSpecification%41F607FA0261.public
|
|
|
208 |
|
|
|
209 |
protected:
|
|
|
210 |
// Additional Protected Declarations
|
|
|
211 |
//## begin TransactionSpecification%41F607FA0261.protected preserve=yes
|
|
|
212 |
//## end TransactionSpecification%41F607FA0261.protected
|
|
|
213 |
|
|
|
214 |
private:
|
|
|
215 |
//## Constructors (generated)
|
|
|
216 |
TransactionSpecification();
|
|
|
217 |
|
|
|
218 |
TransactionSpecification(const TransactionSpecification &right);
|
|
|
219 |
|
|
|
220 |
//## Assignment Operation (generated)
|
|
|
221 |
TransactionSpecification & operator=(const TransactionSpecification &right);
|
|
|
222 |
|
|
|
223 |
|
|
|
224 |
//## Other Operations (specified)
|
|
|
225 |
//## Operation: clearMacFields%42130B2D0377
|
|
|
226 |
// Clear the collection of fields to MAC.
|
|
|
227 |
void clearMacFields ();
|
|
|
228 |
|
|
|
229 |
// Data Members for Class Attributes
|
|
|
230 |
|
|
|
231 |
//## Attribute: headerStructureName%4206D764033E
|
|
|
232 |
// The name of the structure that describes the header of this transaction.
|
|
|
233 |
//## begin TransactionSpecification::headerStructureName%4206D764033E.attr preserve=no private: static char {RAC} "SysHdr_t"
|
|
|
234 |
static const char *g_headerStructureName;
|
|
|
235 |
//## end TransactionSpecification::headerStructureName%4206D764033E.attr
|
|
|
236 |
|
|
|
237 |
//## Attribute: structureIndex%4206D2C800CF
|
|
|
238 |
// The index of the structure currently being traversed.
|
|
|
239 |
//## begin TransactionSpecification::structureIndex%4206D2C800CF.attr preserve=no private: unsigned {VA} 0
|
|
|
240 |
unsigned m_structureIndex;
|
|
|
241 |
//## end TransactionSpecification::structureIndex%4206D2C800CF.attr
|
|
|
242 |
|
|
|
243 |
//## Attribute: structureName%4204415E01B9
|
|
|
244 |
// The name of the structure that describes the payload of this transaction.
|
|
|
245 |
//## begin TransactionSpecification::structureName%4204415E01B9.attr preserve=no private: std::string {VA}
|
|
|
246 |
std::string m_structureName;
|
|
|
247 |
//## end TransactionSpecification::structureName%4204415E01B9.attr
|
|
|
248 |
|
|
|
249 |
//## Attribute: transactionSpecificationNumber%41F7044B0238
|
|
|
250 |
// The transaction specification number of the field.
|
|
|
251 |
//## begin TransactionSpecification::transactionSpecificationNumber%41F7044B0238.attr preserve=no private: int {VA} 0
|
|
|
252 |
int m_transactionSpecificationNumber;
|
|
|
253 |
//## end TransactionSpecification::transactionSpecificationNumber%41F7044B0238.attr
|
|
|
254 |
|
|
|
255 |
//## Attribute: udSubtype%420441600265
|
|
|
256 |
// The UD subtype of this transaction.
|
|
|
257 |
//## begin TransactionSpecification::udSubtype%420441600265.attr preserve=no private: unsigned short {VA} 0
|
|
|
258 |
unsigned short m_udSubtype;
|
|
|
259 |
//## end TransactionSpecification::udSubtype%420441600265.attr
|
|
|
260 |
|
|
|
261 |
//## Attribute: udType%4204415F0226
|
|
|
262 |
// The UD type of this transaction.
|
|
|
263 |
//## begin TransactionSpecification::udType%4204415F0226.attr preserve=no private: unsigned short {VA} 0
|
|
|
264 |
unsigned short m_udType;
|
|
|
265 |
//## end TransactionSpecification::udType%4204415F0226.attr
|
|
|
266 |
|
|
|
267 |
//## Attribute: formatVersion%4208C3670196
|
|
|
268 |
// The format version of the schema that defines this structure.
|
|
|
269 |
//## begin TransactionSpecification::formatVersion%4208C3670196.attr preserve=no private: int {VA} 0
|
|
|
270 |
int m_formatVersion;
|
|
|
271 |
//## end TransactionSpecification::formatVersion%4208C3670196.attr
|
|
|
272 |
|
|
|
273 |
// Data Members for Associations
|
|
|
274 |
|
|
|
275 |
//## Association: TransactionTestManager::Transaction Specification::<unnamed>%41F610D90055
|
|
|
276 |
//## Role: TransactionSpecification::value%41F610D90297
|
|
|
277 |
// The values defined for this instance.
|
|
|
278 |
//## Qualifier: xpath%41F610F603B0; std::string
|
|
|
279 |
// The xpath of the field.
|
|
|
280 |
//## begin TransactionSpecification::value%41F610D90297.role preserve=no private: TransactionSpecificationValue {1 -> 1RFHgAN}
|
|
|
281 |
std::map<std::string, TransactionSpecificationValue *> m_value;
|
|
|
282 |
//## end TransactionSpecification::value%41F610D90297.role
|
|
|
283 |
|
|
|
284 |
//## Association: TransactionTestManager::Transaction Generation::<unnamed>%42044DA10263
|
|
|
285 |
//## Role: TransactionSpecification::scenario%42044DA20263
|
|
|
286 |
// The scenario for which this transaction is defined. While we do not accept
|
|
|
287 |
// ownership over this instance, we do assume its validity for the remainder of
|
|
|
288 |
// our lifetime.
|
|
|
289 |
//## begin TransactionSpecification::scenario%42044DA20263.role preserve=no private: TestScenario {1 -> 1RFHAN}
|
|
|
290 |
TestScenario *m_scenario;
|
|
|
291 |
//## end TransactionSpecification::scenario%42044DA20263.role
|
|
|
292 |
|
|
|
293 |
//## Association: TransactionTestManager::Transaction Generation::<unnamed>%4205CC83034E
|
|
|
294 |
//## Role: TransactionSpecification::string%4205CC8600CE
|
|
|
295 |
// A string for interacting with the schema. We aggregate it because we're
|
|
|
296 |
// about to need for every schema element whenever we visit it.
|
|
|
297 |
//## begin TransactionSpecification::string%4205CC8600CE.role preserve=no private: XMLSchema::IXmlSchemaWrapperString {1 -> 1RFHgAN}
|
|
|
298 |
XMLSchema::IXmlSchemaWrapperString *m_string;
|
|
|
299 |
//## end TransactionSpecification::string%4205CC8600CE.role
|
|
|
300 |
|
|
|
301 |
//## Association: TransactionTestManager::Transaction Generation::<unnamed>%4205D27303DF
|
|
|
302 |
//## Role: TransactionSpecification::structure%4205D274021A
|
|
|
303 |
// The collection of structures associated with this transaction.
|
|
|
304 |
//## begin TransactionSpecification::structure%4205D274021A.role preserve=no private: TransactionStructure {1 -> *RFHgAN}
|
|
|
305 |
std::vector< TransactionStructure * > m_structure;
|
|
|
306 |
//## end TransactionSpecification::structure%4205D274021A.role
|
|
|
307 |
|
|
|
308 |
//## Association: TransactionTestManager::Transaction Generation::<unnamed>%4212DB3900A3
|
|
|
309 |
//## Role: TransactionSpecification::macFields%4212DB3903B0
|
|
|
310 |
// The collection of schema elements to which we must assign the MAC that we
|
|
|
311 |
// need to compute for this transaction.
|
|
|
312 |
//## begin TransactionSpecification::macFields%4212DB3903B0.role preserve=no private: XMLSchema::IXmlSchemaWrapperElement {1 -> *RFHgAN}
|
|
|
313 |
std::vector< XMLSchema::IXmlSchemaWrapperElement * > m_macFields;
|
|
|
314 |
//## end TransactionSpecification::macFields%4212DB3903B0.role
|
|
|
315 |
|
|
|
316 |
// Additional Private Declarations
|
|
|
317 |
//## begin TransactionSpecification%41F607FA0261.private preserve=yes
|
|
|
318 |
//## end TransactionSpecification%41F607FA0261.private
|
|
|
319 |
|
|
|
320 |
private: //## implementation
|
|
|
321 |
// Additional Implementation Declarations
|
|
|
322 |
//## begin TransactionSpecification%41F607FA0261.implementation preserve=yes
|
|
|
323 |
//## end TransactionSpecification%41F607FA0261.implementation
|
|
|
324 |
|
|
|
325 |
};
|
|
|
326 |
|
|
|
327 |
//## begin TransactionSpecification%41F607FA0261.postscript preserve=yes
|
|
|
328 |
//## end TransactionSpecification%41F607FA0261.postscript
|
|
|
329 |
|
|
|
330 |
// Class TransactionSpecification
|
|
|
331 |
|
|
|
332 |
//## begin module%41F607FA0261.epilog preserve=yes
|
|
|
333 |
//## end module%41F607FA0261.epilog
|
|
|
334 |
|
|
|
335 |
|
|
|
336 |
#endif
|