1//===-- ModuleChild.h -------------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_ModuleChild_h_
11#define liblldb_ModuleChild_h_
12
13#include "lldb/lldb-private.h"
14
15namespace lldb_private {
16
17//----------------------------------------------------------------------
18/// @class ModuleChild ModuleChild.h "lldb/Core/ModuleChild.h"
19/// @brief A mix in class that contains a pointer back to the module
20///        that owns the object which inherits from it.
21//----------------------------------------------------------------------
22class ModuleChild
23{
24public:
25    //------------------------------------------------------------------
26    /// Construct with owning module.
27    ///
28    /// @param[in] module
29    ///     The module that owns the object that inherits from this
30    ///     class.
31    //------------------------------------------------------------------
32    ModuleChild (const lldb::ModuleSP &module_sp);
33
34    //------------------------------------------------------------------
35    /// Copy constructor.
36    ///
37    /// @param[in] rhs
38    ///     A const ModuleChild class reference to copy.
39    //------------------------------------------------------------------
40    ModuleChild (const ModuleChild& rhs);
41
42    //------------------------------------------------------------------
43    /// Destructor.
44    //------------------------------------------------------------------
45    ~ModuleChild();
46
47    //------------------------------------------------------------------
48    /// Assignment operator.
49    ///
50    /// @param[in] rhs
51    ///     A const ModuleChild class reference to copy.
52    ///
53    /// @return
54    ///     A const reference to this object.
55    //------------------------------------------------------------------
56    const ModuleChild&
57    operator= (const ModuleChild& rhs);
58
59    //------------------------------------------------------------------
60    /// Get const accessor for the module pointer.
61    ///
62    /// @return
63    ///     A const pointer to the module that owns the object that
64    ///     inherits from this class.
65    //------------------------------------------------------------------
66    lldb::ModuleSP
67    GetModule () const;
68
69    //------------------------------------------------------------------
70    /// Set accessor for the module pointer.
71    ///
72    /// @param[in] module
73    ///     A new module that owns the object that inherits from this
74    ///      class.
75    //------------------------------------------------------------------
76    void
77    SetModule (const lldb::ModuleSP &module_sp);
78
79protected:
80    //------------------------------------------------------------------
81    // Member variables
82    //------------------------------------------------------------------
83    lldb::ModuleWP m_module_wp;   ///< The Module that owns the object that inherits
84                                  ///< from this class.
85};
86
87} // namespace lldb_private
88
89
90#endif  // liblldb_ModuleChild_h_
91