]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/ValueObjectCast.h
MFV r336960: 9256 zfs send space estimation off by > 10% on some datasets
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / ValueObjectCast.h
1 //===-- ValueObjectDynamicValue.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_ValueObjectCast_h_
11 #define liblldb_ValueObjectCast_h_
12
13 #include "lldb/Core/ValueObject.h"
14 #include "lldb/Symbol/CompilerType.h" // for CompilerType
15 #include "lldb/lldb-defines.h"        // for DISALLOW_COPY_AND_ASSIGN
16 #include "lldb/lldb-enumerations.h"   // for ValueType
17 #include "lldb/lldb-forward.h"        // for ValueObjectSP
18
19 #include <stddef.h> // for size_t
20 #include <stdint.h> // for uint32_t, uint64_t
21
22 namespace lldb_private {
23 class ConstString;
24 }
25
26 namespace lldb_private {
27
28 //---------------------------------------------------------------------------------
29 // A ValueObject that represents a given value represented as a different type.
30 //---------------------------------------------------------------------------------
31 class ValueObjectCast : public ValueObject {
32 public:
33   ~ValueObjectCast() override;
34
35   static lldb::ValueObjectSP Create(ValueObject &parent,
36                                     const ConstString &name,
37                                     const CompilerType &cast_type);
38
39   uint64_t GetByteSize() override;
40
41   size_t CalculateNumChildren(uint32_t max) override;
42
43   lldb::ValueType GetValueType() const override;
44
45   bool IsInScope() override;
46
47   ValueObject *GetParent() override {
48     return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
49   }
50
51   const ValueObject *GetParent() const override {
52     return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
53   }
54
55 protected:
56   ValueObjectCast(ValueObject &parent, const ConstString &name,
57                   const CompilerType &cast_type);
58
59   bool UpdateValue() override;
60
61   CompilerType GetCompilerTypeImpl() override;
62
63   CompilerType m_cast_type;
64
65 private:
66   DISALLOW_COPY_AND_ASSIGN(ValueObjectCast);
67 };
68
69 } // namespace lldb_private
70
71 #endif // liblldb_ValueObjectCast_h_