]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/include/lldb/Core/ModuleChild.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / include / lldb / Core / ModuleChild.h
1 //===-- ModuleChild.h -------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef liblldb_ModuleChild_h_
10 #define liblldb_ModuleChild_h_
11
12 #include "lldb/lldb-forward.h"
13
14 namespace lldb_private {
15
16 /// \class ModuleChild ModuleChild.h "lldb/Core/ModuleChild.h"
17 /// A mix in class that contains a pointer back to the module
18 ///        that owns the object which inherits from it.
19 class ModuleChild {
20 public:
21   /// Construct with owning module.
22   ///
23   /// \param[in] module
24   ///     The module that owns the object that inherits from this
25   ///     class.
26   ModuleChild(const lldb::ModuleSP &module_sp);
27
28   /// Destructor.
29   ~ModuleChild();
30
31   /// Assignment operator.
32   ///
33   /// \param[in] rhs
34   ///     A const ModuleChild class reference to copy.
35   ///
36   /// \return
37   ///     A const reference to this object.
38   const ModuleChild &operator=(const ModuleChild &rhs);
39
40   /// Get const accessor for the module pointer.
41   ///
42   /// \return
43   ///     A const pointer to the module that owns the object that
44   ///     inherits from this class.
45   lldb::ModuleSP GetModule() const;
46
47   /// Set accessor for the module pointer.
48   ///
49   /// \param[in] module
50   ///     A new module that owns the object that inherits from this
51   ///      class.
52   void SetModule(const lldb::ModuleSP &module_sp);
53
54 protected:
55   // Member variables
56   lldb::ModuleWP m_module_wp; ///< The Module that owns the object that inherits
57                               ///< from this class.
58 };
59
60 } // namespace lldb_private
61
62 #endif // liblldb_ModuleChild_h_