2 * Copyright 2013-2014, Rene Gollent, rene@gollent.com.
3 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
6 #ifndef VARIABLES_VIEW_STATE_H
7 #define VARIABLES_VIEW_STATE_H
11 #include <Referenceable.h>
12 #include <util/OpenHashTable.h>
15 class ExpressionValues
;
17 class StackFrameValues
;
19 class TypeComponentPath
;
22 class VariablesViewNodeInfo
{
24 VariablesViewNodeInfo();
25 VariablesViewNodeInfo(
26 const VariablesViewNodeInfo
& other
);
27 virtual ~VariablesViewNodeInfo();
29 VariablesViewNodeInfo
& operator=(
30 const VariablesViewNodeInfo
& other
);
32 bool IsNodeExpanded() const
33 { return fNodeExpanded
; }
34 void SetNodeExpanded(bool expanded
);
36 Type
* GetCastedType() const
37 { return fCastedType
; }
38 void SetCastedType(Type
* type
);
40 const BMessage
& GetRendererSettings() const
41 { return fRendererSettings
; }
43 void SetRendererSettings(const BMessage
& settings
);
48 BMessage fRendererSettings
;
52 class VariablesViewState
: public BReferenceable
{
55 virtual ~VariablesViewState();
59 StackFrameValues
* Values() const
61 void SetValues(StackFrameValues
* values
);
63 ExpressionValues
* GetExpressionValues() const
64 { return fExpressionValues
; }
65 void SetExpressionValues(ExpressionValues
* values
);
67 const VariablesViewNodeInfo
* GetNodeInfo(ObjectID
* variable
,
68 const TypeComponentPath
* path
) const;
69 inline const VariablesViewNodeInfo
* GetNodeInfo(ObjectID
* variable
,
70 const TypeComponentPath
& path
) const;
72 status_t
SetNodeInfo(ObjectID
* variable
,
73 TypeComponentPath
* path
,
74 const VariablesViewNodeInfo
& info
);
75 // requires an on-heap path
80 struct InfoEntryHashDefinition
;
82 typedef BOpenHashTable
<InfoEntryHashDefinition
> NodeInfoTable
;
88 NodeInfoTable
* fNodeInfos
;
89 StackFrameValues
* fValues
;
90 ExpressionValues
* fExpressionValues
;
94 const VariablesViewNodeInfo
*
95 VariablesViewState::GetNodeInfo(ObjectID
* variable
,
96 const TypeComponentPath
& path
) const
98 return GetNodeInfo(variable
, &path
);
102 #endif // VARIABLES_VIEW_STATE_H