1 chuck 1.2.2.5 //%2003////////////////////////////////////////////////////////////////////////
2 //
3 // 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 // IBM Corp.; EMC Corporation, The Open Group.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 chuck 1.2.2.5 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Authors: David Rosckes (rosckes@us.ibm.com)
27 // Bert Rivero (hurivero@us.ibm.com)
28 // Chuck Carmack (carmack@us.ibm.com)
29 // Brian Lucier (lucier@us.ibm.com)
30 //
31 // Modified By:
32 //
33 //%/////////////////////////////////////////////////////////////////////////////
34
|
35 humberto 1.1 #ifndef Pegasus_CQLFactor_h
36 #define Pegasus_CQLFactor_h
37
38 #include <Pegasus/Common/Config.h>
39 #include <Pegasus/CQL/CQLValue.h>
40 #include <Pegasus/CQL/Linkage.h>
41 #include <Pegasus/CQL/CQLScope.h>
|
42 humberto 1.2.2.2 //#include <Pegasus/CQL/CQLExpression.h>
43 #include <Pegasus/CQL/CQLPredicate.h>
|
44 humberto 1.1
45
46 PEGASUS_NAMESPACE_BEGIN
47
48 class PEGASUS_CQL_LINKAGE CQLFactory;
|
49 humberto 1.2.2.2 //class PEGASUS_CQL_LINKAGE CQLPredicate;
|
50 humberto 1.1 /*
51 CQLFunction objects are populated by the
52 Bison code.
53
54 Supported functions are in accordance with the
55 DMTF CQL Specification.
56 TODO: THIS LIST IS SUBJECT TO CHANGE
57
58 classname( <expr> )
59 classname( )
60 count(*)
61 count( distinct * )
62 count( distinct <expr> )
63 something for createarray
64 something for datetime
65 something for hostname
66 max( <expr> )
67 mean( <expr> )
68 median( <expr> )
69 min( <expr> )
70 something for modelpath
71 humberto 1.1 something for namespacename
72 something for namespacepath
73 something for objectpath
74 something for scheme
75 sum( <expr> )
76 something for userinfo
77 uppercase( <expr> )
78
79 */
80
81
82 class PEGASUS_CQL_LINKAGE CQLFunctionRep
83 {
84 public:
85
86
87 CQLFunctionRep() {};
|
88 chuck 1.2.2.4
|
89 humberto 1.2.2.3 CQLFunctionRep(const CQLFunctionRep* rep);
|
90 chuck 1.2.2.4
|
91 humberto 1.2.2.2 //CQLFunctionRep(FunctionOpType inFunctionOpType, Array<CQLExpression> inParms);
|
92 chuck 1.2.2.4
|
93 humberto 1.2.2.2 CQLFunctionRep(CQLIdentifier inOpType, Array<CQLPredicate> inParms);
|
94 chuck 1.2.2.4
|
95 humberto 1.2.2.2 ~CQLFunctionRep();
|
96 chuck 1.2.2.4
|
97 humberto 1.1 /**
98 The getValue method validates the parms versus FunctionOpType.
99 (A) resolves prarameter types
100 (B) number of parms
101 and then actually executes the function.
102 Returns a CQLValue object that has already been resolved.
103 */
104 CQLValue resolveValue(CIMInstance CI, QueryContext& queryCtx);
|
105 chuck 1.2.2.4
|
106 humberto 1.2.2.2 Array<CQLPredicate> getParms();
|
107 chuck 1.2.2.4
|
108 humberto 1.1 FunctionOpType getFunctionType();
|
109 chuck 1.2.2.4
|
110 humberto 1.1 String toString();
|
111 chuck 1.2.2.4
112 void applyContext(QueryContext& inContext);
113
|
114 humberto 1.1 Boolean operator==(const CQLFunctionRep& func);
|
115 chuck 1.2.2.4
|
116 humberto 1.1 Boolean operator!=(const CQLFunctionRep& func);
|
117 chuck 1.2.2.4
|
118 humberto 1.1 friend class CQLFactory;
119
|
120 lucier 1.2.2.6 private:
121 CQLValue dateTimeToMicrosecond(const CIMInstance& CI, const QueryContext& queryCtx);
122 CQLValue stringToUint(const CIMInstance& CI, const QueryContext& queryCtx);
123 CQLValue stringToSint(const CIMInstance& CI, const QueryContext& queryCtx);
124 CQLValue stringToReal(const CIMInstance& CI, const QueryContext& queryCtx);
125 CQLValue stringToNumeric(const CIMInstance& CI, const QueryContext& queryCtx);
126 CQLValue upperCase(const CIMInstance& CI, const QueryContext& queryCtx);
127 CQLValue numericToString(const CIMInstance& CI, const QueryContext& queryCtx);
128 CQLValue referenceToString(const CIMInstance& CI, const QueryContext& queryCtx);
129 CQLValue className(const CIMInstance& CI, const QueryContext& queryCtx);
130 CQLValue nameSpaceName(const CIMInstance& CI, const QueryContext& queryCtx);
131 CQLValue nameSpaceType(const CIMInstance& CI, const QueryContext& queryCtx);
132 CQLValue hostPort(const CIMInstance& CI, const QueryContext& queryCtx);
133 CQLValue modelPath(const CIMInstance& CI, const QueryContext& queryCtx);
134 CQLValue classPath(const CIMInstance& CI, const QueryContext& queryCtx);
135 CQLValue objectPath(const CIMInstance& CI, const QueryContext& queryCtx);
136 CQLValue instanceToReference(const CIMInstance& CI, const QueryContext& queryCtx);
137 CQLValue currentDateTime(const CIMInstance& CI, const QueryContext& queryCtx);
138 CQLValue dateTime(const CIMInstance& CI, const QueryContext& queryCtx);
139 CQLValue microsecondToTimestamp(const CIMInstance& CI, const QueryContext& queryCtx);
140 CQLValue microsecondToInterval(const CIMInstance& CI, const QueryContext& queryCtx);
|
141 humberto 1.1
142 FunctionOpType _funcOpType;
143
|
144 lucier 1.2.2.6 Array<CQLPredicate> _parms;
|
145 humberto 1.1
146 };
147
148 PEGASUS_NAMESPACE_END
149
150 #endif
|