1 karl 1.8 //%2006////////////////////////////////////////////////////////////////////////
|
2 chuck 1.2 //
|
3 karl 1.5 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 chuck 1.2 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.5 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.8 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 chuck 1.2 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 //%/////////////////////////////////////////////////////////////////////////////
33
34 chuck 1.2 #include <Pegasus/CQL/CQLTerm.h>
35 #include <Pegasus/CQL/CQLTermRep.h>
36 #include <Pegasus/CQL/CQLFactory.h>
37 #include <Pegasus/Query/QueryCommon/QueryContext.h>
38 PEGASUS_NAMESPACE_BEGIN
39
40 /*
41 #define PEGASUS_ARRAY_T FactorOpType
42 #include <Pegasus/Common/ArrayImpl.h>
43 #undef PEGASUS_ARRAY_T
44
45 #define PEGASUS_ARRAY_T CQLTerm
46 #include <Pegasus/Common/ArrayImpl.h>
47 #undef PEGASUS_ARRAY_T
48 */
49
50 CQLTerm::CQLTerm()
51 {
|
52 karl 1.9 _rep = new CQLTermRep();
|
53 chuck 1.2 }
54
55 CQLTerm::CQLTerm(const CQLTerm& inTerm)
56 {
|
57 karl 1.9 _rep = new CQLTermRep(*inTerm._rep);
|
58 chuck 1.2 }
59
60 CQLTerm::CQLTerm(const CQLFactor& theFactor)
61 {
|
62 karl 1.9 _rep = new CQLTermRep(theFactor);
|
63 chuck 1.2 }
64
65 CQLTerm::~CQLTerm()
66 {
|
67 karl 1.9 if(_rep)
68 delete _rep;
|
69 chuck 1.2 }
70
|
71 karl 1.9 CQLValue CQLTerm::resolveValue(const CIMInstance& CI,
72 const QueryContext& QueryCtx)
|
73 chuck 1.2 {
|
74 karl 1.9 return _rep->resolveValue(CI,QueryCtx);
|
75 chuck 1.2 }
76
|
77 karl 1.9 void CQLTerm::appendOperation(FactorOpType inFactorOpType,
78 const CQLFactor& inFactor)
|
79 chuck 1.2 {
|
80 karl 1.9 _rep->appendOperation(inFactorOpType,inFactor);
|
81 chuck 1.2 }
82
83 String CQLTerm::toString()const
84 {
|
85 karl 1.9 return _rep->toString();
|
86 chuck 1.2 }
87
88 Boolean CQLTerm::isSimple()const
89 {
|
90 karl 1.9 return _rep->isSimple();
|
91 chuck 1.2 }
92
93 Boolean CQLTerm::isSimpleValue()const
94 {
|
95 karl 1.9 return _rep->isSimpleValue();
|
96 chuck 1.2 }
97
98 Array<CQLFactor> CQLTerm::getFactors()const
99 {
|
100 karl 1.9 return _rep->getFactors();
|
101 chuck 1.2 }
102
103 Array<FactorOpType> CQLTerm::getOperators()const
104 {
|
105 karl 1.9 return _rep->getOperators();
|
106 chuck 1.2 }
107
|
108 vijay.eli 1.6 void CQLTerm::applyContext(const QueryContext& inContext,
109 const CQLChainedIdentifier& inCid)
|
110 chuck 1.2 {
|
111 karl 1.9 _rep->applyContext(inContext,inCid);
|
112 chuck 1.2 }
113
114 CQLTerm& CQLTerm::operator=(const CQLTerm& rhs)
115 {
|
116 karl 1.9 if(&rhs != this)
117 {
118 if(_rep) delete _rep;
119 _rep = new CQLTermRep(*rhs._rep);
120 }
121 return *this;
|
122 chuck 1.2 }
|
123 humberto 1.4 /*
|
124 chuck 1.2 Boolean CQLTerm::operator==(const CQLTerm& rhs)const
125 {
|
126 karl 1.9 return (*_rep == *(rhs._rep));
|
127 chuck 1.2 }
128 Boolean CQLTerm::operator!=(const CQLTerm& rhs)const
129 {
|
130 karl 1.9 return (!operator==(rhs));
|
131 chuck 1.2 }
|
132 humberto 1.4 */
|
133 chuck 1.2 PEGASUS_NAMESPACE_END
|