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

  1 chuck 1.1.2.6 //%2003////////////////////////////////////////////////////////////////////////
  2 chuck 1.1.2.5 //
  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) 2004 BMC Software; Hewlett-Packard Development Company, L. P.;
  6               // 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 chuck 1.1.2.5 //
 24               //==============================================================================
 25               //
 26               // Authors: David Rosckes (rosckes@us.ibm.com)
 27               //          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.1 #ifndef Pegasus_CQLChainedIdentifierRep_h
 36                  #define Pegasus_CQLChainedIdentifierRep_h
 37                  
 38                  #include <Pegasus/Common/Config.h>
 39                  #include <Pegasus/CQL/Linkage.h>
 40                  #include <Pegasus/Common/Array.h>
 41                  #include <Pegasus/Common/String.h>
 42                  #include <Pegasus/CQL/CQLIdentifier.h>
 43 chuck    1.1.2.4 #include <Pegasus/CQL/QueryContext.h>
 44                  
 45 humberto 1.1.2.1 PEGASUS_NAMESPACE_BEGIN 
 46                  class PEGASUS_CQL_LINKAGE CQLScope;
 47 humberto 1.1.2.2 class PEGASUS_CQL_LINKAGE CQLFactory;
 48 humberto 1.1.2.1 /**  
 49                  CQLChainedIdentifier class is used for parsing (not resolving)
 50                  the identifier portion of a CQL select statement.  
 51                  A couple examples of a CQLIdentifier:
 52                  
 53                    Class.EmbeddedObject.Property[3]
 54                    Class.Property#'OK'
 55                  
 56                  
 57                  The CQLChainedIdentifier class can parse and return each
 58                   section of a CQL identifier.  The possible sections are:
 59                  
 60                       class (optional)
 61                       zero or more embedded objects
 62                       property
 63                  
 64                  Note:  this must handle wildcard("*"), embedded objects, arrays, symbolic
 65                  constants, etc.
 66                     */
 67                  class PEGASUS_CQL_LINKAGE CQLChainedIdentifierRep
 68                  {
 69 humberto 1.1.2.1   public:
 70                  
 71 humberto 1.1.2.3     CQLChainedIdentifierRep();
 72 humberto 1.1.2.1     /**  constructor 
 73                            Parses the string into the various components of a CQL identifier.
 74                            Throws parsing errors.
 75                        */
 76                      CQLChainedIdentifierRep(String inString);
 77                  
 78 humberto 1.1.2.3     CQLChainedIdentifierRep(CQLIdentifier &id);
 79 humberto 1.1.2.1  
 80 humberto 1.1.2.3     CQLChainedIdentifierRep(const CQLChainedIdentifierRep* rep);
 81 humberto 1.1.2.1 
 82 humberto 1.1.2.3     ~CQLChainedIdentifierRep();
 83 humberto 1.1.2.1 
 84                      /**  The getSubIdentifiers method
 85                      returns the array of subIdentifiers from a CQL SELECT
 86                      statement.  If there are no subidentifiers, an empty array is returned.
 87                      
 88                      Example:
 89                          myClass.embeddedObject.myProperty would return an array of 2 strings:
 90                      'myClass' and 'embeddedObject'.
 91                          myProperty would return an empty array.
 92                      
 93                        */
 94                      const Array<CQLIdentifier>& getSubIdentifiers()const;
 95                  
 96                      String toString()const;
 97                  
 98                      void append(CQLIdentifier & id);
 99                  
100                      Uint32 size();
101                  
102                      Boolean prepend(CQLIdentifier & id);
103                  
104 humberto 1.1.2.1     CQLIdentifier& operator[](Uint32 index);
105                  
106 humberto 1.1.2.3     CQLChainedIdentifierRep& operator=(const CQLChainedIdentifierRep& rhs);
107                  
108 humberto 1.1.2.1     Boolean isSubChain(CQLChainedIdentifier & chain);
109                  
110                      CQLIdentifier getLastIdentifier();
111                  	
112 chuck    1.1.2.4     void applyContext(QueryContext& inContext);
113 humberto 1.1.2.1 
114 humberto 1.1.2.2     friend class CQLFactory;
115                  
116 humberto 1.1.2.1   private:
117                  
118                      void parse(String & string);
119                  
120                      /**  The _subIdentifiers member variable is an array of Strings that are the
121                      parts of the CQL identifier that were delimited by the dots (.) except
122                            for the final part which is the _property member variable.
123                        */
124                      Array<CQLIdentifier> _subIdentifiers;
125                  
126                  };
127                  
128                  PEGASUS_NAMESPACE_END
129                  
130                  #endif /* Pegasus_CQLChainedIdentifierRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2