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

  1 chuck 1.1.2.12 //%2003////////////////////////////////////////////////////////////////////////
  2 chuck 1.1.2.11 //
  3                // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
  4                // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
  5 chuck 1.1.2.13 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
  6 chuck 1.1.2.11 // 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                // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 23                //
 24                //==============================================================================
 25                //
 26                // Authors: David Rosckes (rosckes@us.ibm.com)
 27 chuck 1.1.2.11 //          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.2.7  #ifndef Pegasus_CQLExpression_h
 36                   #define Pegasus_CQLExpression_h
 37 humberto 1.1.2.1  
 38                   #include <Pegasus/Common/Config.h>
 39                   #include <Pegasus/CQL/CQLValue.h>
 40                   #include <Pegasus/CQL/Linkage.h>
 41                   #include <Pegasus/CQL/CQLTerm.h>
 42 humberto 1.1.2.7  
 43 humberto 1.1.2.17 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
 44                   
 45 humberto 1.1.2.1  PEGASUS_NAMESPACE_BEGIN
 46                   
 47 humberto 1.1.2.5  class PEGASUS_CQL_LINKAGE CQLFactory;
 48 humberto 1.1.2.7  class PEGASUS_CQL_LINKAGE CQLExpressionRep;
 49                   class PEGASUS_CQL_LINKAGE QueryContext;
 50 humberto 1.1.2.1  
 51                   /**  The enum is private, but the definition is public.
 52                         */
 53                       enum TermOpType {plus,minus};
 54                   
 55 david    1.1.2.4  #ifndef PEGASUS_ARRAY_T
 56                   #define PEGASUS_ARRAY_T TermOpType
 57                   #include <Pegasus/Common/ArrayInter.h>
 58                   #undef PEGASUS_ARRAY_T
 59                   #endif
 60                   
 61 humberto 1.1.2.1  /**
 62                     The CQLExpression class encapsulates a generic CQL expression to make it
 63                   easier to break into components and process the expression.  
 64                   
 65                      A CQL expression is made up of terms and operators. 
 66                      For example,  'A + B' is a CQLExpression, where 'A' and 'B' are terms, and
 67                   '+' is an operator.
 68                   
 69                      There must be exactly one more term than there are operators.
 70                     */
 71 humberto 1.1.2.7  
 72 humberto 1.1.2.1  class PEGASUS_CQL_LINKAGE CQLExpression
 73                   {
 74                     public:
 75 humberto 1.1.2.9     CQLExpression();
 76 humberto 1.1.2.1      /** constructor takes one CQLTerm object.
 77                         */
 78 humberto 1.1.2.15     CQLExpression(const CQLTerm& theTerm);
 79 david    1.1.2.2     CQLExpression(const CQLExpression& inExpress);
 80 humberto 1.1.2.1      /**  the getValue method evaluates the expression and returns the value.
 81                             Any property that need to be resolved into a value is taken from the
 82                       CIMInstance.
 83                         */
 84 humberto 1.1.2.7      ~CQLExpression();
 85 humberto 1.1.2.1  
 86 david    1.1.2.16     CQLValue resolveValue(const CIMInstance& CI, const QueryContext& QueryCtx);
 87 humberto 1.1.2.1  
 88                       /** The appendOperation is used by Bison.
 89                             It is invoked 0 or more times for the CQLExpression, and
 90                             when invoked will always pass in an integer that is the Term operation
 91                             type and a CQLTerm object.
 92                         */
 93 humberto 1.1.2.15     void appendOperation(const TermOpType theTermOpType, const CQLTerm& theTerm);
 94 humberto 1.1.2.1  
 95 humberto 1.1.2.15    String toString()const;
 96 chuck    1.1.2.10 
 97 humberto 1.1.2.15    Boolean isSimple()const;
 98 chuck    1.1.2.10 
 99 humberto 1.1.2.15    Boolean isSimpleValue()const;
100 chuck    1.1.2.10 
101 humberto 1.1.2.15    Array<CQLTerm> getTerms()const;
102 chuck    1.1.2.10 
103 humberto 1.1.2.15    Array<TermOpType> getOperators()const;
104 chuck    1.1.2.10 
105 david    1.1.2.14    void applyContext(QueryContext& inContext, 
106                                        CQLChainedIdentifier inCid = CQLChainedIdentifier());
107 chuck    1.1.2.10 
108 humberto 1.1.2.9     CQLExpression& operator=(const CQLExpression& rhs);
109 chuck    1.1.2.10 
110 humberto 1.1.2.15    Boolean operator==(const CQLExpression& expr)const;
111 chuck    1.1.2.10 
112 humberto 1.1.2.15    Boolean operator!=(const CQLExpression& expr)const;
113 chuck    1.1.2.10 
114 humberto 1.1.2.5     friend class CQLFactory;
115 david    1.1.2.2  
116 humberto 1.1.2.1    private:
117                   
118 humberto 1.1.2.7  	CQLExpressionRep *_rep;   
119 humberto 1.1.2.1  };
120                   
121                   #ifndef PEGASUS_ARRAY_T
122                   #define PEGASUS_ARRAY_T CQLExpression
123                   #include <Pegasus/Common/ArrayInter.h>
124                   #undef PEGASUS_ARRAY_T
125                   #endif
126                   
127                   PEGASUS_NAMESPACE_END
128                   
129 humberto 1.1.2.17 #endif
130 humberto 1.1.2.7  #endif 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2