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

  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           // Authors: David Rosckes (rosckes@us.ibm.com)
 33           //          Bert Rivero (hurivero@us.ibm.com)
 34 chuck 1.2 //          Chuck Carmack (carmack@us.ibm.com)
 35           //          Brian Lucier (lucier@us.ibm.com)
 36           //
 37 david.dillard 1.6 // Modified By: David Dillard, VERITAS Software Corp.
 38                   //                  (david.dillard@veritas.com)
 39 vijay.eli     1.7 //              Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590
 40 chuck         1.2 //
 41                   //%/////////////////////////////////////////////////////////////////////////////
 42                   
 43                   #ifndef Pegasus_CQLFunction_h
 44                   #define Pegasus_CQLFunction_h
 45                   
 46 david.dillard 1.6 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
 47                   
 48                   #include <Pegasus/CQL/Linkage.h>
 49 chuck         1.2 #include <Pegasus/CQL/CQLValue.h>
 50                   #include <Pegasus/CQL/CQLPredicate.h>
 51                   
 52                   PEGASUS_NAMESPACE_BEGIN
 53                   
 54 mike          1.9 class CQLFactory;
 55                   class CQLFunctionRep;
 56 chuck         1.2 
 57                    /** The Enum is private, the definition is public.
 58                         */
 59                   enum  FunctionOpType
 60                   {
 61 lucier        1.3   UNKNOWN,
 62 chuck         1.2   DATETIMETOMICROSECOND,
 63                     STRINGTOUINT,
 64                     STRINGTOSINT,
 65                     STRINGTOREAL,
 66                     STRINGTONUMERIC,
 67                     UPPERCASE,
 68                     NUMERICTOSTRING,
 69                     REFERENCETOSTRING,
 70                     CLASSNAME,
 71                     NAMESPACENAME,
 72                     NAMESPACETYPE,
 73                     HOSTPORT,
 74                     MODELPATH,
 75                     CLASSPATH,
 76                     OBJECTPATH,
 77                     INSTANCETOREFERENCE,
 78                     CURRENTDATETIME,
 79                     DATETIME,
 80                     MICROSECONDTOTIMESTAMP,
 81                     MICROSECONDTOINTERVAL
 82                   };
 83 chuck         1.2 /**
 84                      CQLFunction objects are populated by the
 85                      Bison code.
 86                   
 87                      Supported functions are in accordance with the
 88                      DMTF CQL Specification.
 89                      TODO:  THIS LIST IS SUBJECT TO CHANGE
 90                    
 91                       classname( <expr> )
 92                       classname( )
 93                       count(*)
 94                       count( distinct * )
 95                       count( distinct <expr> )
 96                       something for createarray
 97                       something for datetime
 98                       something for hostname
 99                       max( <expr> )
100                       mean( <expr> )
101                       median( <expr> )
102                       min( <expr> )
103                       something for modelpath
104 chuck         1.2     something for namespacename
105                       something for namespacepath
106                       something for objectpath
107                       something for scheme
108                       sum( <expr> )
109                       something for userinfo
110                       uppercase( <expr> )
111                   
112                     */
113                   
114                   
115 mike          1.9 class CQLFunction
116 chuck         1.2 {
117                     public:
118                      
119                       CQLFunction();
120                       
121                       CQLFunction(const CQLFunction& inFunc);
122                   
123                   //    CQLFunction(FunctionOpType inFunctionOpType, Array<CQLExpression> inParms);
124                       
125                       CQLFunction(CQLIdentifier inOpType, Array<CQLPredicate> inParms);
126                   
127                       ~CQLFunction();
128                       /** 
129                          The getValue method validates the parms versus FunctionOpType.
130                                  (A) resolves prarameter  types
131                                  (B) number of parms
132                           and then actually executes the function.
133                           Returns a CQLValue object that has already been resolved.
134                         */
135                       CQLValue resolveValue(const CIMInstance& CI, const QueryContext& queryCtx);
136                       
137 chuck         1.2    Array<CQLPredicate> getParms()const;
138                      
139                      FunctionOpType getFunctionType()const;
140                   
141                      String toString()const;
142                   
143 vijay.eli     1.7    void applyContext(const QueryContext& inContext);
144 chuck         1.2 
145                      CQLFunction& operator=(const CQLFunction& rhs);
146                      
147 humberto      1.4 
148                   //   Boolean operator==(const CQLFunction& func)const;
149 chuck         1.2    
150 humberto      1.4   // Boolean operator!=(const CQLFunction& func)const;
151 chuck         1.2    
152                      friend class CQLFactory;
153                   
154                     private:
155                   
156                     CQLFunctionRep *_rep;
157                   
158                   };
159                   
160                   PEGASUS_NAMESPACE_END
161                   #endif
162                   #endif 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2