Subversion Repositories DevTools

Rev

Rev 2222 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2222 Rev 2224
Line 28... Line 28...
28
#pragma warn -com
28
#pragma warn -com
29
#include <LoggingMacros.h>
29
#include <LoggingMacros.h>
30
#pragma warn +com
30
#pragma warn +com
31
//## end module%42030C2C00B8.includes
31
//## end module%42030C2C00B8.includes
32
 
32
 
-
 
33
// Iteration
-
 
34
#include "Iteration.h"
-
 
35
// TestScenario
-
 
36
#include "TestScenario.h"
33
// TransactionSpecification
37
// TransactionSpecification
34
#include "TransactionSpecification.h"
38
#include "TransactionSpecification.h"
35
// EvaluationContext
39
// EvaluationContext
36
#include "EvaluationContext.h"
40
#include "EvaluationContext.h"
37
// TransactionStream
41
// TransactionStream
38
#include "TransactionStream.h"
42
#include "TransactionStream.h"
39
// Iteration
-
 
40
#include "Iteration.h"
-
 
41
// TestScenario
43
// DefinedVariable
42
#include "TestScenario.h"
44
#include "DefinedVariable.h"
43
//## begin module%42030C2C00B8.additionalDeclarations preserve=yes
45
//## begin module%42030C2C00B8.additionalDeclarations preserve=yes
44
#include <locale>
46
#include <locale>
45
//## end module%42030C2C00B8.additionalDeclarations
47
//## end module%42030C2C00B8.additionalDeclarations
46
 
48
 
47
 
49
 
Line 108... Line 110...
108
	return ( batchName );
110
	return ( batchName );
109
 
111
 
110
  //## end TestScenario::buildBatchName%4208537A00B6.body
112
  //## end TestScenario::buildBatchName%4208537A00B6.body
111
}
113
}
112
 
114
 
-
 
115
//## Operation: defineVariable%425B47DD004F
-
 
116
DefinedVariable& TestScenario::defineVariable (const std::string &variableName)
-
 
117
{
-
 
118
  //## begin TestScenario::defineVariable%425B47DD004F.body preserve=yes
-
 
119
 
-
 
120
	std::map< std::string, DefinedVariable * >::const_iterator
-
 
121
		instance = m_variable.find( variableName );
-
 
122
 
-
 
123
	if ( instance != m_variable.end() )
-
 
124
	{
-
 
125
		return ( *instance->second );
-
 
126
	}
-
 
127
	else
-
 
128
	{
-
 
129
		DefinedVariable * object = 0;
-
 
130
 
-
 
131
		try
-
 
132
		{
-
 
133
			object = new DefinedVariable( variableName );
-
 
134
 
-
 
135
			if ( m_variable.insert(
-
 
136
					std::map< std::string, DefinedVariable * >::value_type(
-
 
137
						variableName,
-
 
138
						object ) ).second )
-
 
139
			{
-
 
140
				return ( *object );
-
 
141
			}
-
 
142
			else
-
 
143
			{
-
 
144
				MTHROW( std::runtime_error, \
-
 
145
					"Cannot add variable \"" \
-
 
146
					<< variableName \
-
 
147
					<< "\" to defined variable table." );
-
 
148
			}
-
 
149
		}
-
 
150
		catch ( ... )
-
 
151
		{
-
 
152
			delete object;
-
 
153
			object = 0;
-
 
154
 
-
 
155
			throw;
-
 
156
		}
-
 
157
	}
-
 
158
 
-
 
159
  //## end TestScenario::defineVariable%425B47DD004F.body
-
 
160
}
-
 
161
 
113
//## Operation: generate%420455D80390
162
//## Operation: generate%420455D80390
114
const bool TestScenario::generate (TransactionStream& stream, const bool &generateHeaders, EvaluationContext& evaluationContext)
163
const bool TestScenario::generate (TransactionStream& stream, const bool &generateHeaders, EvaluationContext& evaluationContext)
115
{
164
{
116
  //## begin TestScenario::generate%420455D80390.body preserve=yes
165
  //## begin TestScenario::generate%420455D80390.body preserve=yes
117
 
166
 
Line 156... Line 205...
156
 
205
 
157
  //## end TestScenario::getBatchSize%42042C5E0029.body
206
  //## end TestScenario::getBatchSize%42042C5E0029.body
158
}
207
}
159
 
208
 
160
//## Operation: getIteration%420460EA003C
209
//## Operation: getIteration%420460EA003C
161
const Iteration& TestScenario::getIteration () const
210
const Iteration & TestScenario::getIteration () const
162
{
211
{
163
  //## begin TestScenario::getIteration%420460EA003C.body preserve=yes
212
  //## begin TestScenario::getIteration%420460EA003C.body preserve=yes
164
 
213
 
165
	return ( *m_iteration );  
214
	return ( *m_iteration );  
166
 
215
 
Line 255... Line 304...
255
	}
304
	}
256
 
305
 
257
  //## end TestScenario::getTransactionSpecification%420328E00043.body
306
  //## end TestScenario::getTransactionSpecification%420328E00043.body
258
}
307
}
259
 
308
 
-
 
309
//## Operation: getVariable%425B47F50012
-
 
310
DefinedVariable& TestScenario::getVariable (const std::string &variableName)
-
 
311
{
-
 
312
  //## begin TestScenario::getVariable%425B47F50012.body preserve=yes
-
 
313
 
-
 
314
	std::map< std::string, DefinedVariable * >::const_iterator
-
 
315
		instance = m_variable.find( variableName );
-
 
316
 
-
 
317
	if ( instance != m_variable.end() )
-
 
318
	{
-
 
319
		return ( *instance->second );
-
 
320
	}
-
 
321
	
-
 
322
	MTHROW( std::runtime_error, \
-
 
323
		"Variable \"" \
-
 
324
		<< variableName \
-
 
325
		<< "\" is not defined." );
-
 
326
 
-
 
327
  //## end TestScenario::getVariable%425B47F50012.body
-
 
328
}
-
 
329
 
-
 
330
//## Operation: isVariable%425B4B6A01C1
-
 
331
const bool TestScenario::isVariable (const std::string &symbol) const
-
 
332
{
-
 
333
  //## begin TestScenario::isVariable%425B4B6A01C1.body preserve=yes
-
 
334
 
-
 
335
	return ( m_variable.find( symbol ) != m_variable.end() );
-
 
336
 
-
 
337
  //## end TestScenario::isVariable%425B4B6A01C1.body
-
 
338
}
-
 
339
 
260
//## Operation: setBatchSize%42042CF100D5
340
//## Operation: setBatchSize%42042CF100D5
261
const unsigned & TestScenario::setBatchSize (const unsigned &value)
341
const unsigned & TestScenario::setBatchSize (const unsigned &value)
262
{
342
{
263
  //## begin TestScenario::setBatchSize%42042CF100D5.body preserve=yes
343
  //## begin TestScenario::setBatchSize%42042CF100D5.body preserve=yes
264
 
344