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