2012-12-03 00:19:08 +04:00
|
|
|
/*
|
2013-04-27 22:21:13 +04:00
|
|
|
* Copyright 2012-2013, Rene Gollent, rene@gollent.com.
|
2012-12-03 00:19:08 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef BLIST_VALUE_NODE_H
|
|
|
|
#define BLIST_VALUE_NODE_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <List.h>
|
|
|
|
#include <Variant.h>
|
|
|
|
|
|
|
|
#include <ObjectList.h>
|
|
|
|
|
|
|
|
#include "ValueLocation.h"
|
|
|
|
#include "ValueNode.h"
|
|
|
|
|
|
|
|
|
|
|
|
class CompoundType;
|
|
|
|
|
|
|
|
|
|
|
|
class BListValueNode : public ValueNode {
|
|
|
|
public:
|
|
|
|
BListValueNode(ValueNodeChild* nodeChild,
|
|
|
|
Type* type);
|
|
|
|
virtual ~BListValueNode();
|
|
|
|
|
|
|
|
virtual Type* GetType() const;
|
|
|
|
virtual status_t ResolvedLocationAndValue(
|
|
|
|
ValueLoader* valueLoader,
|
|
|
|
ValueLocation*& _location,
|
|
|
|
Value*& _value);
|
|
|
|
|
|
|
|
virtual bool ChildCreationNeedsValue() const
|
|
|
|
{ return true; }
|
|
|
|
virtual status_t CreateChildren();
|
|
|
|
virtual int32 CountChildren() const;
|
|
|
|
virtual ValueNodeChild* ChildAt(int32 index) const;
|
|
|
|
|
2013-04-27 22:21:13 +04:00
|
|
|
virtual bool IsRangedContainer() const;
|
2013-05-21 02:18:57 +04:00
|
|
|
virtual bool IsContainerRangeFixed() const;
|
2013-04-27 22:21:13 +04:00
|
|
|
virtual void ClearChildren();
|
|
|
|
virtual status_t CreateChildrenInRange(int32 lowIndex,
|
|
|
|
int32 highIndex);
|
|
|
|
virtual status_t SupportedChildRange(int32& lowIndex,
|
|
|
|
int32& highIndex) const;
|
2012-12-03 00:19:08 +04:00
|
|
|
private:
|
|
|
|
class BListElementNodeChild;
|
2012-12-05 06:11:39 +04:00
|
|
|
class BListItemCountNodeChild;
|
2012-12-03 00:32:46 +04:00
|
|
|
|
|
|
|
// for GCC2
|
|
|
|
friend class BListElementNodeChild;
|
2012-12-05 06:11:39 +04:00
|
|
|
friend class BListItemCountNodeChild;
|
2012-12-03 00:32:46 +04:00
|
|
|
|
2012-12-03 00:19:08 +04:00
|
|
|
typedef BObjectList<ValueNodeChild> ChildNodeList;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Type* fType;
|
|
|
|
ChildNodeList fChildren;
|
|
|
|
ValueLoader* fLoader;
|
|
|
|
BVariant fDataLocation;
|
2012-12-05 06:11:39 +04:00
|
|
|
BVariant fItemCountLocation;
|
|
|
|
Type* fItemCountType;
|
2012-12-03 00:19:08 +04:00
|
|
|
int32 fItemCount;
|
2013-04-27 22:21:13 +04:00
|
|
|
bool fCountChildCreated;
|
2012-12-03 00:19:08 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // BLIST_VALUE_NODE_H
|