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

  1 karl  1.20 //%2005////////////////////////////////////////////////////////////////////////
  2 mike  1.8  //
  3 karl  1.19 // 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 karl  1.18 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.19 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl  1.20 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 mike  1.8  //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13 kumpf 1.13 // of this software and associated documentation files (the "Software"), to
 14            // deal in the Software without restriction, including without limitation the
 15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16 mike  1.8  // sell copies of the Software, and to permit persons to whom the Software is
 17            // furnished to do so, subject to the following conditions:
 18            // 
 19 kumpf 1.13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20 mike  1.8  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22 kumpf 1.13 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25 mike  1.8  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27            //
 28            //==============================================================================
 29            //
 30            // Author: Mike Brasher (mbrasher@bmc.com)
 31            //
 32 kumpf 1.14 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 33            //                (carolann_graves@hp.com)
 34 mike  1.8  //
 35            //%/////////////////////////////////////////////////////////////////////////////
 36            
 37            #ifndef Pegasus_DeclContext_h
 38            #define Pegasus_DeclContext_h
 39            
 40            #include <Pegasus/Common/Config.h>
 41 kumpf 1.17 #include <Pegasus/Common/ArrayInternal.h>
 42 kumpf 1.9  #include <Pegasus/Common/Pair.h>
 43 kumpf 1.16 #include <Pegasus/Common/CIMName.h>
 44 mike  1.8  #include <Pegasus/Common/CIMClass.h>
 45            #include <Pegasus/Common/CIMQualifierDecl.h>
 46 kumpf 1.15 #include <Pegasus/Common/Linkage.h>
 47 mike  1.8  
 48            PEGASUS_NAMESPACE_BEGIN
 49            
 50            /**
 51                This class is used internally as a source of CIM declarations.
 52 kumpf 1.14     It is passed to the resolve[objectType] () methods of the Resolver class
 53                (where [objectType] is Class, Instance, Property, Method, Parameter), and 
 54                in turn to the resolve () methods of the CIM[objectType]Rep classes. 
 55                Methods are provided for looking up class, qualifier, and instance 
 56                declarations.  This is an abstract base class: implementations must be 
 57                provided by derived classes.
 58 mike  1.8  */
 59            class PEGASUS_COMMON_LINKAGE DeclContext
 60            {
 61            public:
 62            
 63                virtual ~DeclContext();
 64            
 65                virtual CIMQualifierDecl lookupQualifierDecl(
 66 kumpf 1.16 	const CIMNamespaceName& nameSpace,
 67            	const CIMName& name) const = 0;
 68 mike  1.8  
 69                virtual CIMClass lookupClass(
 70 kumpf 1.16 	const CIMNamespaceName& nameSpace,
 71            	const CIMName& name) const = 0;
 72 mike  1.8  };
 73            
 74 kumpf 1.16 typedef Pair<CIMNamespaceName, CIMClass> CPair;
 75            typedef Pair<CIMNamespaceName, CIMQualifierDecl> QPair;
 76 mike  1.8  
 77            inline int operator==(const QPair& x, const QPair& y)
 78            {
 79                return 0;
 80            }
 81            
 82            inline int operator==(const CPair& x, const CPair& y)
 83            {
 84                return 0;
 85            }
 86            
 87            class PEGASUS_COMMON_LINKAGE SimpleDeclContext : public DeclContext
 88            {
 89            public:
 90            
 91                virtual ~SimpleDeclContext();
 92            
 93                void addQualifierDecl(
 94 kumpf 1.16 	const CIMNamespaceName& nameSpace,
 95 mike  1.8  	const CIMQualifierDecl& x);
 96            
 97                void addClass(
 98 kumpf 1.16 	const CIMNamespaceName& nameSpace,
 99 mike  1.8  	const CIMClass& x);
100            
101                virtual CIMQualifierDecl lookupQualifierDecl(
102 kumpf 1.16 	const CIMNamespaceName& nameSpace,
103            	const CIMName& name) const;
104 mike  1.8  
105                virtual CIMClass lookupClass(
106 kumpf 1.16 	const CIMNamespaceName& nameSpace,
107            	const CIMName& name) const;
108 mike  1.8  
109            private:
110            
111                Array<CPair> _classDeclarations;
112                Array<QPair> _qualifierDeclarations;
113            };
114            
115            PEGASUS_NAMESPACE_END
116            
117            #endif /* Pegasus_DeclContext_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2