(file) Return to CQLTerm.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

  1 karl  1.8 //%2006////////////////////////////////////////////////////////////////////////
  2 chuck 1.2 //
  3 karl  1.4 // 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.4 // 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 karl  1.8 // 
 21 chuck 1.2 // 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           // Authors: David Rosckes (rosckes@us.ibm.com)
 33           //          Bert Rivero (hurivero@us.ibm.com)
 34           //          Chuck Carmack (carmack@us.ibm.com)
 35 david.dillard 1.5 //          Brian Lucier (lucier@us.ibm.com)
 36 chuck         1.2 //
 37 david.dillard 1.5 // Modified By: David Dillard, VERITAS Software Corp.
 38                   //                  (david.dillard@veritas.com)
 39 vijay.eli     1.6 //              Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590
 40 aruran.ms     1.7 //              Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3591
 41 chuck         1.2 //
 42                   //%/////////////////////////////////////////////////////////////////////////////
 43                   
 44                   #ifndef Pegasus_CQLTerm_h
 45                   #define Pegasus_CQLTerm_h
 46                   
 47 david.dillard 1.5 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
 48                   
 49                   #include <Pegasus/CQL/Linkage.h>
 50 chuck         1.2 #include <Pegasus/CQL/CQLValue.h>
 51                   #include <Pegasus/Common/ArrayInternal.h>
 52                   #include <Pegasus/CQL/CQLFactor.h>
 53                   
 54                   PEGASUS_NAMESPACE_BEGIN
 55                   
 56 mike          1.9 class CQLFactory;
 57                   class CQLTermRep;
 58                   class QueryContext;
 59 chuck         1.2 
 60 david.dillard 1.5 /**
 61 humberto      1.3     enum of multiply, divide and string concatenation operators.
 62 chuck         1.2 */
 63 humberto      1.3 enum FactorOpType { /*mult, divide,*/ concat };
 64 chuck         1.2 
 65                   /*
 66                   #ifndef PEGASUS_ARRAY_T
 67                   #define PEGASUS_ARRAY_T FactorOpType
 68                   #include <Pegasus/Common/ArrayInter.h>
 69                   #undef PEGASUS_ARRAY_T
 70                   #endif
 71                   */
 72                   
 73                   /**
 74 david.dillard 1.5     The CQLTerm class encapsulates a generic CQL term to make it
 75                       easier to break into pieces (factors) and process the term.
 76                       A CQL term is made up of factors and operators.
 77 chuck         1.2     There must be exactly one more factor than there are operators.
 78                   */
 79                   
 80                   class PEGASUS_CQL_LINKAGE CQLTerm
 81                   {
 82                    public:
 83                   
 84 david.dillard 1.5   /**
 85 humberto      1.3       Constructs CQLTermRep default object.
 86 david.dillard 1.5 
 87 chuck         1.2       @param  - None.
 88                         @return - None.
 89                         @throw  - None.
 90                         <I><B>Experimental Interface</B></I><BR>
 91                     */
 92                     CQLTerm();
 93                   
 94 david.dillard 1.5   /**
 95 humberto      1.3       Constructs CQLTermRep from a CQLFactor object.
 96 david.dillard 1.5 
 97 chuck         1.2       @param  - theFactor is a CQLFactor object.
 98                         @return - None.
 99                         @throw  - None.
100                         <I><B>Experimental Interface</B></I><BR>
101                     */
102                     CQLTerm(const CQLFactor& theFactor);
103                   
104 david.dillard 1.5   /**
105 humberto      1.3       Constructs CQLTermRep from a CQLTermRep object. (copy-constructor)
106 david.dillard 1.5 
107 humberto      1.3       @param  - inTerm is a CQLTermRep object.
108 chuck         1.2       @return - None.
109                         @throw  - None.
110                         <I><B>Experimental Interface</B></I><BR>
111                     */
112                     CQLTerm(const CQLTerm& inTerm);
113                   
114 david.dillard 1.5   /**
115 humberto      1.3       Destroys CQLTermRep object.
116 david.dillard 1.5 
117 chuck         1.2       @param  - None.
118                         @return - None.
119                         @throw  - None.
120                         <I><B>Experimental Interface</B></I><BR>
121 david.dillard 1.5   */
122 chuck         1.2   ~CQLTerm();
123 david.dillard 1.5 
124 chuck         1.2   /** the resolveValue method evaluates the CQL Term and returns the value.
125                         Any property that need to be resolved into a value is taken from the
126                         CIMInstance.
127 david.dillard 1.5 
128 chuck         1.2       @param  - CI - The CIMInstance used for the evaluate.
129                         @param  - QueryCtx - Reference to the Querycontext object.
130                         @return - CQLValue - The value of the object being resolved.
131 david.dillard 1.5       @throw  - CQLRuntimeException
132 chuck         1.2       <I><B>Experimental Interface</B></I><BR>
133                     */
134                     CQLValue resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx);
135 david.dillard 1.5 
136 humberto      1.3   /** The function is used by the parser.
137 chuck         1.2       It is invoked 0 or more times for the CQLTerm, and
138                         when invoked will always pass in an integer that is the Factor operation
139                         type and a CQLFactor object.
140 david.dillard 1.5 
141 chuck         1.2       @param  - inFactorOpType - next operation to be performed.
142                         @param  - inFactor - next CQLFactor to be operated on.
143                         @return - None.
144                         @throw  - None.
145                         <I><B>Experimental Interface</B></I><BR>
146                     */
147 aruran.ms     1.7   void appendOperation(FactorOpType inFactorOpType, const CQLFactor& inFactor);
148 chuck         1.2 
149 david.dillard 1.5   /**
150 chuck         1.2       Converts the contents of the object to a String.
151 david.dillard 1.5 
152 chuck         1.2       @param  - None.
153                         @return - A string version of the object.
154                         @throw  - None.
155                         <I><B>Experimental Interface</B></I><BR>
156 david.dillard 1.5   */
157 chuck         1.2   String toString()const;
158                   
159 david.dillard 1.5   /**
160 chuck         1.2       Returns true if the object is simple.  Simple is defined as only having
161                         a one CQLFactor object. The CQLFactor object could be complex.
162 david.dillard 1.5 
163 chuck         1.2       @param  - None.
164                         @return - true or false
165                         @throw  - None.
166                         <I><B>Experimental Interface</B></I><BR>
167                     */
168                     Boolean isSimple()const;
169                   
170 david.dillard 1.5   /**
171 chuck         1.2       Returns true if the value within the object is Simple.  In this case
172 david.dillard 1.5       the object only has one CQLFactor object.  This CQLFactor object in
173 chuck         1.2       not a complex object.
174 david.dillard 1.5 
175 chuck         1.2       @param  - None.
176                         @return - true or false
177                         @throw  - None.
178                         <I><B>Experimental Interface</B></I><BR>
179                     */
180                     Boolean isSimpleValue()const;
181                   
182 david.dillard 1.5   /**
183 chuck         1.2       Will return an array of CQLFactors.
184 david.dillard 1.5 
185 chuck         1.2       @param  - None.
186                         @return - An array of CQLFactor
187                         @throw  - None.
188                         <I><B>Experimental Interface</B></I><BR>
189                     */
190                     Array<CQLFactor> getFactors()const;
191                   
192 david.dillard 1.5   /**
193 chuck         1.2       Will return an array of Operations.
194 david.dillard 1.5 
195 chuck         1.2       @param  - None.
196                         @return - an array of FactorOpType
197                         @throw  - None.
198                         <I><B>Experimental Interface</B></I><BR>
199 david.dillard 1.5   */
200 chuck         1.2   Array<FactorOpType> getOperators()const;
201                   
202 david.dillard 1.5   /**
203 chuck         1.2       Calling applyContext function for every internal object.  This
204                         will fully qualify the Chained Identifiers within all the CQLValue objects.
205 david.dillard 1.5 
206 chuck         1.2       @param  - inContext - Query Context used to access the repository.
207                         @param  - inCid - Chained Identifier used for standalone symbolic constants.
208                         @return - None.
209                         @throw  - None.
210                         <I><B>Experimental Interface</B></I><BR>
211 david.dillard 1.5   */
212 vijay.eli     1.6   void applyContext(const QueryContext& inContext,
213                   		    const CQLChainedIdentifier& inCid);
214 chuck         1.2 
215 david.dillard 1.5   /**
216 chuck         1.2       Assignment operator.
217 david.dillard 1.5 
218 chuck         1.2       @param  - rhs - a CQLTerm to be assined.
219                         @return - a reference of a CQLTerm.
220                         @throw  - None.
221                         <I><B>Experimental Interface</B></I><BR>
222 david.dillard 1.5   */
223 chuck         1.2   CQLTerm& operator=(const CQLTerm& rhs);
224 david.dillard 1.5 
225                     /**
226 chuck         1.2       Compare to CQLTerms for equality
227 david.dillard 1.5 
228 chuck         1.2       @param  - rhs - rightside value of operation
229                         @return - true or false.
230                         @throw  - None.
231                         <I><B>Experimental Interface</B></I><BR>
232                     */
233 humberto      1.3   /*
234 chuck         1.2   Boolean operator==(const CQLTerm& rhs)const;
235 humberto      1.3   */
236 david.dillard 1.5   /**
237 chuck         1.2       Compare to CQLTerms for non-equality
238 david.dillard 1.5 
239 chuck         1.2       @param  - rhs - rightside value of operation
240                         @return - true or false.
241                         @throw  - None.
242                         <I><B>Experimental Interface</B></I><BR>
243                     */
244 humberto      1.3   /*
245 chuck         1.2   Boolean operator!=(const CQLTerm& rhs)const;
246 humberto      1.3   */
247 david.dillard 1.5 
248 chuck         1.2   friend class CQLFactory;
249 david.dillard 1.5 
250 chuck         1.2  private:
251 david.dillard 1.5 
252 chuck         1.2   CQLTermRep *_rep;
253                   };
254                   
255                   /*
256                   #ifndef PEGASUS_ARRAY_T
257                   #define PEGASUS_ARRAY_T CQLTerm
258                   #include <Pegasus/Common/ArrayInter.h>
259                   #undef PEGASUS_ARRAY_T
260                   #endif
261                   */
262                   
263                   PEGASUS_NAMESPACE_END
264                   #endif
265 david.dillard 1.5 #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2