| 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. |
| 4 | // ============================================================ |
| 5 | // |
| 6 | // AssemblyEntry.hpp |
| 7 | // |
| 8 | |
| 9 | |
| 10 | // |
| 11 | // Defines the AssemblyEntry class |
| 12 | // |
| 13 | // ============================================================ |
| 14 | |
| 15 | #ifndef __BINDER__ASSEMBLY_ENTRY_HPP__ |
| 16 | #define __BINDER__ASSEMBLY_ENTRY_HPP__ |
| 17 | |
| 18 | #include "bindertypes.hpp" |
| 19 | #include "assemblyname.hpp" |
| 20 | |
| 21 | namespace BINDER_SPACE |
| 22 | { |
| 23 | class AssemblyEntry |
| 24 | { |
| 25 | public: |
| 26 | AssemblyEntry() |
| 27 | { |
| 28 | m_pAssemblyName = NULL; |
| 29 | } |
| 30 | virtual ~AssemblyEntry() |
| 31 | { |
| 32 | SAFE_RELEASE(m_pAssemblyName); |
| 33 | } |
| 34 | |
| 35 | AssemblyName *GetAssemblyName(BOOL fAddRef = FALSE) |
| 36 | { |
| 37 | AssemblyName *pAssemblyName = m_pAssemblyName; |
| 38 | |
| 39 | if (fAddRef && (pAssemblyName != NULL)) |
| 40 | { |
| 41 | pAssemblyName->AddRef(); |
| 42 | } |
| 43 | return pAssemblyName; |
| 44 | } |
| 45 | |
| 46 | void SetAssemblyName(AssemblyName *pAssemblyName, BOOL fAddRef = TRUE) |
| 47 | { |
| 48 | SAFE_RELEASE(m_pAssemblyName); |
| 49 | |
| 50 | if (fAddRef && (pAssemblyName != NULL)) |
| 51 | { |
| 52 | pAssemblyName->AddRef(); |
| 53 | } |
| 54 | |
| 55 | m_pAssemblyName = pAssemblyName; |
| 56 | } |
| 57 | protected: |
| 58 | AssemblyName *m_pAssemblyName; |
| 59 | }; |
| 60 | }; |
| 61 | |
| 62 | #endif |
| 63 |