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

  1 karl  1.6 //%2006////////////////////////////////////////////////////////////////////////
  2 chuck 1.2 //
  3 karl  1.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 chuck 1.2 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.3 // 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.6 // 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.6 // 
 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 david.dillard 1.4 #ifndef Pegasus_CQLSimplePredicateRep_h
 35 chuck         1.2 #define Pegasus_CQLSimplePredicateRep_h
 36                   
 37                   #include <Pegasus/CQL/Linkage.h>
 38                   #include <Pegasus/CQL/CQLExpression.h>
 39                   
 40                   //#include <Pegasus/Common/CIMInstance.h>
 41                   //#include <Pegasus/CQL/QueryContext.h>
 42                   
 43                   PEGASUS_NAMESPACE_BEGIN
 44                   
 45 mike          1.7 class CQLExpression;
 46                   class CQLFactory;
 47                   class QueryContext;
 48 chuck         1.2 
 49                   class CQLSimplePredicateRep
 50                   {
 51                     public:
 52                       CQLSimplePredicateRep();
 53                   
 54                       CQLSimplePredicateRep(const CQLExpression& inExpression);
 55                   
 56 karl          1.8     CQLSimplePredicateRep(const CQLExpression& inExpression,
 57                               ExpressionOpType inOperator);
 58 chuck         1.2 
 59                       CQLSimplePredicateRep(const CQLExpression& leftSideExpression,
 60 david.dillard 1.4                           const CQLExpression& rightSideExpression,
 61                                             ExpressionOpType inOperator);
 62 chuck         1.2 
 63                       CQLSimplePredicateRep(const CQLSimplePredicateRep* rep);
 64                   
 65                       ~CQLSimplePredicateRep(){}
 66                   
 67 david.dillard 1.4     /**
 68                         CQLExpressions:
 69                             For an expression, CQLExpression::getValue is called and will
 70                             return a CQLValue.
 71                             The appropriate operator is then invoked on CQLValue and that
 72                             operator function will enforce the type restrictions as documented
 73                             in the DMTF CQL Specification.
 74 chuck         1.2           That operator then determines whether the predicate is TRUE / FALSE.
 75 david.dillard 1.4 
 76                   
 77                          CQLPredicates:
 78 chuck         1.2           The CQLPredicate is non-terminal if it contains only CQLPredicate
 79 david.dillard 1.4           objects.
 80 chuck         1.2           A non-terminal CQLPredicate is evaluated by in turn evaluating the
 81 david.dillard 1.4           contained CQLPredicates and boolean operator.
 82                             Valid operators are:
 83 chuck         1.2                   AND, OR
 84 david.dillard 1.4 
 85                             For the evaluate method on each CQLPredicate. the CQLPredicate is
 86                             evaluated to TRUE/FALSE and the result of the evaluation is then
 87                             applied to the appropriate boolean operator.
 88                   
 89                             The result of the evaluation is and then inverted if the _invert
 90                             member variable is set to TRUE and then returned to the caller.
 91                   
 92 chuck         1.2       */
 93                       Boolean evaluate(CIMInstance CI, QueryContext& QueryCtx);
 94                   
 95                       CQLExpression getLeftExpression()const;
 96                   
 97                       CQLExpression getRightExpression()const;
 98                   
 99 david.dillard 1.4     ExpressionOpType getOperation()const;
100 chuck         1.2 
101 vijay.eli     1.5     void applyContext(const QueryContext& queryContext);
102 chuck         1.2 
103                       String toString()const;
104                   
105                       Boolean isSimple()const;
106                   
107                       Boolean isSimpleValue()const;
108                   
109                       void setOperation(ExpressionOpType op);
110                   
111                       friend class CQLFactory;
112 david.dillard 1.4 
113                   private:
114 chuck         1.2     CQLExpression _leftSide;
115                   
116                       CQLExpression _rightSide;
117                   
118                       ExpressionOpType _operator;
119                       Boolean _isSimple;
120                   };
121                   PEGASUS_NAMESPACE_END
122                   
123 david.dillard 1.4 #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2