Subversion Repositories DevTools

Rev

Rev 2218 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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