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

  1 karl  1.9 //%2006////////////////////////////////////////////////////////////////////////
  2 chuck 1.3 //
  3 karl  1.7 // 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.3 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.7 // 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.9 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12           // EMC Corporation; Symantec Corporation; The Open Group.
 13 chuck 1.3 //
 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 humberto 1.1 #ifndef Pegasus_CQLFactor_h
 35              #define Pegasus_CQLFactor_h
 36              
 37              #include <Pegasus/Common/Config.h>
 38              #include <Pegasus/CQL/Linkage.h>
 39 chuck    1.3 #include <Pegasus/CQL/CQLPredicate.h>
 40 lucier   1.4 #include <Pegasus/CQL/CQLFunction.h>
 41 humberto 1.1 
 42              
 43              PEGASUS_NAMESPACE_BEGIN
 44              
 45 lucier   1.4 // Forward declares
 46 mike     1.10 class CIMNamespaceName;
 47               class CQLFactory;
 48 humberto 1.1  
 49 mike     1.10 class CQLFunctionRep
 50 humberto 1.1  {
 51 karl     1.11 public:
 52 chuck    1.3  
 53 humberto 1.6      CQLFunctionRep();
 54 karl     1.11     
 55 humberto 1.6      CQLFunctionRep(const CQLFunctionRep* rep);
 56 karl     1.11     
 57 chuck    1.3      CQLFunctionRep(CQLIdentifier inOpType, Array<CQLPredicate> inParms);
 58 karl     1.11     
 59 humberto 1.6      ~CQLFunctionRep();
 60 karl     1.11     
 61 humberto 1.1      /** 
 62 humberto 1.6       The getValue method validates the parms versus FunctionOpType.
 63                    (A) resolves prarameter  types
 64                    (B) number of parms
 65                    and then actually executes the function.
 66                    Returns a CQLValue object that has already been resolved.
 67                    */
 68 chuck    1.3      CQLValue resolveValue(const CIMInstance& CI, const QueryContext& queryCtx);
 69 karl     1.11     
 70 humberto 1.6      Array<CQLPredicate> getParms() const;
 71 karl     1.11     
 72                   FunctionOpType getFunctionType() const;
 73                   
 74                   String toString()const;
 75                   
 76                   void applyContext(const QueryContext& inContext);
 77                   
 78                   // Boolean operator==(const CQLFunctionRep& func)const;
 79                   
 80                   // Boolean operator!=(const CQLFunctionRep& func)const;
 81                   
 82                   friend class CQLFactory;
 83 humberto 1.1  
 84 chuck    1.3   private:
 85 karl     1.11     CQLValue dateTimeToMicrosecond(const CIMInstance& CI,
 86                          const QueryContext& queryCtx) const;
 87                   CQLValue stringToUint(const CIMInstance& CI,
 88                          const QueryContext& queryCtx) const;
 89                   CQLValue stringToSint(const CIMInstance& CI,
 90                          const QueryContext& queryCtx) const;
 91                   CQLValue stringToReal(const CIMInstance& CI,
 92                          const QueryContext& queryCtx) const;
 93                   CQLValue stringToNumeric(const CIMInstance& CI,
 94                          const QueryContext& queryCtx) const;
 95                   CQLValue upperCase(const CIMInstance& CI,
 96                          const QueryContext& queryCtx) const;
 97                   CQLValue numericToString(const CIMInstance& CI,
 98                          const QueryContext& queryCtx) const;
 99                   CQLValue referenceToString(const CIMInstance& CI,
100                          const QueryContext& queryCtx) const;
101                   CQLValue className(const CIMInstance& CI,
102                          const QueryContext& queryCtx) const;
103                   CQLValue nameSpaceName(const CIMInstance& CI,
104                          const QueryContext& queryCtx) const;
105                   CQLValue nameSpaceType(const CIMInstance& CI,
106 karl     1.11            const QueryContext& queryCtx) const;
107                   CQLValue hostPort(const CIMInstance& CI,
108                          const QueryContext& queryCtx) const;
109                   CQLValue modelPath(const CIMInstance& CI,
110                          const QueryContext& queryCtx) const;
111                   CQLValue classPath(const CIMInstance& CI,
112                          const QueryContext& queryCtx) const;
113                   CQLValue objectPath(const CIMInstance& CI,
114                          const QueryContext& queryCtx) const;
115                   CQLValue instanceToReference(const CIMInstance& CI,
116                          const QueryContext& queryCtx) const;
117                   CQLValue currentDateTime() const;
118                   CQLValue dateTime(const CIMInstance& CI,
119                          const QueryContext& queryCtx) const;
120                   CQLValue microsecondToTimestamp(const CIMInstance& CI,
121                          const QueryContext& queryCtx) const;
122                   CQLValue microsecondToInterval(const CIMInstance& CI,
123                          const QueryContext& queryCtx) const;
124                   
125                   // Used by the path functions
126                   CQLValue buildModelPath(const CIMObjectPath& objPath) const;
127 karl     1.11     CQLValue buildClassPath(const CIMObjectPath& objPath,
128                          const CIMNamespaceName& ns) const;
129                   CQLValue buildObjectPath(const CIMObjectPath& objPath,
130                          const CIMNamespaceName& ns) const;
131                   
132                   // Utility methods to convert enums into strings
133                   String functionTypeToString() const;
134 lucier   1.5        
135 karl     1.11     // Member data
136                   FunctionOpType _funcOpType;
137                   Array<CQLPredicate> _parms;
138                   
139 humberto 1.1  };
140               
141               PEGASUS_NAMESPACE_END
142               
143               #endif 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2