| 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%4209C5FB02C3.cm preserve=no
|
|
|
7 |
//## end module%4209C5FB02C3.cm
|
|
|
8 |
|
|
|
9 |
//## begin module%4209C5FB02C3.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%4209C5FB02C3.cp
|
|
|
19 |
|
|
|
20 |
//## Module: DefinedVariableTable%4209C5FB02C3; Pseudo Package body
|
|
|
21 |
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
|
|
|
22 |
//## Source file: Z:\MASS_Dev\Tools\TxnTestManager\src\DefinedVariableTable.cpp
|
|
|
23 |
|
|
|
24 |
//## begin module%4209C5FB02C3.additionalIncludes preserve=no
|
|
|
25 |
//## end module%4209C5FB02C3.additionalIncludes
|
|
|
26 |
|
|
|
27 |
//## begin module%4209C5FB02C3.includes preserve=yes
|
|
|
28 |
#pragma warn -com
|
|
|
29 |
#include <LoggingMacros.h>
|
|
|
30 |
#pragma warn +com
|
|
|
31 |
//## end module%4209C5FB02C3.includes
|
|
|
32 |
|
|
|
33 |
// DefinedVariable
|
|
|
34 |
#include "DefinedVariable.h"
|
|
|
35 |
// DefinedVariableTable
|
|
|
36 |
#include "DefinedVariableTable.h"
|
|
|
37 |
//## begin module%4209C5FB02C3.additionalDeclarations preserve=yes
|
|
|
38 |
//## end module%4209C5FB02C3.additionalDeclarations
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
// Class DefinedVariableTable
|
|
|
42 |
|
|
|
43 |
DefinedVariableTable::DefinedVariableTable()
|
|
|
44 |
//## begin DefinedVariableTable::DefinedVariableTable%4209C5FB02C3_const.initialization preserve=yes
|
|
|
45 |
//## end DefinedVariableTable::DefinedVariableTable%4209C5FB02C3_const.initialization
|
|
|
46 |
{
|
|
|
47 |
//## begin DefinedVariableTable::DefinedVariableTable%4209C5FB02C3_const.body preserve=yes
|
|
|
48 |
//## end DefinedVariableTable::DefinedVariableTable%4209C5FB02C3_const.body
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
DefinedVariableTable::~DefinedVariableTable()
|
|
|
53 |
{
|
|
|
54 |
//## begin DefinedVariableTable::~DefinedVariableTable%4209C5FB02C3_dest.body preserve=yes
|
|
|
55 |
|
|
|
56 |
clear();
|
|
|
57 |
|
|
|
58 |
//## end DefinedVariableTable::~DefinedVariableTable%4209C5FB02C3_dest.body
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
//## Other Operations (implementation)
|
|
|
64 |
//## Operation: clear%4209C916032F
|
|
|
65 |
void DefinedVariableTable::clear ()
|
|
|
66 |
{
|
|
|
67 |
//## begin DefinedVariableTable::clear%4209C916032F.body preserve=yes
|
|
|
68 |
|
|
|
69 |
for ( std::map< std::string, DefinedVariable * >::iterator
|
|
|
70 |
where = m_variable.begin();
|
|
|
71 |
where != m_variable.end();
|
|
|
72 |
++where )
|
|
|
73 |
{
|
|
|
74 |
delete where->second;
|
|
|
75 |
where->second = 0;
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
//## end DefinedVariableTable::clear%4209C916032F.body
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
//## Operation: getDefinedVariable%4209C7770264
|
|
|
82 |
DefinedVariable& DefinedVariableTable::getDefinedVariable (const std::string &variableName)
|
|
|
83 |
{
|
|
|
84 |
//## begin DefinedVariableTable::getDefinedVariable%4209C7770264.body preserve=yes
|
|
|
85 |
|
|
|
86 |
std::map< std::string, DefinedVariable * >::const_iterator
|
|
|
87 |
instance = m_variable.find( variableName );
|
|
|
88 |
|
|
|
89 |
if ( instance != m_variable.end() )
|
|
|
90 |
{
|
|
|
91 |
return ( *instance->second );
|
|
|
92 |
}
|
|
|
93 |
else
|
|
|
94 |
{
|
|
|
95 |
DefinedVariable * object = 0;
|
|
|
96 |
|
|
|
97 |
try
|
|
|
98 |
{
|
|
|
99 |
object = new DefinedVariable( variableName );
|
|
|
100 |
|
|
|
101 |
if ( m_variable.insert(
|
|
|
102 |
std::map< std::string, DefinedVariable * >::value_type(
|
|
|
103 |
variableName,
|
|
|
104 |
object ) ).second )
|
|
|
105 |
{
|
|
|
106 |
return ( *object );
|
|
|
107 |
}
|
|
|
108 |
else
|
|
|
109 |
{
|
|
|
110 |
MTHROW( std::runtime_error, \
|
|
|
111 |
"Cannot add variable \"" \
|
|
|
112 |
<< variableName \
|
|
|
113 |
<< "\" to defined variable table." );
|
|
|
114 |
}
|
|
|
115 |
}
|
|
|
116 |
catch ( ... )
|
|
|
117 |
{
|
|
|
118 |
delete object;
|
|
|
119 |
object = 0;
|
|
|
120 |
|
|
|
121 |
throw;
|
|
|
122 |
}
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
//## end DefinedVariableTable::getDefinedVariable%4209C7770264.body
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
//## Operation: isVariable%420ACFBB01CE
|
|
|
129 |
const bool DefinedVariableTable::isVariable (const std::string &symbol) const
|
|
|
130 |
{
|
|
|
131 |
//## begin DefinedVariableTable::isVariable%420ACFBB01CE.body preserve=yes
|
|
|
132 |
|
|
|
133 |
return ( m_variable.find( symbol ) != m_variable.end() );
|
|
|
134 |
|
|
|
135 |
//## end DefinedVariableTable::isVariable%420ACFBB01CE.body
|
|
|
136 |
}
|
|
|
137 |
|
|
|
138 |
// Additional Declarations
|
|
|
139 |
//## begin DefinedVariableTable%4209C5FB02C3.declarations preserve=yes
|
|
|
140 |
//## end DefinedVariableTable%4209C5FB02C3.declarations
|
|
|
141 |
|
|
|
142 |
//## begin module%4209C5FB02C3.epilog preserve=yes
|
|
|
143 |
//## end module%4209C5FB02C3.epilog
|