Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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%4209C61A01F8.cm preserve=no
7
//## end module%4209C61A01F8.cm
8
 
9
//## begin module%4209C61A01F8.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%4209C61A01F8.cp
19
 
20
//## Module: DefinedVariable%4209C61A01F8; Pseudo Package body
21
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
22
//## Source file: Z:\MASS_Dev\Tools\TxnTestManager\src\DefinedVariable.cpp
23
 
24
//## begin module%4209C61A01F8.additionalIncludes preserve=no
25
//## end module%4209C61A01F8.additionalIncludes
26
 
27
//## begin module%4209C61A01F8.includes preserve=yes
28
#pragma warn -com
29
#include <LoggingMacros.h>
30
#pragma warn +com
31
//## end module%4209C61A01F8.includes
32
 
33
// TransactionSpecificationValue
34
#include "TransactionSpecificationValue.h"
35
// DefinedVariable
36
#include "DefinedVariable.h"
37
// EvaluationContext
38
#include "EvaluationContext.h"
39
//## begin module%4209C61A01F8.additionalDeclarations preserve=yes
40
#include <algorithm>
41
//## end module%4209C61A01F8.additionalDeclarations
42
 
43
 
44
// Class DefinedVariable 
45
 
46
//## Operation: DefinedVariable%4209CBCF00A3
47
DefinedVariable::DefinedVariable (const std::string &variableName)
48
  //## begin DefinedVariable::DefinedVariable%4209CBCF00A3.hasinit preserve=no
49
      : m_variableName(variableName)
50
  //## end DefinedVariable::DefinedVariable%4209CBCF00A3.hasinit
51
  //## begin DefinedVariable::DefinedVariable%4209CBCF00A3.initialization preserve=yes
52
  //## end DefinedVariable::DefinedVariable%4209CBCF00A3.initialization
53
{
54
  //## begin DefinedVariable::DefinedVariable%4209CBCF00A3.body preserve=yes
55
  //## end DefinedVariable::DefinedVariable%4209CBCF00A3.body
56
}
57
 
58
 
59
DefinedVariable::~DefinedVariable()
60
{
61
  //## begin DefinedVariable::~DefinedVariable%4209C61A01F8_dest.body preserve=yes
62
  //## end DefinedVariable::~DefinedVariable%4209C61A01F8_dest.body
63
}
64
 
65
 
66
 
67
//## Other Operations (implementation)
68
//## Operation: evaluate%420ACC990152
69
const bool DefinedVariable::evaluate (std::string &value, const bool &sideEffect, EvaluationContext& evaluationContext, std::vector< DefinedVariable * > &path, bool &postponed)
70
{
71
  //## begin DefinedVariable::evaluate%420ACC990152.body preserve=yes
72
 
73
	if ( std::find( path.begin(), path.end(), this ) == path.end() )
74
	{
75
		try
76
		{
77
			path.push_back( this );
78
 
79
			return ( m_expression.evaluate( value, sideEffect, evaluationContext, path, postponed ) );
80
		}
81
		__finally
82
		{
83
			path.pop_back();
84
		}
85
	}
86
	else
87
	{
88
		MERROR( "Cyclic definition found.  Cannot evaluate \"" \
89
			<< m_variableName \
90
			<< "\"." );
91
	}
92
 
93
	return ( false );
94
 
95
  //## end DefinedVariable::evaluate%420ACC990152.body
96
}
97
 
98
//## Operation: getExpression%420ACC82000A
99
const std::string & DefinedVariable::getExpression () const
100
{
101
  //## begin DefinedVariable::getExpression%420ACC82000A.body preserve=yes
102
 
103
	return ( m_expression.getExpression() );
104
 
105
  //## end DefinedVariable::getExpression%420ACC82000A.body
106
}
107
 
108
//## Operation: setExpression%420ACC82000B
109
const std::string & DefinedVariable::setExpression (const std::string &value)
110
{
111
  //## begin DefinedVariable::setExpression%420ACC82000B.body preserve=yes
112
 
113
	return ( m_expression.setExpression( value ) );
114
 
115
  //## end DefinedVariable::setExpression%420ACC82000B.body
116
}
117
 
118
// Additional Declarations
119
  //## begin DefinedVariable%4209C61A01F8.declarations preserve=yes
120
  //## end DefinedVariable%4209C61A01F8.declarations
121
 
122
//## begin module%4209C61A01F8.epilog preserve=yes
123
//## end module%4209C61A01F8.epilog