| 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%42103A8C03B7.cm preserve=no
|
|
|
7 |
//## end module%42103A8C03B7.cm
|
|
|
8 |
|
|
|
9 |
//## begin module%42103A8C03B7.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%42103A8C03B7.cp
|
|
|
19 |
|
|
|
20 |
//## Module: Sequence%42103A8C03B7; Pseudo Package body
|
|
|
21 |
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
|
|
|
22 |
//## Source file: Z:\MASS_Dev\Tools\TxnTestManager\src\Sequence.cpp
|
|
|
23 |
|
|
|
24 |
//## begin module%42103A8C03B7.additionalIncludes preserve=no
|
|
|
25 |
//## end module%42103A8C03B7.additionalIncludes
|
|
|
26 |
|
|
|
27 |
//## begin module%42103A8C03B7.includes preserve=yes
|
|
|
28 |
#pragma warn -com
|
|
|
29 |
#include <LoggingMacros.h>
|
|
|
30 |
#pragma warn +com
|
|
|
31 |
//## end module%42103A8C03B7.includes
|
|
|
32 |
|
|
|
33 |
// Sequence
|
|
|
34 |
#include "Sequence.h"
|
|
|
35 |
//## begin module%42103A8C03B7.additionalDeclarations preserve=yes
|
|
|
36 |
#include <algorithm>
|
|
|
37 |
//## end module%42103A8C03B7.additionalDeclarations
|
|
|
38 |
|
|
|
39 |
|
|
|
40 |
// Class Sequence
|
|
|
41 |
|
|
|
42 |
//## Operation: Sequence%421052120266
|
|
|
43 |
Sequence::Sequence (const std::string &name, const int &first)
|
|
|
44 |
//## begin Sequence::Sequence%421052120266.hasinit preserve=no
|
| 2267 |
kivins |
45 |
: m_dirty(false),
|
| 2263 |
kivins |
46 |
m_name(name),
|
|
|
47 |
m_persisted(false),
|
|
|
48 |
m_update(false),
|
|
|
49 |
m_value(0)
|
|
|
50 |
//## end Sequence::Sequence%421052120266.hasinit
|
|
|
51 |
//## begin Sequence::Sequence%421052120266.initialization preserve=yes
|
|
|
52 |
//## end Sequence::Sequence%421052120266.initialization
|
|
|
53 |
{
|
|
|
54 |
//## begin Sequence::Sequence%421052120266.body preserve=yes
|
|
|
55 |
|
|
|
56 |
m_value = first;
|
|
|
57 |
|
|
|
58 |
//## end Sequence::Sequence%421052120266.body
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
Sequence::~Sequence()
|
|
|
63 |
{
|
|
|
64 |
//## begin Sequence::~Sequence%42103A8C03B7_dest.body preserve=yes
|
|
|
65 |
//## end Sequence::~Sequence%42103A8C03B7_dest.body
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
//## Other Operations (implementation)
|
|
|
71 |
//## Operation: getName%4210536E010E
|
|
|
72 |
const std::string & Sequence::getName () const
|
|
|
73 |
{
|
|
|
74 |
//## begin Sequence::getName%4210536E010E.body preserve=yes
|
|
|
75 |
|
|
|
76 |
return ( m_name );
|
|
|
77 |
|
|
|
78 |
//## end Sequence::getName%4210536E010E.body
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
//## Operation: getValue%421052480350
|
|
|
82 |
const int & Sequence::getValue () const
|
|
|
83 |
{
|
|
|
84 |
//## begin Sequence::getValue%421052480350.body preserve=yes
|
|
|
85 |
|
|
|
86 |
return ( m_value );
|
|
|
87 |
|
|
|
88 |
//## end Sequence::getValue%421052480350.body
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
//## Operation: incrementValue%4210525D0208
|
|
|
92 |
const int & Sequence::incrementValue (const int &first, const int &last, const int &increment)
|
|
|
93 |
{
|
|
|
94 |
//## begin Sequence::incrementValue%4210525D0208.body preserve=yes
|
|
|
95 |
|
|
|
96 |
const int delta = increment % ( std::max< int >( first, last ) -
|
|
|
97 |
std::min< int >( first, last ) +
|
|
|
98 |
1 );
|
|
|
99 |
|
|
|
100 |
m_dirty = true;
|
|
|
101 |
|
|
|
102 |
if ( delta >= 0 )
|
|
|
103 |
{
|
|
|
104 |
if ( last - delta < m_value )
|
|
|
105 |
{
|
|
|
106 |
return ( m_value = first + ( delta - ( last - m_value + 1 ) ) );
|
|
|
107 |
}
|
|
|
108 |
}
|
|
|
109 |
else
|
|
|
110 |
{
|
|
|
111 |
if ( first - delta > m_value )
|
|
|
112 |
{
|
|
|
113 |
return ( m_value = last + ( delta + ( m_value - first + 1 ) ) );
|
|
|
114 |
}
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
return ( m_value += delta );
|
|
|
118 |
|
|
|
119 |
//## end Sequence::incrementValue%4210525D0208.body
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
//## Operation: isDirty%421199D5032E
|
|
|
123 |
const bool Sequence::isDirty () const
|
|
|
124 |
{
|
|
|
125 |
//## begin Sequence::isDirty%421199D5032E.body preserve=yes
|
|
|
126 |
|
|
|
127 |
return ( m_dirty );
|
|
|
128 |
|
|
|
129 |
//## end Sequence::isDirty%421199D5032E.body
|
|
|
130 |
}
|
|
|
131 |
|
|
|
132 |
//## Operation: isPersisted%4210531902B4
|
|
|
133 |
const bool & Sequence::isPersisted () const
|
|
|
134 |
{
|
|
|
135 |
//## begin Sequence::isPersisted%4210531902B4.body preserve=yes
|
|
|
136 |
|
|
|
137 |
return ( m_persisted );
|
|
|
138 |
|
|
|
139 |
//## end Sequence::isPersisted%4210531902B4.body
|
|
|
140 |
}
|
|
|
141 |
|
|
|
142 |
//## Operation: isUpdate%421053450227
|
|
|
143 |
const bool & Sequence::isUpdate () const
|
|
|
144 |
{
|
|
|
145 |
//## begin Sequence::isUpdate%421053450227.body preserve=yes
|
|
|
146 |
|
|
|
147 |
return ( m_update );
|
|
|
148 |
|
|
|
149 |
//## end Sequence::isUpdate%421053450227.body
|
|
|
150 |
}
|
|
|
151 |
|
|
|
152 |
//## Operation: setDirty%42119A580277
|
|
|
153 |
void Sequence::setDirty (const bool &value)
|
|
|
154 |
{
|
|
|
155 |
//## begin Sequence::setDirty%42119A580277.body preserve=yes
|
|
|
156 |
|
|
|
157 |
m_dirty = value;
|
|
|
158 |
|
|
|
159 |
//## end Sequence::setDirty%42119A580277.body
|
|
|
160 |
}
|
|
|
161 |
|
|
|
162 |
//## Operation: setPersist%421053B501D9
|
|
|
163 |
const bool & Sequence::setPersist (const bool &value)
|
|
|
164 |
{
|
|
|
165 |
//## begin Sequence::setPersist%421053B501D9.body preserve=yes
|
|
|
166 |
|
|
|
167 |
return ( m_persisted = value );
|
|
|
168 |
|
|
|
169 |
//## end Sequence::setPersist%421053B501D9.body
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
//## Operation: setUpdate%42105401020D
|
|
|
173 |
const bool & Sequence::setUpdate (const bool &value)
|
|
|
174 |
{
|
|
|
175 |
//## begin Sequence::setUpdate%42105401020D.body preserve=yes
|
|
|
176 |
|
|
|
177 |
return ( m_update = value );
|
|
|
178 |
|
|
|
179 |
//## end Sequence::setUpdate%42105401020D.body
|
|
|
180 |
}
|
|
|
181 |
|
|
|
182 |
//## Operation: setValue%421053980341
|
|
|
183 |
const int & Sequence::setValue (const int &value)
|
|
|
184 |
{
|
|
|
185 |
//## begin Sequence::setValue%421053980341.body preserve=yes
|
|
|
186 |
|
|
|
187 |
return ( m_value = value );
|
|
|
188 |
|
|
|
189 |
//## end Sequence::setValue%421053980341.body
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
// Additional Declarations
|
|
|
193 |
//## begin Sequence%42103A8C03B7.declarations preserve=yes
|
|
|
194 |
//## end Sequence%42103A8C03B7.declarations
|
|
|
195 |
|
|
|
196 |
//## begin module%42103A8C03B7.epilog preserve=yes
|
|
|
197 |
//## end module%42103A8C03B7.epilog
|