Subversion Repositories DevTools

Rev

Rev 2218 | 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%42030C2C00B8.cm preserve=no
7
//## end module%42030C2C00B8.cm
8
 
9
//## begin module%42030C2C00B8.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%42030C2C00B8.cp
19
 
20
//## Module: TestScenario%42030C2C00B8; Pseudo Package specification
21
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
22
//## Source file: Z:\MASS_Dev\Tools\TxnTestManager\src\TestScenario.h
23
 
24
#ifndef TestScenario_h
25
#define TestScenario_h 1
26
 
27
//## begin module%42030C2C00B8.additionalIncludes preserve=no
28
//## end module%42030C2C00B8.additionalIncludes
29
 
30
//## begin module%42030C2C00B8.includes preserve=yes
31
#include <map>
32
#include <vector>
33
//## end module%42030C2C00B8.includes
34
 
35
 
2224 sbetterm 36
class Iteration;
2218 sbetterm 37
class TransactionSpecification;
38
class EvaluationContext;
39
class TransactionStream;
2224 sbetterm 40
class DefinedVariable;
2218 sbetterm 41
 
42
//## begin module%42030C2C00B8.additionalDeclarations preserve=yes
43
//## end module%42030C2C00B8.additionalDeclarations
44
 
45
 
46
//## begin TestScenario%42030C2C00B8.preface preserve=yes
47
//## end TestScenario%42030C2C00B8.preface
48
 
49
//## Class: TestScenario%42030C2C00B8; private
50
//	A test scenario.
51
//## Category: TransactionTestManager::Transaction Generation%4202F8EE0128
52
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
53
//## Persistence: Transient
54
//## Cardinality/Multiplicity: n
55
 
56
 
57
 
58
//## Uses: <unnamed>%42081A9901FD;TransactionStream { -> F}
59
//## Uses: <unnamed>%421173580036;EvaluationContext { -> F}
60
 
