2 * Copyright 2013-2015, 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 ARRAY_VALUE_NODE_H
7 #define ARRAY_VALUE_NODE_H
10 #include <ObjectList.h>
12 #include "ValueNode.h"
15 class AbstractArrayValueNodeChild
;
19 class AbstractArrayValueNode
: public ValueNode
{
21 AbstractArrayValueNode(
22 ValueNodeChild
* nodeChild
, ArrayType
* type
,
24 virtual ~AbstractArrayValueNode();
26 ArrayType
* GetArrayType() const
28 int32
Dimension() const
29 { return fDimension
; }
31 virtual Type
* GetType() const;
33 virtual status_t
ResolvedLocationAndValue(
34 ValueLoader
* valueLoader
,
35 ValueLocation
*& _location
,
40 virtual status_t
CreateChildren(TeamTypeInformation
* info
);
41 virtual int32
CountChildren() const;
42 virtual ValueNodeChild
* ChildAt(int32 index
) const;
44 virtual bool IsRangedContainer() const;
45 virtual void ClearChildren();
46 virtual status_t
CreateChildrenInRange(
47 TeamTypeInformation
* info
,
48 int32 lowIndex
, int32 highIndex
);
49 virtual status_t
SupportedChildRange(int32
& lowIndex
,
50 int32
& highIndex
) const;
52 typedef BObjectList
<AbstractArrayValueNodeChild
> ChildList
;
60 bool fBoundsInitialized
;
64 // TODO: Are ArrayValueNode and InternalArrayValueNode still needed?
66 class ArrayValueNode
: public AbstractArrayValueNode
{
68 ArrayValueNode(ValueNodeChild
* nodeChild
,
70 virtual ~ArrayValueNode();
74 class InternalArrayValueNode
: public AbstractArrayValueNode
{
76 InternalArrayValueNode(
77 ValueNodeChild
* nodeChild
,
78 ArrayType
* type
, int32 dimension
);
79 virtual ~InternalArrayValueNode();
83 class AbstractArrayValueNodeChild
: public ValueNodeChild
{
85 AbstractArrayValueNodeChild(
86 AbstractArrayValueNode
* parent
,
87 const BString
& name
, int64 elementIndex
);
88 virtual ~AbstractArrayValueNodeChild();
90 AbstractArrayValueNode
* ArrayParent() const { return fParent
; }
91 int32
ElementIndex() const { return fElementIndex
; }
93 virtual const BString
& Name() const;
94 virtual ValueNode
* Parent() const;
97 AbstractArrayValueNode
* fParent
;
103 class ArrayValueNodeChild
: public AbstractArrayValueNodeChild
{
106 AbstractArrayValueNode
* parent
,
107 const BString
& name
, int64 elementIndex
,
109 virtual ~ArrayValueNodeChild();
111 virtual Type
* GetType() const;
113 virtual status_t
ResolveLocation(ValueLoader
* valueLoader
,
114 ValueLocation
*& _location
);
121 class InternalArrayValueNodeChild
: public AbstractArrayValueNodeChild
{
123 InternalArrayValueNodeChild(
124 AbstractArrayValueNode
* parent
,
125 const BString
& name
, int64 elementIndex
,
127 virtual ~InternalArrayValueNodeChild();
129 virtual Type
* GetType() const;
131 virtual bool IsInternal() const;
132 virtual status_t
CreateInternalNode(ValueNode
*& _node
);
134 virtual status_t
ResolveLocation(ValueLoader
* valueLoader
,
135 ValueLocation
*& _location
);
142 #endif // ARRAY_VALUE_NODE_H