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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2