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

  1 humberto 1.1.2.1 #ifndef CQLEXPRESSION_H_HEADER_INCLUDED_BEE5929F
  2                  #define CQLEXPRESSION_H_HEADER_INCLUDED_BEE5929F
  3                  
  4                  #include <Pegasus/Common/Config.h>
  5                  #include <Pegasus/CQL/CQLValue.h>
  6                  
  7                  
  8                  #include <Pegasus/CQL/Linkage.h>
  9                  #include <Pegasus/CQL/CQLTerm.h>
 10                  #define MAXFACTORS 50
 11                  PEGASUS_NAMESPACE_BEGIN
 12                  
 13 humberto 1.1.2.5 class PEGASUS_CQL_LINKAGE CQLFactory;
 14 humberto 1.1.2.1 
 15                  /**  The enum is private, but the definition is public.
 16                        */
 17                      //##ModelId=40FC040E0079
 18                      enum TermOpType {plus,minus};
 19                  
 20 david    1.1.2.4 #ifndef PEGASUS_ARRAY_T
 21                  #define PEGASUS_ARRAY_T TermOpType
 22                  #include <Pegasus/Common/ArrayInter.h>
 23                  #undef PEGASUS_ARRAY_T
 24                  #endif
 25                  
 26 humberto 1.1.2.1 /**
 27                    The CQLExpression class encapsulates a generic CQL expression to make it
 28                  easier to break into components and process the expression.  
 29                  
 30                     A CQL expression is made up of terms and operators. 
 31                     For example,  'A + B' is a CQLExpression, where 'A' and 'B' are terms, and
 32                  '+' is an operator.
 33                  
 34                     There must be exactly one more term than there are operators.
 35                    */
 36                  //##ModelId=40FC03230150
 37                  class PEGASUS_CQL_LINKAGE CQLExpression
 38                  {
 39                    public:
 40                     CQLExpression(){}
 41                      /** constructor takes one CQLTerm object.
 42                        */
 43                      //##ModelId=40FD308002EE
 44                      CQLExpression(CQLTerm& theTerm);
 45 david    1.1.2.2    CQLExpression(const CQLExpression& inExpress);
 46 humberto 1.1.2.1     /**  the getValue method evaluates the expression and returns the value.
 47                            Any property that need to be resolved into a value is taken from the
 48                      CIMInstance.
 49                        */
 50                      ~CQLExpression(){}
 51                  
 52                      //##ModelId=40FC0323015B
 53 david    1.1.2.3     CQLValue resolveValue(CIMInstance CI, QueryContext& QueryCtx);
 54 humberto 1.1.2.1 
 55                      /** The appendOperation is used by Bison.
 56                            It is invoked 0 or more times for the CQLExpression, and
 57                            when invoked will always pass in an integer that is the Term operation
 58                            type and a CQLTerm object.
 59                        */
 60                      //##ModelId=40FD30BB03C3
 61                      void appendOperation(TermOpType theTermOpType, CQLTerm& theTerm);
 62                  
 63 david    1.1.2.2    String toString();
 64 david    1.1.2.3    Boolean isSimpleValue();
 65                     Array<CQLTerm> getTerms();
 66                     Array<TermOpType> getOperators();
 67                     void applyScopes(Array<CQLScope> inScopes);
 68 humberto 1.1.2.6    Boolean operator==(const CQLExpression& expr);
 69                     Boolean operator!=(const CQLExpression& expr);
 70 humberto 1.1.2.5    friend class CQLFactory;
 71 david    1.1.2.2 
 72 humberto 1.1.2.1   private:
 73                     
 74                  
 75                      /**  The _TermOperators member variable is an 
 76                             array of operators that are valid to operate on Terms in a CQL
 77                      expression. 
 78                             Valid operators include concatentation, plus and minus.
 79                      
 80                             The array is ordered according to the operation from left to right.
 81                        */
 82                      //##ModelId=40FC036B036A
 83 david    1.1.2.3     
 84                      Array<TermOpType> _TermOperators;
 85 humberto 1.1.2.1 
 86                      /**  The _CQLTerms member variable is an 
 87                             array of operands that are valid in a CQL expression. 
 88                      
 89                             The array is ordered according to the operation from left to right.
 90                        */
 91                      //##ModelId=40FC2F2C0341
 92                      Array<CQLTerm> _CQLTerms;
 93                  
 94                  };
 95                  
 96                  #ifndef PEGASUS_ARRAY_T
 97                  #define PEGASUS_ARRAY_T CQLExpression
 98                  #include <Pegasus/Common/ArrayInter.h>
 99                  #undef PEGASUS_ARRAY_T
100                  #endif
101                  
102                  PEGASUS_NAMESPACE_END
103                  
104                  
105                  #endif /* CQLEXPRESSION_H_HEADER_INCLUDED_BEE5929F */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2