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

  1 karl  1.21 //%2006////////////////////////////////////////////////////////////////////////
  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 karl  1.21 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.8  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15 kumpf 1.13 // 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 mike  1.8  // 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            // 
 21 kumpf 1.13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike  1.8  // 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 kumpf 1.13 // 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 mike  1.8  // 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            // Author: Mike Brasher (mbrasher@bmc.com)
 33            //
 34 kumpf 1.14 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 35            //                (carolann_graves@hp.com)
 36 mike  1.8  //
 37            //%/////////////////////////////////////////////////////////////////////////////
 38            
 39            #ifndef Pegasus_DeclContext_h
 40            #define Pegasus_DeclContext_h
 41            
 42            #include <Pegasus/Common/Config.h>
 43 kumpf 1.17 #include <Pegasus/Common/ArrayInternal.h>
 44 kumpf 1.9  #include <Pegasus/Common/Pair.h>
 45 kumpf 1.16 #include <Pegasus/Common/CIMName.h>
 46 mike  1.8  #include <Pegasus/Common/CIMClass.h>
 47            #include <Pegasus/Common/CIMQualifierDecl.h>
 48 kumpf 1.15 #include <Pegasus/Common/Linkage.h>
 49 mike  1.8  
 50            PEGASUS_NAMESPACE_BEGIN
 51            
 52            /**
 53                This class is used internally as a source of CIM declarations.
 54 kumpf 1.14     It is passed to the resolve[objectType] () methods of the Resolver class
 55                (where [objectType] is Class, Instance, Property, Method, Parameter), and 
 56                in turn to the resolve () methods of the CIM[objectType]Rep classes. 
 57                Methods are provided for looking up class, qualifier, and instance 
 58                declarations.  This is an abstract base class: implementations must be 
 59                provided by derived classes.
 60 mike  1.8  */
 61            class PEGASUS_COMMON_LINKAGE DeclContext
 62            {
 63            public:
 64            
 65                virtual ~DeclContext();
 66            
 67                virtual CIMQualifierDecl lookupQualifierDecl(
 68 kumpf 1.16 	const CIMNamespaceName& nameSpace,
 69            	const CIMName& name) const = 0;
 70 mike  1.8  
 71                virtual CIMClass lookupClass(
 72 kumpf 1.16 	const CIMNamespaceName& nameSpace,
 73            	const CIMName& name) const = 0;
 74 mike  1.8  };
 75            
 76 kumpf 1.16 typedef Pair<CIMNamespaceName, CIMClass> CPair;
 77            typedef Pair<CIMNamespaceName, CIMQualifierDecl> QPair;
 78 mike  1.8  
 79            inline int operator==(const QPair& x, const QPair& y)
 80            {
 81                return 0;
 82            }
 83            
 84            inline int operator==(const CPair& x, const CPair& y)
 85            {
 86                return 0;
 87            }
 88            
 89            class PEGASUS_COMMON_LINKAGE SimpleDeclContext : public DeclContext
 90            {
 91            public:
 92            
 93                virtual ~SimpleDeclContext();
 94            
 95                void addQualifierDecl(
 96 kumpf 1.16 	const CIMNamespaceName& nameSpace,
 97 mike  1.8  	const CIMQualifierDecl& x);
 98            
 99                void addClass(
100 kumpf 1.16 	const CIMNamespaceName& nameSpace,
101 mike  1.8  	const CIMClass& x);
102            
103                virtual CIMQualifierDecl lookupQualifierDecl(
104 kumpf 1.16 	const CIMNamespaceName& nameSpace,
105            	const CIMName& name) const;
106 mike  1.8  
107                virtual CIMClass lookupClass(
108 kumpf 1.16 	const CIMNamespaceName& nameSpace,
109            	const CIMName& name) const;
110 mike  1.8  
111            private:
112            
113                Array<CPair> _classDeclarations;
114                Array<QPair> _qualifierDeclarations;
115            };
116            
117            PEGASUS_NAMESPACE_END
118            
119            #endif /* Pegasus_DeclContext_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2