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// C Includes
14// C++ Includes
15// Other libraries and framework includes
16// Project includes
17#include "lldb/Core/ValueObject.h"
18
19namespace lldb_private {
20
21//---------------------------------------------------------------------------------
22// A ValueObject that represents a given value represented as a different type.
23//---------------------------------------------------------------------------------
24class ValueObjectCast : public ValueObject
25{
26public:
27    static lldb::ValueObjectSP
28    Create (ValueObject &parent,
29            const ConstString &name,
30            const ClangASTType &cast_type);
31
32    virtual
33    ~ValueObjectCast();
34
35    virtual uint64_t
36    GetByteSize();
37
38    virtual size_t
39    CalculateNumChildren();
40
41    virtual lldb::ValueType
42    GetValueType() const;
43
44    virtual bool
45    IsInScope ();
46
47    virtual ValueObject *
48    GetParent()
49    {
50        if (m_parent)
51            return m_parent->GetParent();
52        else
53            return NULL;
54    }
55
56    virtual const ValueObject *
57    GetParent() const
58    {
59        if (m_parent)
60            return m_parent->GetParent();
61        else
62            return NULL;
63    }
64
65protected:
66    virtual bool
67    UpdateValue ();
68
69    virtual ClangASTType
70    GetClangTypeImpl ();
71
72    ClangASTType m_cast_type;
73
74private:
75    ValueObjectCast (ValueObject &parent,
76                     const ConstString &name,
77                     const ClangASTType &cast_type);
78
79    //------------------------------------------------------------------
80    // For ValueObject only
81    //------------------------------------------------------------------
82    DISALLOW_COPY_AND_ASSIGN (ValueObjectCast);
83};
84
85} // namespace lldb_private
86
87#endif  // liblldb_ValueObjectCast_h_
88