61
class TestScenario 
62
{
63
  //## begin TestScenario%42030C2C00B8.initialDeclarations preserve=yes
64
  //## end TestScenario%42030C2C00B8.initialDeclarations
65
 
66
  public:
67
    //## Constructors (specified)
68
      //## Operation: TestScenario%4203231D030E
69
      //	The only constructor.
70
      TestScenario (const int &scenario, 	// The primary key of the scenario.
71
      Iteration& iteration	// The iteration for which this object is defined.  While we do not accept
72
      	// ownership over this instance, we do assume its validity for the remainder
73
      	// of our lifetime.
74
      );
75
 
76
    //## Destructor (generated)
77
      virtual ~TestScenario();
78
 
79
 
80
    //## Other Operations (specified)
2224 sbetterm 81
      //## Operation: defineVariable%425B47DD004F
82
      //	Define the given variable and evaluate to it.
83
      DefinedVariable& defineVariable (const std::string &variableName	// The name of the variable.
84
      );
85
 
2218 sbetterm 86
      //## Operation: generate%420455D80390
87
      //	Generate the transactions defined for this scenario and evaluate to true, or
88
      //	to false when any transaction cannot be generated.
89
      const bool generate (TransactionStream& stream, 	// The stream into which to generate.
90
      const bool &generateHeaders, 	// When true, the transaction stream contains transaction header.  Otherwise,
91
      	// the transaction steam does not contain transaction headers.
92
      EvaluationContext& evaluationContext	// The evaluation context.
93
      );
94
 
95
      //## Operation: getBatchSize%42042C5E0029
96
      //	Evaluate to the number of transactions contained in a batch.
97
      const unsigned & getBatchSize () const;
98
 
99
      //## Operation: getIteration%420460EA003C
100
      //	Evaluate to the iteration for which this scenario is defined.
2224 sbetterm 101
      const Iteration & getIteration () const;
2218 sbetterm 102
 
103
      //## Operation: getRepeatCount%42042C5D02F8
104
      //	Evaluate to the number of times that this scenario is played into the
105
      //	transaction stream.
106
      const unsigned & getRepeatCount () const;
107
 
108
      //## Operation: getScenarioName%42084D3A0270
109
      //	Get the scenario name.
110
      const std::string & getScenarioName () const;
111
 
112
      //## Operation: getScenarioNumber%4203252300A6
113
      //	Evaluate to the scenario number of this instance.
114
      const int & getScenarioNumber () const;
115
 
116
      //## Operation: getTransactionCount%420890BF03BE
117
      //	Evaluate to the number of transactions in this scenario multiplied by the
118
      //	repeat count.
119
      const unsigned getTransactionCount () const;
120
 
121
      //## Operation: getTransactionSpecification%420328E00043
122
      //	Evaluate to the given transaction.  When the transaction doesn't already
123
      //	exist, create it.
124
      TransactionSpecification& getTransactionSpecification (const int &transaction, 	// The identity of the transaction.
125
      const std::string &payloadStructureName	// The name of the structure that describes the payload of this transaction.
126
      );
127
 
2224 sbetterm 128
      //## Operation: getVariable%425B47F50012
129
      //	Evaluate to the given variable.
130
      DefinedVariable& getVariable (const std::string &variableName	// The name of the variable.
131
      );
132
 
133
      //## Operation: isVariable%425B4B6A01C1
134
      //	Evaluate to true when the given symbol is a variable, otherwise evaluate to
135
      //	false.
136
      const bool isVariable (const std::string &symbol	// The symbol.
137
      ) const;
138
 
2218 sbetterm 139
      //## Operation: setBatchSize%42042CF100D5
140
      //	Set the batch size and evaluate to the resulting value.
141
      const unsigned & setBatchSize (const unsigned &value	// The value.
142
      );
143
 
144
      //## Operation: setRepeatCount%42042CF100E5
145
      //	Set the repeat count and evaluate to the resulting value.
146
      const unsigned & setRepeatCount (const unsigned &value	// The value.
147
      );
148
 
149
      //## Operation: setScenarioName%42084D300222
150
      //	Set the scenario name, and evaluate to it.
151
      std::string & setScenarioName (const std::string &value	// The scenario name.
152
      );
153
 
154
    // Additional Public Declarations
155
      //## begin TestScenario%42030C2C00B8.public preserve=yes
156
      //## end TestScenario%42030C2C00B8.public
157
 
158
  protected:
159
    // Additional Protected Declarations
160
      //## begin TestScenario%42030C2C00B8.protected preserve=yes
161
      //## end TestScenario%42030C2C00B8.protected
162
 
163
  private:
164
    //## Constructors (generated)
165
      TestScenario();
166
 
167
      TestScenario(const TestScenario &right);
168
 
169
    //## Assignment Operation (generated)
170
      TestScenario & operator=(const TestScenario &right);
171
 
172
 
173
    //## Other Operations (specified)
174
      //## Operation: buildBatchName%4208537A00B6
175
      //	Build a batch name from the given scenario name and evaluate to it.
176
      std::string & buildBatchName (std::string &batchName, 	// The value to which this method evaluates.
177
      const std::string &scenarioName	// The scenario name.
178
      );
179
 
180
    // Data Members for Class Attributes
181
 
182
      //## Attribute: batchSize%42042D510058
183
      //	The number of transactions in a batch.
184
      //## begin TestScenario::batchSize%42042D510058.attr preserve=no  private: unsigned {VA} 0
185
      unsigned m_batchSize;
186
      //## end TestScenario::batchSize%42042D510058.attr
187
 
188
      //## Attribute: repeatCount%42042D6D0029
189
      //	The number of times that this scenario is played into the transaction stream.
190
      //## begin TestScenario::repeatCount%42042D6D0029.attr preserve=no  private: unsigned {VA} 0
191
      unsigned m_repeatCount;
192
      //## end TestScenario::repeatCount%42042D6D0029.attr
193
 
194
      //## Attribute: scenario%4203255B026B
195
      //	The transaction specification number of this transaction.
196
      //## begin TestScenario::scenario%4203255B026B.attr preserve=no  private: int {VAC} 
197
      const int m_scenario;
198
      //## end TestScenario::scenario%4203255B026B.attr
199
 
200
      //## Attribute: scenarioName%42084D0601B5
201
      //	The name of this scenario.
202
      //## begin TestScenario::scenarioName%42084D0601B5.attr preserve=no  private: std::string {VA} 
203
      std::string m_scenarioName;
204
      //## end TestScenario::scenarioName%42084D0601B5.attr
205
 
206
    // Data Members for Associations
207
 
208
      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%42030C7F020F
209
      //## Role: TestScenario::transaction%42030C7F0396
210
      //	The collection of transactions of this scenario.
211
      //## Qualifier: transaction%42030C89001B; int
212
      //	The primary key of the transaction.
213
      //## begin TestScenario::transaction%42030C7F0396.role preserve=no  private: TransactionSpecification {1 -> 1RFHgAN}
214
      std::map<int, TransactionSpecification *> m_transaction;
215
      //## end TestScenario::transaction%42030C7F0396.role
216
 
217
      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%42044D9F011B
218
      //## Role: TestScenario::iteration%42044DA00060
219
      //	The iteration for which this object is defined.  While we do not accept
220
      //	ownership over this instance, we do assume its validity for the remainder of
221
      //	our lifetime.
222
      //## begin TestScenario::iteration%42044DA00060.role preserve=no  private: Iteration {1 -> 1RFHAN}
223
      Iteration *m_iteration;
224
      //## end TestScenario::iteration%42044DA00060.role
225
 
226
      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%42071055018B
227
      //## Role: TestScenario::orderedTransactionCollection%4207105502F2
228
      //	The collection of transactions in generation order.
229
      //## begin TestScenario::orderedTransactionCollection%4207105502F2.role preserve=no  private: TransactionSpecification {1 -> *RFHAN}
230
      std::vector< TransactionSpecification * > m_orderedTransactionCollection;
231
      //## end TestScenario::orderedTransactionCollection%4207105502F2.role
232
 
2224 sbetterm 233
      //## Association: TransactionTestManager::Symbol Table::<unnamed>%425B3A290039
234
      //## Role: TestScenario::variable%425B3A29023D
235
      //	The collection of variables defined for this scneario.
236
      //## Qualifier: variableName%425B3A580384; std::string
237
      //	The name of the variable.
238
      //## begin TestScenario::variable%425B3A29023D.role preserve=no  private: DefinedVariable {1 -> 1RFHgAN}
239
      std::map<std::string, DefinedVariable *> m_variable;
240
      //## end TestScenario::variable%425B3A29023D.role
241
 
2218 sbetterm 242
    // Additional Private Declarations
243
      //## begin TestScenario%42030C2C00B8.private preserve=yes
244
      //## end TestScenario%42030C2C00B8.private
245
 
246
  private: //## implementation
247
    // Additional Implementation Declarations
248
      //## begin TestScenario%42030C2C00B8.implementation preserve=yes
249
      //## end TestScenario%42030C2C00B8.implementation
250
 
251
};
252
 
253
//## begin TestScenario%42030C2C00B8.postscript preserve=yes
254
//## end TestScenario%42030C2C00B8.postscript
255
 
256
// Class TestScenario 
257
 
258
//## begin module%42030C2C00B8.epilog preserve=yes
259
//## end module%42030C2C00B8.epilog
260
 
261
 
262
#endif