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 // Authors: David Rosckes (rosckes@us.ibm.com)
33 // Bert Rivero (hurivero@us.ibm.com)
34 chuck 1.3 // Chuck Carmack (carmack@us.ibm.com)
35 // Brian Lucier (lucier@us.ibm.com)
36 //
|
37 vijay.eli 1.8 // Modified By: Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590
|
38 chuck 1.3 //
39 //%/////////////////////////////////////////////////////////////////////////////
40
|
41 humberto 1.1 #ifndef Pegasus_CQLFactor_h
42 #define Pegasus_CQLFactor_h
43
44 #include <Pegasus/Common/Config.h>
45 #include <Pegasus/CQL/Linkage.h>
|
46 chuck 1.3 #include <Pegasus/CQL/CQLPredicate.h>
|
47 lucier 1.4 #include <Pegasus/CQL/CQLFunction.h>
|
48 humberto 1.1
49
50 PEGASUS_NAMESPACE_BEGIN
51
|
52 lucier 1.4 // Forward declares
|
53 mike 1.10 class CIMNamespaceName;
54 class CQLFactory;
|
55 humberto 1.1
|
56 mike 1.10 class CQLFunctionRep
|
57 humberto 1.1 {
58 public:
59
|
60 chuck 1.3
|
61 humberto 1.6 CQLFunctionRep();
|
62 chuck 1.3
|
63 humberto 1.6 CQLFunctionRep(const CQLFunctionRep* rep);
|
64 chuck 1.3
65 CQLFunctionRep(CQLIdentifier inOpType, Array<CQLPredicate> inParms);
66
|
67 humberto 1.6 ~CQLFunctionRep();
|
68 chuck 1.3
|
69 humberto 1.1 /**
|
70 humberto 1.6 The getValue method validates the parms versus FunctionOpType.
71 (A) resolves prarameter types
72 (B) number of parms
73 and then actually executes the function.
74 Returns a CQLValue object that has already been resolved.
75 */
|
76 chuck 1.3 CQLValue resolveValue(const CIMInstance& CI, const QueryContext& queryCtx);
77
|
78 humberto 1.6 Array<CQLPredicate> getParms() const;
|
79 chuck 1.3
|
80 lucier 1.4 FunctionOpType getFunctionType() const;
|
81 chuck 1.3
82 String toString()const;
83
|
84 vijay.eli 1.8 void applyContext(const QueryContext& inContext);
|
85 chuck 1.3
|
86 humberto 1.6 // Boolean operator==(const CQLFunctionRep& func)const;
|
87 chuck 1.3
|
88 humberto 1.6 // Boolean operator!=(const CQLFunctionRep& func)const;
|
89 chuck 1.3
|
90 humberto 1.1 friend class CQLFactory;
91
|
92 chuck 1.3 private:
|
93 lucier 1.4 CQLValue dateTimeToMicrosecond(const CIMInstance& CI, const QueryContext& queryCtx) const;
94 CQLValue stringToUint(const CIMInstance& CI, const QueryContext& queryCtx) const;
95 CQLValue stringToSint(const CIMInstance& CI, const QueryContext& queryCtx) const;
96 CQLValue stringToReal(const CIMInstance& CI, const QueryContext& queryCtx) const;
97 CQLValue stringToNumeric(const CIMInstance& CI, const QueryContext& queryCtx) const;
98 CQLValue upperCase(const CIMInstance& CI, const QueryContext& queryCtx) const;
99 CQLValue numericToString(const CIMInstance& CI, const QueryContext& queryCtx) const;
100 CQLValue referenceToString(const CIMInstance& CI, const QueryContext& queryCtx) const;
101 CQLValue className(const CIMInstance& CI, const QueryContext& queryCtx) const;
102 CQLValue nameSpaceName(const CIMInstance& CI, const QueryContext& queryCtx) const;
103 CQLValue nameSpaceType(const CIMInstance& CI, const QueryContext& queryCtx) const;
104 CQLValue hostPort(const CIMInstance& CI, const QueryContext& queryCtx) const;
105 CQLValue modelPath(const CIMInstance& CI, const QueryContext& queryCtx) const;
106 CQLValue classPath(const CIMInstance& CI, const QueryContext& queryCtx) const;
107 CQLValue objectPath(const CIMInstance& CI, const QueryContext& queryCtx) const;
108 CQLValue instanceToReference(const CIMInstance& CI, const QueryContext& queryCtx) const;
109 CQLValue currentDateTime() const;
110 CQLValue dateTime(const CIMInstance& CI, const QueryContext& queryCtx) const;
111 CQLValue microsecondToTimestamp(const CIMInstance& CI, const QueryContext& queryCtx) const;
112 CQLValue microsecondToInterval(const CIMInstance& CI, const QueryContext& queryCtx) const;
113
114 lucier 1.4 // Used by the path functions
115 CQLValue buildModelPath(const CIMObjectPath& objPath) const;
116 CQLValue buildClassPath(const CIMObjectPath& objPath, const CIMNamespaceName& ns) const;
117 CQLValue buildObjectPath(const CIMObjectPath& objPath, const CIMNamespaceName& ns) const;
|
118 humberto 1.1
|
119 lucier 1.5 // Utility methods to convert enums into strings
120 String functionTypeToString() const;
121
122 // Member data
|
123 humberto 1.1 FunctionOpType _funcOpType;
|
124 chuck 1.3 Array<CQLPredicate> _parms;
|
125 humberto 1.1
126 };
127
128 PEGASUS_NAMESPACE_END
129
130 #endif
|