xref: /aosp_15_r20/external/deqp/framework/randomshaders/rsgVariableValue.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1*35238bceSAndroid Build Coastguard Worker /*-------------------------------------------------------------------------
2*35238bceSAndroid Build Coastguard Worker  * drawElements Quality Program Random Shader Generator
3*35238bceSAndroid Build Coastguard Worker  * ----------------------------------------------------
4*35238bceSAndroid Build Coastguard Worker  *
5*35238bceSAndroid Build Coastguard Worker  * Copyright 2014 The Android Open Source Project
6*35238bceSAndroid Build Coastguard Worker  *
7*35238bceSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
8*35238bceSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
9*35238bceSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
10*35238bceSAndroid Build Coastguard Worker  *
11*35238bceSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
12*35238bceSAndroid Build Coastguard Worker  *
13*35238bceSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
14*35238bceSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
15*35238bceSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16*35238bceSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
17*35238bceSAndroid Build Coastguard Worker  * limitations under the License.
18*35238bceSAndroid Build Coastguard Worker  *
19*35238bceSAndroid Build Coastguard Worker  *//*!
20*35238bceSAndroid Build Coastguard Worker  * \file
21*35238bceSAndroid Build Coastguard Worker  * \brief Variable Value class.
22*35238bceSAndroid Build Coastguard Worker  *//*--------------------------------------------------------------------*/
23*35238bceSAndroid Build Coastguard Worker 
24*35238bceSAndroid Build Coastguard Worker #include "rsgVariableValue.hpp"
25*35238bceSAndroid Build Coastguard Worker 
26*35238bceSAndroid Build Coastguard Worker namespace rsg
27*35238bceSAndroid Build Coastguard Worker {
28*35238bceSAndroid Build Coastguard Worker 
29*35238bceSAndroid Build Coastguard Worker namespace
30*35238bceSAndroid Build Coastguard Worker {
31*35238bceSAndroid Build Coastguard Worker 
32*35238bceSAndroid Build Coastguard Worker template <class CompareOp>
compareValueRangesAllTrue(const ConstValueRangeAccess & a,const ConstValueRangeAccess & b)33*35238bceSAndroid Build Coastguard Worker bool compareValueRangesAllTrue(const ConstValueRangeAccess &a, const ConstValueRangeAccess &b)
34*35238bceSAndroid Build Coastguard Worker {
35*35238bceSAndroid Build Coastguard Worker     DE_ASSERT(a.getType() == b.getType());
36*35238bceSAndroid Build Coastguard Worker 
37*35238bceSAndroid Build Coastguard Worker     if (a.getType().isStruct())
38*35238bceSAndroid Build Coastguard Worker     {
39*35238bceSAndroid Build Coastguard Worker         int numMembers = (int)a.getType().getMembers().size();
40*35238bceSAndroid Build Coastguard Worker         for (int ndx = 0; ndx < numMembers; ndx++)
41*35238bceSAndroid Build Coastguard Worker         {
42*35238bceSAndroid Build Coastguard Worker             if (!compareValueRangesAllTrue<CompareOp>(a.member(ndx), b.member(ndx)))
43*35238bceSAndroid Build Coastguard Worker                 return false;
44*35238bceSAndroid Build Coastguard Worker         }
45*35238bceSAndroid Build Coastguard Worker     }
46*35238bceSAndroid Build Coastguard Worker     else if (a.getType().isArray())
47*35238bceSAndroid Build Coastguard Worker     {
48*35238bceSAndroid Build Coastguard Worker         int numElements = (int)a.getType().getNumElements();
49*35238bceSAndroid Build Coastguard Worker         for (int ndx = 0; ndx < numElements; ndx++)
50*35238bceSAndroid Build Coastguard Worker         {
51*35238bceSAndroid Build Coastguard Worker             if (!compareValueRangesAllTrue<CompareOp>(a.arrayElement(ndx), b.arrayElement(ndx)))
52*35238bceSAndroid Build Coastguard Worker                 return false;
53*35238bceSAndroid Build Coastguard Worker         }
54*35238bceSAndroid Build Coastguard Worker     }
55*35238bceSAndroid Build Coastguard Worker     else
56*35238bceSAndroid Build Coastguard Worker     {
57*35238bceSAndroid Build Coastguard Worker         int numElements = (int)a.getType().getNumElements();
58*35238bceSAndroid Build Coastguard Worker         switch (a.getType().getBaseType())
59*35238bceSAndroid Build Coastguard Worker         {
60*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_FLOAT:
61*35238bceSAndroid Build Coastguard Worker             for (int ndx = 0; ndx < numElements; ndx++)
62*35238bceSAndroid Build Coastguard Worker             {
63*35238bceSAndroid Build Coastguard Worker                 float aMin = a.component(ndx).getMin().asFloat();
64*35238bceSAndroid Build Coastguard Worker                 float aMax = a.component(ndx).getMax().asFloat();
65*35238bceSAndroid Build Coastguard Worker                 float bMin = b.component(ndx).getMin().asFloat();
66*35238bceSAndroid Build Coastguard Worker                 float bMax = b.component(ndx).getMax().asFloat();
67*35238bceSAndroid Build Coastguard Worker 
68*35238bceSAndroid Build Coastguard Worker                 if (!CompareOp()(aMin, aMax, bMin, bMax))
69*35238bceSAndroid Build Coastguard Worker                     return false;
70*35238bceSAndroid Build Coastguard Worker             }
71*35238bceSAndroid Build Coastguard Worker             break;
72*35238bceSAndroid Build Coastguard Worker 
73*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_INT:
74*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_SAMPLER_2D:
75*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_SAMPLER_CUBE:
76*35238bceSAndroid Build Coastguard Worker             for (int ndx = 0; ndx < numElements; ndx++)
77*35238bceSAndroid Build Coastguard Worker             {
78*35238bceSAndroid Build Coastguard Worker                 int aMin = a.component(ndx).getMin().asInt();
79*35238bceSAndroid Build Coastguard Worker                 int aMax = a.component(ndx).getMax().asInt();
80*35238bceSAndroid Build Coastguard Worker                 int bMin = b.component(ndx).getMin().asInt();
81*35238bceSAndroid Build Coastguard Worker                 int bMax = b.component(ndx).getMax().asInt();
82*35238bceSAndroid Build Coastguard Worker 
83*35238bceSAndroid Build Coastguard Worker                 if (!CompareOp()(aMin, aMax, bMin, bMax))
84*35238bceSAndroid Build Coastguard Worker                     return false;
85*35238bceSAndroid Build Coastguard Worker             }
86*35238bceSAndroid Build Coastguard Worker             break;
87*35238bceSAndroid Build Coastguard Worker 
88*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_BOOL:
89*35238bceSAndroid Build Coastguard Worker             for (int ndx = 0; ndx < numElements; ndx++)
90*35238bceSAndroid Build Coastguard Worker             {
91*35238bceSAndroid Build Coastguard Worker                 bool aMin = a.component(ndx).getMin().asBool();
92*35238bceSAndroid Build Coastguard Worker                 bool aMax = a.component(ndx).getMax().asBool();
93*35238bceSAndroid Build Coastguard Worker                 bool bMin = b.component(ndx).getMin().asBool();
94*35238bceSAndroid Build Coastguard Worker                 bool bMax = b.component(ndx).getMax().asBool();
95*35238bceSAndroid Build Coastguard Worker 
96*35238bceSAndroid Build Coastguard Worker                 if (!CompareOp()(aMin, aMax, bMin, bMax))
97*35238bceSAndroid Build Coastguard Worker                     return false;
98*35238bceSAndroid Build Coastguard Worker             }
99*35238bceSAndroid Build Coastguard Worker             break;
100*35238bceSAndroid Build Coastguard Worker 
101*35238bceSAndroid Build Coastguard Worker         default:
102*35238bceSAndroid Build Coastguard Worker             DE_ASSERT(false);
103*35238bceSAndroid Build Coastguard Worker             return false;
104*35238bceSAndroid Build Coastguard Worker         }
105*35238bceSAndroid Build Coastguard Worker     }
106*35238bceSAndroid Build Coastguard Worker 
107*35238bceSAndroid Build Coastguard Worker     return true;
108*35238bceSAndroid Build Coastguard Worker }
109*35238bceSAndroid Build Coastguard Worker 
toInt(bool boolVal)110*35238bceSAndroid Build Coastguard Worker inline int toInt(bool boolVal)
111*35238bceSAndroid Build Coastguard Worker {
112*35238bceSAndroid Build Coastguard Worker     return boolVal ? 1 : 0;
113*35238bceSAndroid Build Coastguard Worker }
114*35238bceSAndroid Build Coastguard Worker 
115*35238bceSAndroid Build Coastguard Worker struct CompareIntersection
116*35238bceSAndroid Build Coastguard Worker {
operator ()rsg::__anon1cbb0bf70111::CompareIntersection117*35238bceSAndroid Build Coastguard Worker     inline bool operator()(float aMin, float aMax, float bMin, float bMax) const
118*35238bceSAndroid Build Coastguard Worker     {
119*35238bceSAndroid Build Coastguard Worker         return (aMin <= bMax && bMin <= aMax);
120*35238bceSAndroid Build Coastguard Worker     }
operator ()rsg::__anon1cbb0bf70111::CompareIntersection121*35238bceSAndroid Build Coastguard Worker     inline bool operator()(int aMin, int aMax, int bMin, int bMax) const
122*35238bceSAndroid Build Coastguard Worker     {
123*35238bceSAndroid Build Coastguard Worker         return (aMin <= bMax && bMin <= aMax);
124*35238bceSAndroid Build Coastguard Worker     }
125*35238bceSAndroid Build Coastguard Worker 
operator ()rsg::__anon1cbb0bf70111::CompareIntersection126*35238bceSAndroid Build Coastguard Worker     inline bool operator()(bool aMin, bool aMax, bool bMin, bool bMax) const
127*35238bceSAndroid Build Coastguard Worker     {
128*35238bceSAndroid Build Coastguard Worker         return CompareIntersection()(toInt(aMin), toInt(aMax), toInt(bMin), toInt(bMax));
129*35238bceSAndroid Build Coastguard Worker     }
130*35238bceSAndroid Build Coastguard Worker };
131*35238bceSAndroid Build Coastguard Worker 
132*35238bceSAndroid Build Coastguard Worker struct CompareIsSubsetOf
133*35238bceSAndroid Build Coastguard Worker {
operator ()rsg::__anon1cbb0bf70111::CompareIsSubsetOf134*35238bceSAndroid Build Coastguard Worker     inline bool operator()(float aMin, float aMax, float bMin, float bMax) const
135*35238bceSAndroid Build Coastguard Worker     {
136*35238bceSAndroid Build Coastguard Worker         return de::inRange(aMin, bMin, bMax) && de::inRange(aMax, bMin, bMax);
137*35238bceSAndroid Build Coastguard Worker     }
138*35238bceSAndroid Build Coastguard Worker 
operator ()rsg::__anon1cbb0bf70111::CompareIsSubsetOf139*35238bceSAndroid Build Coastguard Worker     inline bool operator()(int aMin, int aMax, int bMin, int bMax) const
140*35238bceSAndroid Build Coastguard Worker     {
141*35238bceSAndroid Build Coastguard Worker         return de::inRange(aMin, bMin, bMax) && de::inRange(aMax, bMin, bMax);
142*35238bceSAndroid Build Coastguard Worker     }
143*35238bceSAndroid Build Coastguard Worker 
operator ()rsg::__anon1cbb0bf70111::CompareIsSubsetOf144*35238bceSAndroid Build Coastguard Worker     inline bool operator()(bool aMin, bool aMax, bool bMin, bool bMax) const
145*35238bceSAndroid Build Coastguard Worker     {
146*35238bceSAndroid Build Coastguard Worker         return CompareIsSubsetOf()(toInt(aMin), toInt(aMax), toInt(bMin), toInt(bMax));
147*35238bceSAndroid Build Coastguard Worker     }
148*35238bceSAndroid Build Coastguard Worker };
149*35238bceSAndroid Build Coastguard Worker 
150*35238bceSAndroid Build Coastguard Worker } // namespace
151*35238bceSAndroid Build Coastguard Worker 
intersects(const ConstValueRangeAccess & other) const152*35238bceSAndroid Build Coastguard Worker bool ConstValueRangeAccess::intersects(const ConstValueRangeAccess &other) const
153*35238bceSAndroid Build Coastguard Worker {
154*35238bceSAndroid Build Coastguard Worker     return compareValueRangesAllTrue<CompareIntersection>(*this, other);
155*35238bceSAndroid Build Coastguard Worker }
156*35238bceSAndroid Build Coastguard Worker 
isSubsetOf(const ConstValueRangeAccess & other) const157*35238bceSAndroid Build Coastguard Worker bool ConstValueRangeAccess::isSubsetOf(const ConstValueRangeAccess &other) const
158*35238bceSAndroid Build Coastguard Worker {
159*35238bceSAndroid Build Coastguard Worker     return compareValueRangesAllTrue<CompareIsSubsetOf>(*this, other);
160*35238bceSAndroid Build Coastguard Worker }
161*35238bceSAndroid Build Coastguard Worker 
isSupersetOf(const ConstValueRangeAccess & other) const162*35238bceSAndroid Build Coastguard Worker bool ConstValueRangeAccess::isSupersetOf(const ConstValueRangeAccess &other) const
163*35238bceSAndroid Build Coastguard Worker {
164*35238bceSAndroid Build Coastguard Worker     return other.isSubsetOf(*this);
165*35238bceSAndroid Build Coastguard Worker }
166*35238bceSAndroid Build Coastguard Worker 
ValueRange(const VariableType & type)167*35238bceSAndroid Build Coastguard Worker ValueRange::ValueRange(const VariableType &type)
168*35238bceSAndroid Build Coastguard Worker     : m_type(type)
169*35238bceSAndroid Build Coastguard Worker     , m_min(type.getScalarSize())
170*35238bceSAndroid Build Coastguard Worker     , m_max(type.getScalarSize())
171*35238bceSAndroid Build Coastguard Worker {
172*35238bceSAndroid Build Coastguard Worker }
173*35238bceSAndroid Build Coastguard Worker 
ValueRange(const VariableType & type,const ConstValueAccess & minVal,const ConstValueAccess & maxVal)174*35238bceSAndroid Build Coastguard Worker ValueRange::ValueRange(const VariableType &type, const ConstValueAccess &minVal, const ConstValueAccess &maxVal)
175*35238bceSAndroid Build Coastguard Worker     : m_type(type)
176*35238bceSAndroid Build Coastguard Worker     , m_min(type.getScalarSize())
177*35238bceSAndroid Build Coastguard Worker     , m_max(type.getScalarSize())
178*35238bceSAndroid Build Coastguard Worker {
179*35238bceSAndroid Build Coastguard Worker     getMin() = minVal.value();
180*35238bceSAndroid Build Coastguard Worker     getMax() = maxVal.value();
181*35238bceSAndroid Build Coastguard Worker }
182*35238bceSAndroid Build Coastguard Worker 
ValueRange(const VariableType & type,const Scalar * minVal,const Scalar * maxVal)183*35238bceSAndroid Build Coastguard Worker ValueRange::ValueRange(const VariableType &type, const Scalar *minVal, const Scalar *maxVal)
184*35238bceSAndroid Build Coastguard Worker     : m_type(type)
185*35238bceSAndroid Build Coastguard Worker     , m_min(type.getScalarSize())
186*35238bceSAndroid Build Coastguard Worker     , m_max(type.getScalarSize())
187*35238bceSAndroid Build Coastguard Worker {
188*35238bceSAndroid Build Coastguard Worker     getMin() = ConstValueAccess(type, minVal).value();
189*35238bceSAndroid Build Coastguard Worker     getMax() = ConstValueAccess(type, maxVal).value();
190*35238bceSAndroid Build Coastguard Worker }
191*35238bceSAndroid Build Coastguard Worker 
ValueRange(ConstValueRangeAccess other)192*35238bceSAndroid Build Coastguard Worker ValueRange::ValueRange(ConstValueRangeAccess other)
193*35238bceSAndroid Build Coastguard Worker     : m_type(other.getType())
194*35238bceSAndroid Build Coastguard Worker     , m_min(other.getType().getScalarSize())
195*35238bceSAndroid Build Coastguard Worker     , m_max(other.getType().getScalarSize())
196*35238bceSAndroid Build Coastguard Worker {
197*35238bceSAndroid Build Coastguard Worker     getMin() = other.getMin().value();
198*35238bceSAndroid Build Coastguard Worker     getMax() = other.getMax().value();
199*35238bceSAndroid Build Coastguard Worker }
200*35238bceSAndroid Build Coastguard Worker 
~ValueRange(void)201*35238bceSAndroid Build Coastguard Worker ValueRange::~ValueRange(void)
202*35238bceSAndroid Build Coastguard Worker {
203*35238bceSAndroid Build Coastguard Worker }
204*35238bceSAndroid Build Coastguard Worker 
computeIntersection(ValueRange & dst,const ConstValueRangeAccess & a,const ConstValueRangeAccess & b)205*35238bceSAndroid Build Coastguard Worker void ValueRange::computeIntersection(ValueRange &dst, const ConstValueRangeAccess &a, const ConstValueRangeAccess &b)
206*35238bceSAndroid Build Coastguard Worker {
207*35238bceSAndroid Build Coastguard Worker     computeIntersection(dst.asAccess(), a, b);
208*35238bceSAndroid Build Coastguard Worker }
209*35238bceSAndroid Build Coastguard Worker 
computeIntersection(ValueRangeAccess dst,const ConstValueRangeAccess & a,const ConstValueRangeAccess & b)210*35238bceSAndroid Build Coastguard Worker void ValueRange::computeIntersection(ValueRangeAccess dst, const ConstValueRangeAccess &a,
211*35238bceSAndroid Build Coastguard Worker                                      const ConstValueRangeAccess &b)
212*35238bceSAndroid Build Coastguard Worker {
213*35238bceSAndroid Build Coastguard Worker     DE_ASSERT(dst.getType() == a.getType() && dst.getType() == b.getType());
214*35238bceSAndroid Build Coastguard Worker 
215*35238bceSAndroid Build Coastguard Worker     if (a.getType().isStruct())
216*35238bceSAndroid Build Coastguard Worker     {
217*35238bceSAndroid Build Coastguard Worker         int numMembers = (int)a.getType().getMembers().size();
218*35238bceSAndroid Build Coastguard Worker         for (int ndx = 0; ndx < numMembers; ndx++)
219*35238bceSAndroid Build Coastguard Worker             computeIntersection(dst.member(ndx), a.member(ndx), b.member(ndx));
220*35238bceSAndroid Build Coastguard Worker     }
221*35238bceSAndroid Build Coastguard Worker     else if (a.getType().isArray())
222*35238bceSAndroid Build Coastguard Worker     {
223*35238bceSAndroid Build Coastguard Worker         int numElements = (int)a.getType().getNumElements();
224*35238bceSAndroid Build Coastguard Worker         for (int ndx = 0; ndx < numElements; ndx++)
225*35238bceSAndroid Build Coastguard Worker             computeIntersection(dst.arrayElement(ndx), a.arrayElement(ndx), b.arrayElement(ndx));
226*35238bceSAndroid Build Coastguard Worker     }
227*35238bceSAndroid Build Coastguard Worker     else
228*35238bceSAndroid Build Coastguard Worker     {
229*35238bceSAndroid Build Coastguard Worker         int numElements = (int)a.getType().getNumElements();
230*35238bceSAndroid Build Coastguard Worker         switch (a.getType().getBaseType())
231*35238bceSAndroid Build Coastguard Worker         {
232*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_FLOAT:
233*35238bceSAndroid Build Coastguard Worker             for (int ndx = 0; ndx < numElements; ndx++)
234*35238bceSAndroid Build Coastguard Worker             {
235*35238bceSAndroid Build Coastguard Worker                 float aMin = a.component(ndx).getMin().asFloat();
236*35238bceSAndroid Build Coastguard Worker                 float aMax = a.component(ndx).getMax().asFloat();
237*35238bceSAndroid Build Coastguard Worker                 float bMin = b.component(ndx).getMin().asFloat();
238*35238bceSAndroid Build Coastguard Worker                 float bMax = b.component(ndx).getMax().asFloat();
239*35238bceSAndroid Build Coastguard Worker 
240*35238bceSAndroid Build Coastguard Worker                 dst.component(ndx).getMin() = de::max(aMin, bMin);
241*35238bceSAndroid Build Coastguard Worker                 dst.component(ndx).getMax() = de::min(aMax, bMax);
242*35238bceSAndroid Build Coastguard Worker             }
243*35238bceSAndroid Build Coastguard Worker             break;
244*35238bceSAndroid Build Coastguard Worker 
245*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_INT:
246*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_SAMPLER_2D:
247*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_SAMPLER_CUBE:
248*35238bceSAndroid Build Coastguard Worker             for (int ndx = 0; ndx < numElements; ndx++)
249*35238bceSAndroid Build Coastguard Worker             {
250*35238bceSAndroid Build Coastguard Worker                 int aMin = a.component(ndx).getMin().asInt();
251*35238bceSAndroid Build Coastguard Worker                 int aMax = a.component(ndx).getMax().asInt();
252*35238bceSAndroid Build Coastguard Worker                 int bMin = b.component(ndx).getMin().asInt();
253*35238bceSAndroid Build Coastguard Worker                 int bMax = b.component(ndx).getMax().asInt();
254*35238bceSAndroid Build Coastguard Worker 
255*35238bceSAndroid Build Coastguard Worker                 dst.component(ndx).getMin() = de::max(aMin, bMin);
256*35238bceSAndroid Build Coastguard Worker                 dst.component(ndx).getMax() = de::min(aMax, bMax);
257*35238bceSAndroid Build Coastguard Worker             }
258*35238bceSAndroid Build Coastguard Worker             break;
259*35238bceSAndroid Build Coastguard Worker 
260*35238bceSAndroid Build Coastguard Worker         case VariableType::TYPE_BOOL:
261*35238bceSAndroid Build Coastguard Worker             for (int ndx = 0; ndx < numElements; ndx++)
262*35238bceSAndroid Build Coastguard Worker             {
263*35238bceSAndroid Build Coastguard Worker                 bool aMin = a.component(ndx).getMin().asBool();
264*35238bceSAndroid Build Coastguard Worker                 bool aMax = a.component(ndx).getMax().asBool();
265*35238bceSAndroid Build Coastguard Worker                 bool bMin = b.component(ndx).getMin().asBool();
266*35238bceSAndroid Build Coastguard Worker                 bool bMax = b.component(ndx).getMax().asBool();
267*35238bceSAndroid Build Coastguard Worker 
268*35238bceSAndroid Build Coastguard Worker                 dst.component(ndx).getMin() = aMin || bMin;
269*35238bceSAndroid Build Coastguard Worker                 dst.component(ndx).getMax() = aMax && bMax;
270*35238bceSAndroid Build Coastguard Worker             }
271*35238bceSAndroid Build Coastguard Worker             break;
272*35238bceSAndroid Build Coastguard Worker 
273*35238bceSAndroid Build Coastguard Worker         default:
274*35238bceSAndroid Build Coastguard Worker             DE_ASSERT(false);
275*35238bceSAndroid Build Coastguard Worker         }
276*35238bceSAndroid Build Coastguard Worker     }
277*35238bceSAndroid Build Coastguard Worker }
278*35238bceSAndroid Build Coastguard Worker 
VariableValue(const VariableValue & other)279*35238bceSAndroid Build Coastguard Worker VariableValue::VariableValue(const VariableValue &other)
280*35238bceSAndroid Build Coastguard Worker     : m_variable(other.m_variable)
281*35238bceSAndroid Build Coastguard Worker     , m_storage(other.m_variable->getType())
282*35238bceSAndroid Build Coastguard Worker {
283*35238bceSAndroid Build Coastguard Worker     m_storage.getValue(getType()) = other.getValue().value();
284*35238bceSAndroid Build Coastguard Worker }
285*35238bceSAndroid Build Coastguard Worker 
operator =(const VariableValue & other)286*35238bceSAndroid Build Coastguard Worker VariableValue &VariableValue::operator=(const VariableValue &other)
287*35238bceSAndroid Build Coastguard Worker {
288*35238bceSAndroid Build Coastguard Worker     m_variable = other.m_variable;
289*35238bceSAndroid Build Coastguard Worker     m_storage.setStorage(getType());
290*35238bceSAndroid Build Coastguard Worker     m_storage.getValue(getType()) = other.getValue().value();
291*35238bceSAndroid Build Coastguard Worker     return *this;
292*35238bceSAndroid Build Coastguard Worker }
293*35238bceSAndroid Build Coastguard Worker 
294*35238bceSAndroid Build Coastguard Worker } // namespace rsg
295