LLDB mainline
ValueObjectCast.h
Go to the documentation of this file.
1//===-- ValueObjectCast.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 LLDB_VALUEOBJECT_VALUEOBJECTCAST_H
10#define LLDB_VALUEOBJECT_VALUEOBJECTCAST_H
11
14#include "lldb/lldb-defines.h"
16#include "lldb/lldb-forward.h"
17
18#include <cstddef>
19#include <cstdint>
20#include <optional>
21
22namespace lldb_private {
23class ConstString;
24
25/// A ValueObject that represents a given value represented as a different type.
27public:
28 ~ValueObjectCast() override;
29
31 const CompilerType &cast_type);
32
33 std::optional<uint64_t> GetByteSize() override;
34
35 llvm::Expected<uint32_t> CalculateNumChildren(uint32_t max) override;
36
37 lldb::ValueType GetValueType() const override;
38
39 bool IsInScope() override;
40
41 ValueObject *GetParent() override {
42 return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
43 }
44
45 const ValueObject *GetParent() const override {
46 return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr);
47 }
48
49protected:
51 const CompilerType &cast_type);
52
53 bool UpdateValue() override;
54
56
58
59private:
61 const ValueObjectCast &operator=(const ValueObjectCast &) = delete;
62};
63
64} // namespace lldb_private
65
66#endif // LLDB_VALUEOBJECT_VALUEOBJECTCAST_H
Generic representation of a type in a programming language.
Definition: CompilerType.h:36
A uniqued constant string class.
Definition: ConstString.h:40
A ValueObject that represents a given value represented as a different type.
CompilerType GetCompilerTypeImpl() override
llvm::Expected< uint32_t > CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
const ValueObjectCast & operator=(const ValueObjectCast &)=delete
ValueObject * GetParent() override
ValueObjectCast(const ValueObjectCast &)=delete
static lldb::ValueObjectSP Create(ValueObject &parent, ConstString name, const CompilerType &cast_type)
std::optional< uint64_t > GetByteSize() override
lldb::ValueType GetValueType() const override
const ValueObject * GetParent() const override
ValueObject * m_parent
The parent value object, or nullptr if this has no parent.
Definition: ValueObject.h:915
virtual ValueObject * GetParent()
Definition: ValueObject.h:828
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Definition: lldb-forward.h:484