Subversion Repositories DevTools

Rev

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