1 //===-- ValueObjectDynamicValue.h -------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ValueObjectCast_h_
11 #define liblldb_ValueObjectCast_h_
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
19 #include <stddef.h> // for size_t
20 #include <stdint.h> // for uint32_t, uint64_t
22 namespace lldb_private {
26 namespace lldb_private {
28 //---------------------------------------------------------------------------------
29 // A ValueObject that represents a given value represented as a different type.
30 //---------------------------------------------------------------------------------
31 class ValueObjectCast : public ValueObject {
33 ~ValueObjectCast() override;
35 static lldb::ValueObjectSP Create(ValueObject &parent,
36 const ConstString &name,
37 const CompilerType &cast_type);
39 uint64_t GetByteSize() override;
41 size_t CalculateNumChildren(uint32_t max) override;
43 lldb::ValueType GetValueType() const override;
45 bool IsInScope() override;
47 ValueObject *GetParent() override {
48 return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
51 const ValueObject *GetParent() const override {
52 return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
56 ValueObjectCast(ValueObject &parent, const ConstString &name,
57 const CompilerType &cast_type);
59 bool UpdateValue() override;
61 CompilerType GetCompilerTypeImpl() override;
63 CompilerType m_cast_type;
66 DISALLOW_COPY_AND_ASSIGN(ValueObjectCast);
69 } // namespace lldb_private
71 #endif // liblldb_ValueObjectCast_h_