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

  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 karl  1.8 // 
 21 chuck 1.2 // 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           #ifndef Pegasus_CQLPredicateRep_h
 35           #define Pegasus_CQLPredicateRep_h
 36           
 37 david.dillard 1.6 #include <Pegasus/CQL/Linkage.h>
 38 chuck         1.2 #include <Pegasus/CQL/CQLSimplePredicate.h>
 39                   
 40                   
 41                   PEGASUS_NAMESPACE_BEGIN
 42                   
 43 mike          1.9 class QueryContext;
 44                   class CQLFactory;
 45 chuck         1.2 
 46 david.dillard 1.6 /**
 47 chuck         1.2    This object is populated by Bison.
 48                   
 49 karl          1.10    Valid operations for each type of CQLValue are in accordance with the
 50                       DMTF CQL Specification.
 51 david.dillard 1.6  
 52 chuck         1.2     The CQLPredicate is considered "terminal" if it does not contain any
 53 karl          1.10    CQLPredicate objects.
 54 chuck         1.2      A 'terminal' predicate can be evaluated to TRUE/FALSE by examining the
 55 karl          1.10     CQLExpressions and operator.
 56 chuck         1.2      Valid operators are:
 57                                <, >, =, <=, >=, <>, IS NULL, IS NOT NULL, ISA, LIKE
 58                    
 59 david.dillard 1.6     CQLExpressions:
 60 chuck         1.2        For an expression, CQLExpression::getValue is called and will return a
 61 karl          1.10       CQLValue.
 62 chuck         1.2        The appropriate operator is then invoked on CQLValue and that operator
 63 karl          1.10       function will
 64 chuck         1.2        enforce the type restrictions as documented in the DMTF CQL
 65 karl          1.10       Specification.
 66 chuck         1.2        That operator then determines whether the predicate is TRUE / FALSE.
 67                    
 68                    
 69 david.dillard 1.6     CQLPredicates:
 70 chuck         1.2        The CQLPredicate is non-terminal if it contains only CQLPredicate
 71 karl          1.10       objects.
 72 chuck         1.2        A non-terminal CQLPredicate is evaluated by in turn evaluating the
 73 karl          1.10       contained CQLPredicates and  boolean operator.
 74 chuck         1.2       Valid operators are:
 75                                  AND, OR
 76                    
 77 karl          1.10     For the evaluate method on each CQLPredicate. the CQLPredicate is
 78                        evaluated to TRUE/FALSE and
 79                         the result of the evaluation is then applied to the appropriate
 80                         boolean operator.
 81                    
 82                        The result of the evaluation is and then inverted if the _invert
 83                        member variable is set to TRUE and then returned to the caller.
 84 chuck         1.2  
 85                       */
 86 mike          1.9  class CQLPredicateRep
 87 chuck         1.2  {
 88                      public:
 89                        CQLPredicateRep();
 90 david.dillard 1.6  
 91 karl          1.10     CQLPredicateRep(const CQLSimplePredicate & inSimplePredicate,
 92                                        Boolean inVerted = false);
 93 chuck         1.2  
 94                        CQLPredicateRep(const CQLPredicate & inPredicate, Boolean inVerted = false);
 95                    
 96                        CQLPredicateRep(const CQLPredicateRep* rep);
 97                    
 98                       ~CQLPredicateRep(){}
 99 david.dillard 1.6      /**
100                          CQLExpressions:
101 karl          1.10           For an expression, CQLExpression::getValue is called and will return
102                              a CQLValue.
103                              The appropriate operator is then invoked on CQLValue and that
104                              operator function will enforce the type restrictions as documented
105                              in the DMTF CQL
106 chuck         1.2      Specification.
107                              That operator then determines whether the predicate is TRUE / FALSE.
108 david.dillard 1.6  
109                    
110                           CQLPredicates:
111 chuck         1.2            The CQLPredicate is non-terminal if it contains only CQLPredicate
112 karl          1.10           objects.
113 chuck         1.2            A non-terminal CQLPredicate is evaluated by in turn evaluating the
114 karl          1.10           contained CQLPredicates and boolean operator.
115 chuck         1.2           Valid operators are:
116                                      AND, OR
117 david.dillard 1.6  
118 chuck         1.2           For the evaluate method on each CQLPredicate. the CQLPredicate is
119 karl          1.10          evaluated to TRUE/FALSE and the result of the evaluation is then
120                             applied to the appropriate boolean operator.
121 david.dillard 1.6  
122 karl          1.10         The result of the evaluation is and then inverted if the _invert
123                            member variable is set to TRUE and then returned to the caller.
124 david.dillard 1.6  
125 chuck         1.2        */
126                        Boolean evaluate(CIMInstance CI, QueryContext& QueryCtx);
127                    
128                        Boolean getInverted()const;
129                    
130 humberto      1.4      void setInverted(Boolean invert);
131 chuck         1.2  
132                        /** Appends a predicate to the predicate array. This method should only
133                                be called by Bison.
134                            */
135 humberto      1.3      void appendPredicate(const CQLPredicate& inPredicate);
136                    
137 karl          1.10     void appendPredicate(const CQLPredicate& inPredicate,
138                                BooleanOpType inBooleanOperator);
139 chuck         1.2  
140                        Array<CQLPredicate> getPredicates()const;
141 david.dillard 1.6  
142 chuck         1.2      CQLSimplePredicate getSimplePredicate()const;
143                    
144                        Array<BooleanOpType> getOperators()const;
145                    
146 vijay.eli     1.7      void applyContext(const QueryContext& queryContext);
147 chuck         1.2  
148                        Boolean isSimple()const;
149                    
150                        Boolean isSimpleValue()const;
151                        String toString()const;
152 humberto      1.3  
153 chuck         1.2      friend class CQLFactory;
154                      private:
155 david.dillard 1.6  
156 chuck         1.2     Array<CQLPredicate> _predicates;
157                       CQLSimplePredicate _simplePredicate;
158                       Array<BooleanOpType> _operators;
159                    
160 humberto      1.3     Boolean _invert;
161 chuck         1.2  
162                    };
163                    
164                    PEGASUS_NAMESPACE_END
165                    
166 david.dillard 1.6  #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2