| 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%420AC16002C1.cm preserve=no
|
|
|
7 |
//## end module%420AC16002C1.cm
|
|
|
8 |
|
|
|
9 |
//## begin module%420AC16002C1.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%420AC16002C1.cp
|
|
|
19 |
|
|
|
20 |
//## Module: FieldExpression%420AC16002C1; Pseudo Package specification
|
|
|
21 |
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
|
|
|
22 |
//## Source file: Z:\MASS_Dev\Tools\TxnTestManager\src\FieldExpression.h
|
|
|
23 |
|
|
|
24 |
#ifndef FieldExpression_h
|
|
|
25 |
#define FieldExpression_h 1
|
|
|
26 |
|
|
|
27 |
//## begin module%420AC16002C1.additionalIncludes preserve=no
|
|
|
28 |
//## end module%420AC16002C1.additionalIncludes
|
|
|
29 |
|
|
|
30 |
//## begin module%420AC16002C1.includes preserve=yes
|
|
|
31 |
//## end module%420AC16002C1.includes
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
class TransactionSpecification;
|
|
|
35 |
class EvaluationContext;
|
|
|
36 |
class DefinedVariable;
|
|
|
37 |
class DefinedVariableTable;
|
|
|
38 |
|
|
|
39 |
//## begin module%420AC16002C1.additionalDeclarations preserve=yes
|
|
|
40 |
#include <vector>
|
|
|
41 |
#include <string>
|
|
|
42 |
//## end module%420AC16002C1.additionalDeclarations
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
//## begin FieldExpression%420AC16002C1.preface preserve=yes
|
|
|
46 |
//## end FieldExpression%420AC16002C1.preface
|
|
|
47 |
|
|
|
48 |
//## Class: FieldExpression%420AC16002C1; private
|
|
|
49 |
// A class for representing expressions.
|
|
|
50 |
//## Category: TransactionTestManager::Symbol Table%4209C5C30033
|
|
|
51 |
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
|
|
|
52 |
//## Persistence: Transient
|
|
|
53 |
//## Cardinality/Multiplicity: n
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
//## Uses: <unnamed>%420AC4EA00CD;TransactionSpecification { -> F}
|
|
|
58 |
//## Uses: <unnamed>%420AD933029C;DefinedVariableTable { -> F}
|
|
|
59 |
//## Uses: <unnamed>%420AE38300AF;DefinedVariable { -> F}
|
|
|
60 |
//## Uses: <unnamed>%421176AC0366;EvaluationContext { -> F}
|
|
|
61 |
//## Uses: <unnamed>%421177FE00AB;Sequence { -> }
|
|
|
62 |
//## Uses: <unnamed>%42117819031C;SequenceCollection { -> }
|
|
|
63 |
//## Uses: <unnamed>%4211D98E031E;IMessageDigest { -> }
|
|
|
64 |
//## Uses: <unnamed>%42130E850275;XMLSchema::IXmlSchemaWrapperElement { -> }
|
|
|
65 |
//## Uses: <unnamed>%422EB8C202B5;ICryptographicServerProxy { -> }
|
|
|
66 |
|
|
|
67 |
class FieldExpression
|
|
|
68 |
{
|
|
|
69 |
//## begin FieldExpression%420AC16002C1.initialDeclarations preserve=yes
|
|
|
70 |
//## end FieldExpression%420AC16002C1.initialDeclarations
|
|
|
71 |
|
|
|
72 |
public:
|
|
|
73 |
//## Constructors (generated)
|
|
|
74 |
FieldExpression();
|
|
|
75 |
|
|
|
76 |
//## Constructors (specified)
|
|
|
77 |
//## Operation: FieldExpression%42105AAC0084
|
|
|
78 |
// A constructor that takes an expression.
|
|
|
79 |
FieldExpression (const std::string &expression // The expression.
|
|
|
80 |
);
|
|
|
81 |
|
|
|
82 |
//## Destructor (generated)
|
|
|
83 |
virtual ~FieldExpression();
|
|
|
84 |
|
|
|
85 |
|
|
|
86 |
//## Other Operations (specified)
|
|
|
87 |
//## Operation: evaluate%420456630303
|
|
|
88 |
// Evaluate the expression of this field, and evaluate to true, or to false
|
|
|
89 |
// when any expression cannot be evaluated.
|
|
|
90 |
const bool evaluate (std::string &value, // The resulting value.
|
|
|
91 |
const bool &sideEffect, // When true, evaluation is allowed to have side effects, otherwise side
|
|
|
92 |
// effects must be suppressed. For example, when true, a call to a sequence
|
|
|
93 |
// generator may allocate a new number from the sequence: when false, the call
|
|
|
94 |
// must not change the sate of the sequence generator.
|
|
|
95 |
//
|
|
|
96 |
// One usage of this: when generating a transaction side effects are allowed,
|
|
|
97 |
// when rendering the hint to display for a field value side effects are not
|
|
|
98 |
// allowed.
|
|
|
99 |
EvaluationContext& evaluationContext, // The evaluation context.
|
|
|
100 |
std::vector< DefinedVariable * > &path, // The evaluation path.
|
|
|
101 |
bool &postponed // Set the actual argument to true when evaluation is postponed, and to false
|
|
|
102 |
// otherwise.
|
|
|
103 |
);
|
|
|
104 |
|
|
|
105 |
//## Operation: getExpression%420AC68F02E4
|
|
|
106 |
// Evaluate to the expression of this instance.
|
|
|
107 |
const std::string & getExpression () const;
|
|
|
108 |
|
|
|
109 |
//## Operation: isFunctor%4209B773036F
|
|
|
110 |
// Evaluate to true when the given string is a functor, and to false when it is
|
|
|
111 |
// not.
|
|
|
112 |
static const bool isFunctor (const std::string &string // The string.
|
|
|
113 |
);
|
|
|
114 |
|
|
|
115 |
//## Operation: setExpression%420AC68F02F3
|
|
|
116 |
// Set the expression of this instance, and evaluate to the resulting value.
|
|
|
117 |
const std::string & setExpression (const std::string &value // The value.
|
|
|
118 |
);
|
|
|
119 |
|
|
|
120 |
// Additional Public Declarations
|
|
|
121 |
//## begin FieldExpression%420AC16002C1.public preserve=yes
|
|
|
122 |
//## end FieldExpression%420AC16002C1.public
|
|
|
123 |
|
|
|
124 |
protected:
|
|
|
125 |
// Additional Protected Declarations
|
|
|
126 |
//## begin FieldExpression%420AC16002C1.protected preserve=yes
|
|
|
127 |
//## end FieldExpression%420AC16002C1.protected
|
|
|
128 |
|
|
|
129 |
private:
|
|
|
130 |
//## Constructors (generated)
|
|
|
131 |
FieldExpression(const FieldExpression &right);
|
|
|
132 |
|
|
|
133 |
//## Assignment Operation (generated)
|
|
|
134 |
FieldExpression & operator=(const FieldExpression &right);
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
//## Other Operations (specified)
|
|
|
138 |
//## Operation: evaluateFunction%4208AE9D0216
|
|
|
139 |
// Evaluate the given function.
|
|
|
140 |
const bool evaluateFunction (std::istream &is, // The input stream.
|
|
|
141 |
std::string &value, // The resulting value.
|
|
|
142 |
std::string &symbol, // The variable.
|
|
|
143 |
const bool &sideEffect, // When true, evaluation is allowed to have side effects, otherwise side
|
|
|
144 |
// effects must be suppressed. For example, when true, a call to a sequence
|
|
|
145 |
// generator may allocate a new number from the sequence: when false, the call
|
|
|
146 |
// must not change the sate of the sequence generator.
|
|
|
147 |
//
|
|
|
148 |
// One usage of this: when generating a transaction side effects are allowed,
|
|
|
149 |
// when rendering the hint to display for a field value side effects are not
|
|
|
150 |
// allowed.
|
|
|
151 |
EvaluationContext& evaluationContext, // The evaluation context.
|
|
|
152 |
std::vector< DefinedVariable * > &path, // The evaluation path.
|
|
|
153 |
bool &postponed // Set the actual argument to true when evaluation is postponed, and to false
|
|
|
154 |
// otherwise.
|
|
|
155 |
);
|
|
|
156 |
|
|
|
157 |
//## Operation: evaluateVariable%420AE22101D7
|
|
|
158 |
// Evaluate the given variable.
|
|
|
159 |
const bool evaluateVariable (std::istream &is, // The input stream.
|
|
|
160 |
std::string &value, // The resulting value.
|
|
|
161 |
std::string &symbol, // The variable.
|
|
|
162 |
const bool &sideEffect, // When true, evaluation is allowed to have side effects, otherwise side
|
|
|
163 |
// effects must be suppressed. For example, when true, a call to a sequence
|
|
|
164 |
// generator may allocate a new number from the sequence: when false, the call
|
|
|
165 |
// must not change the sate of the sequence generator.
|
|
|
166 |
//
|
|
|
167 |
// One usage of this: when generating a transaction side effects are allowed,
|
|
|
168 |
// when rendering the hint to display for a field value side effects are not
|
|
|
169 |
// allowed.
|
|
|
170 |
EvaluationContext& evaluationContext, // The evaluation context.
|
|
|
171 |
std::vector< DefinedVariable * > &path, // The evaluation path.
|
|
|
172 |
bool &postponed // Set the actual argument to true when evaluation is postponed, and to false
|
|
|
173 |
// otherwise.
|
|
|
174 |
);
|
|
|
175 |
|
|
|
176 |
//## Operation: readIdentifier%42102FB70219
|
|
|
177 |
// Read an identifier from the input stream and evaluate to true, or to false
|
|
|
178 |
// when an identifier cannot be read.
|
|
|
179 |
static const bool readIdentifier (std::istream &is, // The input stream.
|
|
|
180 |
std::string &identifier // The identifier.
|
|
|
181 |
);
|
|
|
182 |
|
|
|
183 |
//## Operation: readTerm%420B0EB603D2
|
|
|
184 |
// Read a term from the input stream and evaluate to true, or to false when a
|
|
|
185 |
// term cannot be read.
|
|
|
186 |
static const bool readTerm (std::istream &is, // The input stream.
|
|
|
187 |
std::string &term // The term.
|
|
|
188 |
);
|
|
|
189 |
|
|
|
190 |
//## Operation: skipCharacter%420B100701E7
|
|
|
191 |
// Skip the given character from the input stream and evaluate to true, or to
|
|
|
192 |
// false when the given character is not found next in the input stream.
|
|
|
193 |
static const bool skipCharacter (std::istream &is, // The input stream.
|
|
|
194 |
const char &character // The character.
|
|
|
195 |
);
|
|
|
196 |
|
|
|
197 |
// Data Members for Class Attributes
|
|
|
198 |
|
|
|
199 |
//## Attribute: cachedValue%420B24A402FC
|
|
|
200 |
// The evaluated value of this expression. We can cache some expressions
|
|
|
201 |
// because their value is deterministic, so we do to speed up generation.
|
|
|
202 |
//## begin FieldExpression::cachedValue%420B24A402FC.attr preserve=no private: std::string {VA}
|
|
|
203 |
std::string m_cachedValue;
|
|
|
204 |
//## end FieldExpression::cachedValue%420B24A402FC.attr
|
|
|
205 |
|
|
|
206 |
//## Attribute: expression%420AC5F30189
|
|
|
207 |
// The expression.
|
|
|
208 |
//## begin FieldExpression::expression%420AC5F30189.attr preserve=no private: std::string {VA}
|
|
|
209 |
std::string m_expression;
|
|
|
210 |
//## end FieldExpression::expression%420AC5F30189.attr
|
|
|
211 |
|
|
|
212 |
// Additional Private Declarations
|
|
|
213 |
//## begin FieldExpression%420AC16002C1.private preserve=yes
|
|
|
214 |
//## end FieldExpression%420AC16002C1.private
|
|
|
215 |
|
|
|
216 |
private: //## implementation
|
|
|
217 |
// Additional Implementation Declarations
|
|
|
218 |
//## begin FieldExpression%420AC16002C1.implementation preserve=yes
|
|
|
219 |
//## end FieldExpression%420AC16002C1.implementation
|
|
|
220 |
|
|
|
221 |
};
|
|
|
222 |
|
|
|
223 |
//## begin FieldExpression%420AC16002C1.postscript preserve=yes
|
|
|
224 |
//## end FieldExpression%420AC16002C1.postscript
|
|
|
225 |
|
|
|
226 |
// Class FieldExpression
|
|
|
227 |
|
|
|
228 |
//## begin module%420AC16002C1.epilog preserve=yes
|
|
|
229 |
//## end module%420AC16002C1.epilog
|
|
|
230 |
|
|
|
231 |
|
|
|
232 |
#endif
|