ValueObjectCast.h revision 36da2aa6dc5ad9994b638ed09eb81c44cc05540b
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 size_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 clang::ASTContext *
70    GetClangASTImpl ();
71
72    virtual lldb::clang_type_t
73    GetClangTypeImpl ();
74
75    ClangASTType m_cast_type;
76
77private:
78    ValueObjectCast (ValueObject &parent,
79                     const ConstString &name,
80                     const ClangASTType &cast_type);
81
82    //------------------------------------------------------------------
83    // For ValueObject only
84    //------------------------------------------------------------------
85    DISALLOW_COPY_AND_ASSIGN (ValueObjectCast);
86};
87
88} // namespace lldb_private
89
90#endif  // liblldb_ValueObjectCast_h_
91