1 mike 1.2 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a
6 // copy of this software and associated documentation files (the "Software"),
7 // to deal in the Software without restriction, including without limitation
8 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 // and/or sell copies of the Software, and to permit persons to whom the
10 // Software is furnished to do so, subject to the following conditions:
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 // DEALINGS IN THE SOFTWARE.
19 //
20 //==============================================================================
21 //
22 mike 1.2 // Author: Mike Brasher (mbrasher@bmc.com)
23 //
24 // Modified By:
25 //
26 //%/////////////////////////////////////////////////////////////////////////////
27
28 #ifndef PegasusCompiler_Compiler_Decl_Context_h
29 #define PegasusCompiler_Compiler_Decl_Context_h
30
31 ////////////////////////////////////////////////////////////////////////////////
32 //
33 // compilerDeclContext
34 //
35 // This context is used by the resolve() methods to lookup dependent
36 // objects during resolution. This subclass takes into account
37 // environments where some or all of the objects which need
38 // to exist are not in the repository, but rather have been
39 // explicitly provided.
40 //
41 //////////////////////////////////////////////////////////////////////////////
42
43 mike 1.2 #include <Pegasus/Common/Config.h>
44 #include <Pegasus/Common/Array.h>
45 #include <Pegasus/Repository/RepositoryDeclContext.h>
46 #include <Pegasus/Compiler/cimmofRepository.h>
47
48 class compilerDeclContext : public RepositoryDeclContext {
49 public:
50 compilerDeclContext(cimmofRepository *repository,
51 cimmofRepository::operationType ot);
52
53 virtual ~compilerDeclContext();
54
55 virtual
56 CIMQualifierDecl lookupQualifierDecl (const String &nameSpace,
57 const String &qualifierName) const;
58 virtual
59 CIMClass lookupClass (const String &nameSpace,
60 const String &className) const;
61
62 void addQualifierDecl (const String &nameSpace,
63 const CIMQualifierDecl& x);
64 mike 1.2
65 void addClass (const String &nameSpace,
66 CIMClass &x);
67 private:
68 cimmofRepository *_cimmofRepository;
69 cimmofRepository::operationType _ot;
70 Array<CIMClass> _classes;
71 Array<CIMQualifierDecl> _qualifiers;
72 Array<CIMInstance> _instances;
73 const CIMClass *_findClassInMemory(const String &classname) const;
74 const CIMQualifierDecl *_findQualifierInMemory(const String &name) const;
75 };
76
77 #endif // PegasusCompiler_Compiler_Decl_Context_h
|