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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2