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