Extend ValueNode API.
- Add several new optional hook functions to ValueNode. These allow implementing subclasses to specify that they're a container type that can export a range of items (i.e. arrays, lists, etc.), and expose several operations on said ranges of child items.
This commit is contained in:
@@ -63,6 +63,34 @@ ValueNode::SetContainer(ValueNodeContainer* container)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
ValueNode::IsRangedContainer() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
ValueNode::ClearChildren()
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
ValueNode::CreateChildrenInRange(int32 lowIndex, int32 highIndex)
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
ValueNode::SupportedChildRange(int32& lowIndex, int32& highIndex) const
|
||||||
|
{
|
||||||
|
return B_NOT_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ValueNode::SetLocationAndValue(ValueLocation* location, Value* value,
|
ValueNode::SetLocationAndValue(ValueLocation* location, Value* value,
|
||||||
status_t resolutionState)
|
status_t resolutionState)
|
||||||
|
|||||||
@@ -51,10 +51,23 @@ public:
|
|||||||
{ return false; }
|
{ return false; }
|
||||||
bool ChildrenCreated() const
|
bool ChildrenCreated() const
|
||||||
{ return fChildrenCreated; }
|
{ return fChildrenCreated; }
|
||||||
|
|
||||||
virtual status_t CreateChildren() = 0;
|
virtual status_t CreateChildren() = 0;
|
||||||
virtual int32 CountChildren() const = 0;
|
virtual int32 CountChildren() const = 0;
|
||||||
virtual ValueNodeChild* ChildAt(int32 index) const = 0;
|
virtual ValueNodeChild* ChildAt(int32 index) const = 0;
|
||||||
|
|
||||||
|
// optional virtual hooks for container type value nodes such as
|
||||||
|
// arrays that may contain a variable (and potentially quite large)
|
||||||
|
// number of children. The calls below should be implemented for such
|
||||||
|
// node types to allow the upper layers to be aware of this, and to be
|
||||||
|
// able to request that only a subset of children be created.
|
||||||
|
virtual bool IsRangedContainer() const;
|
||||||
|
virtual void ClearChildren();
|
||||||
|
virtual status_t CreateChildrenInRange(int32 lowIndex,
|
||||||
|
int32 highIndex);
|
||||||
|
virtual status_t SupportedChildRange(int32& lowIndex,
|
||||||
|
int32& highIndex) const;
|
||||||
|
|
||||||
status_t LocationAndValueResolutionState() const
|
status_t LocationAndValueResolutionState() const
|
||||||
{ return fLocationResolutionState; }
|
{ return fLocationResolutionState; }
|
||||||
void SetLocationAndValue(ValueLocation* location,
|
void SetLocationAndValue(ValueLocation* location,
|
||||||
|
|||||||
Reference in New Issue
Block a user