1 martin 1.11 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.12 //
|
3 martin 1.11 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.12 //
|
10 martin 1.11 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.12 //
|
17 martin 1.11 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.12 //
|
20 martin 1.11 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.12 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.11 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.12 //
|
28 martin 1.11 //////////////////////////////////////////////////////////////////////////
|
29 chuck 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_CQLFunction_h
33 #define Pegasus_CQLFunction_h
34
|
35 david.dillard 1.6 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
36
37 #include <Pegasus/CQL/Linkage.h>
|
38 chuck 1.2 #include <Pegasus/CQL/CQLValue.h>
39 #include <Pegasus/CQL/CQLPredicate.h>
40
41 PEGASUS_NAMESPACE_BEGIN
42
|
43 mike 1.9 class CQLFactory;
44 class CQLFunctionRep;
|
45 chuck 1.2
46 /** The Enum is private, the definition is public.
47 */
48 enum FunctionOpType
49 {
|
50 lucier 1.3 UNKNOWN,
|
51 chuck 1.2 DATETIMETOMICROSECOND,
52 STRINGTOUINT,
53 STRINGTOSINT,
54 STRINGTOREAL,
55 STRINGTONUMERIC,
56 UPPERCASE,
57 NUMERICTOSTRING,
58 REFERENCETOSTRING,
59 CLASSNAME,
60 NAMESPACENAME,
61 NAMESPACETYPE,
62 HOSTPORT,
63 MODELPATH,
64 CLASSPATH,
65 OBJECTPATH,
66 INSTANCETOREFERENCE,
67 CURRENTDATETIME,
68 DATETIME,
69 MICROSECONDTOTIMESTAMP,
70 MICROSECONDTOINTERVAL
71 };
72 chuck 1.2 /**
73 CQLFunction objects are populated by the
74 Bison code.
75
76 Supported functions are in accordance with the
77 DMTF CQL Specification.
78 TODO: THIS LIST IS SUBJECT TO CHANGE
|
79 kumpf 1.13
|
80 chuck 1.2 classname( <expr> )
81 classname( )
82 count(*)
83 count( distinct * )
84 count( distinct <expr> )
85 something for createarray
86 something for datetime
87 something for hostname
88 max( <expr> )
89 mean( <expr> )
90 median( <expr> )
91 min( <expr> )
92 something for modelpath
93 something for namespacename
94 something for namespacepath
95 something for objectpath
96 something for scheme
97 sum( <expr> )
98 something for userinfo
99 uppercase( <expr> )
100
101 chuck 1.2 */
102
103
|
104 mike 1.9 class CQLFunction
|
105 chuck 1.2 {
|
106 kumpf 1.13 public:
107
|
108 chuck 1.2 CQLFunction();
|
109 kumpf 1.13
|
110 chuck 1.2 CQLFunction(const CQLFunction& inFunc);
111
|
112 kumpf 1.13 // CQLFunction(FunctionOpType inFunctionOpType,
|
113 karl 1.10 // Array<CQLExpression> inParms);
|
114 kumpf 1.13
|
115 chuck 1.2 CQLFunction(CQLIdentifier inOpType, Array<CQLPredicate> inParms);
116
117 ~CQLFunction();
|
118 kumpf 1.13 /**
|
119 chuck 1.2 The getValue method validates the parms versus FunctionOpType.
120 (A) resolves prarameter types
121 (B) number of parms
122 and then actually executes the function.
123 Returns a CQLValue object that has already been resolved.
124 */
125 CQLValue resolveValue(const CIMInstance& CI, const QueryContext& queryCtx);
126
|
127 kumpf 1.13 Array<CQLPredicate> getParms()const;
128
129 FunctionOpType getFunctionType()const;
130
131 String toString()const;
132
133 void applyContext(const QueryContext& inContext);
|
134 chuck 1.2
|
135 kumpf 1.13 CQLFunction& operator=(const CQLFunction& rhs);
136
137 // Boolean operator==(const CQLFunction& func)const;
138
139 // Boolean operator!=(const CQLFunction& func)const;
140
141 friend class CQLFactory;
142
143 private:
144
145 CQLFunctionRep *_rep;
|
146 chuck 1.2
147 };
148
149 PEGASUS_NAMESPACE_END
150 #endif
|
151 kumpf 1.13 #endif
|