1 humberto 1.1.2.1 #include "CQLFactor.h"
2 #include <Pegasus/CQL/CQLExpression.h>
3 #include <Pegasus/CQL/CQLFunction.h>
|
4 humberto 1.1.2.6 #include <Pegasus/CQL/CQLFactory.h>
|
5 humberto 1.1.2.1 PEGASUS_NAMESPACE_BEGIN
6
7 #define PEGASUS_ARRAY_T CQLFactor
8 #include <Pegasus/Common/ArrayImpl.h>
9 #undef PEGASUS_ARRAY_T
10
|
11 david 1.1.2.2 CQLFactor::CQLFactor(const CQLFactor& inCQLFact)
12 {
13 _CQLVal = inCQLFact._CQLVal;
14 _CQLFunct = inCQLFact._CQLFunct;
15 _CQLExp = inCQLFact._CQLExp;
16 _invert = inCQLFact._invert;
17 }
18
|
19 humberto 1.1.2.1 CQLFactor::CQLFactor(CQLValue inCQLVal)
20 {
|
21 david 1.1.2.2 _CQLVal = inCQLVal;
|
22 humberto 1.1.2.1 }
23
24 CQLFactor::CQLFactor(CQLExpression& inCQLExp)
25 {
|
26 david 1.1.2.2 _CQLExp = new CQLExpression(inCQLExp);
|
27 humberto 1.1.2.1 }
28
29 CQLFactor::CQLFactor(CQLFunction inCQLFunc)
30 {
|
31 david 1.1.2.2 _CQLFunct = new CQLFunction(inCQLFunc);
|
32 humberto 1.1.2.1 }
33
|
34 david 1.1.2.4 CQLValue CQLFactor::getValue()
|
35 humberto 1.1.2.1 {
|
36 david 1.1.2.2 return _CQLVal;
37 }
38
39 CQLValue CQLFactor::resolveValue(CIMInstance CI, QueryContext& QueryCtx)
40 {
|
41 david 1.1.2.5 if(_CQLExp != NULL)
42 {
43 return _CQLExp->resolveValue(CI,QueryCtx);
44 }
45 else if (_CQLFunct != NULL)
46 {
47 return _CQLFunct->resolveValue(CI,QueryCtx);
48 }
49 else
50 {
51 _CQLVal.resolve(CI,QueryCtx);
52 return _CQLVal;
53 }
|
54 david 1.1.2.2 }
55
56 Boolean CQLFactor::isSimpleValue()
57 {
58 return (_CQLExp == NULL && _CQLFunct == NULL);
59 }
60
61 CQLFunction CQLFactor::getCQLFunction()
62 {
63 return *_CQLFunct;
64 }
65
66 CQLExpression CQLFactor::getCQLExpression()
67 {
68 return *_CQLExp;
|
69 humberto 1.1.2.1 }
70
|
71 david 1.1.2.2 String CQLFactor::toString()
72 {
73 if(_CQLFunct != NULL)
74 {
|
75 david 1.1.2.5 return _CQLFunct->toString();
|
76 david 1.1.2.2 }
77 else if(_CQLExp != NULL)
78 {
|
79 david 1.1.2.5 return _CQLExp->toString();
|
80 david 1.1.2.2 }
|
81 david 1.1.2.5 else
|
82 david 1.1.2.2 {
|
83 david 1.1.2.5 return _CQLVal.toString();
|
84 david 1.1.2.2 }
85 }
86
87 void CQLFactor::applyScopes(Array<CQLScope> inScopes)
88 {
|
89 david 1.1.2.5
90 if(_CQLFunct != NULL)
91 {
92 _CQLFunct->applyScopes(inScopes);
93 }
94 else if(_CQLExp != NULL)
95 {
96 _CQLExp->applyScopes(inScopes);
97 }
98 else
99 {
100 _CQLVal.applyScopes(inScopes);
101 }
|
102 david 1.1.2.2 return;
103 }
104
105
|
106 humberto 1.1.2.1 PEGASUS_NAMESPACE_END
|