1 //===-- ValueObjectCast.h ---------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_ValueObjectCast_h_
10 #define liblldb_ValueObjectCast_h_
12 #include "lldb/Core/ValueObject.h"
13 #include "lldb/Symbol/CompilerType.h"
14 #include "lldb/lldb-defines.h"
15 #include "lldb/lldb-enumerations.h"
16 #include "lldb/lldb-forward.h"
21 namespace lldb_private {
24 // A ValueObject that represents a given value represented as a different type.
25 class ValueObjectCast : public ValueObject {
27 ~ValueObjectCast() override;
29 static lldb::ValueObjectSP Create(ValueObject &parent,
31 const CompilerType &cast_type);
33 uint64_t GetByteSize() override;
35 size_t CalculateNumChildren(uint32_t max) override;
37 lldb::ValueType GetValueType() const override;
39 bool IsInScope() override;
41 ValueObject *GetParent() override {
42 return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
45 const ValueObject *GetParent() const override {
46 return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
50 ValueObjectCast(ValueObject &parent, ConstString name,
51 const CompilerType &cast_type);
53 bool UpdateValue() override;
55 CompilerType GetCompilerTypeImpl() override;
57 CompilerType m_cast_type;
60 DISALLOW_COPY_AND_ASSIGN(ValueObjectCast);
63 } // namespace lldb_private
65 #endif // liblldb_ValueObjectCast_h_