1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
8 #ifndef _REFCLASSWRITER_H_
9 #define _REFCLASSWRITER_H_
11 #include "iceefilegen.h"
14 // This will create a Class
15 class RefClassWriter {
17 friend class COMDynamicWrite;
18 IMetaDataEmit2* m_emitter; // Emit interface.
19 IMetaDataImport* m_importer; // Import interface.
20 IMDInternalImport* m_internalimport; // Scopeless internal import interface
22 ICeeFileGen* m_pCeeFileGen;
24 IMetaDataEmitHelper* m_pEmitHelper;
25 ULONG m_ulResourceSize;
27 IMetaDataEmit* m_pOnDiskEmitter;
31 LIMITED_METHOD_CONTRACT;
32 m_pOnDiskEmitter = NULL;
35 HRESULT Init(ICeeGen *pCeeGen, IUnknown *pUnk, LPCWSTR szName);
37 IMetaDataEmit2* GetEmitter() {
38 LIMITED_METHOD_CONTRACT;
42 IMetaDataEmitHelper* GetEmitHelper() {
43 LIMITED_METHOD_CONTRACT;
47 IMetaDataImport* GetRWImporter() {
48 LIMITED_METHOD_CONTRACT;
52 IMDInternalImport* GetMDImport() {
53 LIMITED_METHOD_CONTRACT;
54 return m_internalimport;
57 ICeeGen* GetCeeGen() {
58 LIMITED_METHOD_CONTRACT;
62 ICeeFileGen* GetCeeFileGen() {
63 LIMITED_METHOD_CONTRACT;
67 HCEEFILE GetHCEEFILE() {
68 LIMITED_METHOD_CONTRACT;
72 IMetaDataEmit* GetOnDiskEmitter() {
73 LIMITED_METHOD_CONTRACT;
74 return m_pOnDiskEmitter;
77 void SetOnDiskEmitter(IMetaDataEmit *pOnDiskEmitter) {
81 // we know that the com implementation is ours so we use mode-any to simplify
82 // having to switch mode
88 pOnDiskEmitter->AddRef();
90 m_pOnDiskEmitter->Release();
91 m_pOnDiskEmitter = pOnDiskEmitter;
98 #endif // _REFCLASSWRITER_H_