aboutsummaryrefslogtreecommitdiff
path: root/lldb/include/lldb/Core/ModuleChild.h
blob: 8a81c1a6cf8a69795530321f459c89fcef9cff98 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//===-- ModuleChild.h -------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_ModuleChild_h_
#define liblldb_ModuleChild_h_

#include "lldb/lldb-forward.h"

namespace lldb_private {

/// \class ModuleChild ModuleChild.h "lldb/Core/ModuleChild.h"
/// A mix in class that contains a pointer back to the module
///        that owns the object which inherits from it.
class ModuleChild {
public:
  /// Construct with owning module.
  ///
  /// \param[in] module
  ///     The module that owns the object that inherits from this
  ///     class.
  ModuleChild(const lldb::ModuleSP &module_sp);

  /// Destructor.
  ~ModuleChild();

  /// Assignment operator.
  ///
  /// \param[in] rhs
  ///     A const ModuleChild class reference to copy.
  ///
  /// \return
  ///     A const reference to this object.
  const ModuleChild &operator=(const ModuleChild &rhs);

  /// Get const accessor for the module pointer.
  ///
  /// \return
  ///     A const pointer to the module that owns the object that
  ///     inherits from this class.
  lldb::ModuleSP GetModule() const;

  /// Set accessor for the module pointer.
  ///
  /// \param[in] module
  ///     A new module that owns the object that inherits from this
  ///      class.
  void SetModule(const lldb::ModuleSP &module_sp);

protected:
  // Member variables
  lldb::ModuleWP m_module_wp; ///< The Module that owns the object that inherits
                              ///< from this class.
};

} // namespace lldb_private

#endif // liblldb_ModuleChild_h_