1 /* 2 * Copyright 2012-2015, Rene Gollent, rene@gollent.com. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef BLIST_VALUE_NODE_H 6 #define BLIST_VALUE_NODE_H 7 8 9 #include <List.h> 10 #include <Variant.h> 11 12 #include <ObjectList.h> 13 14 #include "ValueLocation.h" 15 #include "ValueNode.h" 16 17 18 class CompoundType; 19 20 21 class BListValueNode : public ValueNode { 22 public: 23 BListValueNode(ValueNodeChild* nodeChild, 24 Type* type); 25 virtual ~BListValueNode(); 26 27 virtual Type* GetType() const; 28 virtual status_t ResolvedLocationAndValue( 29 ValueLoader* valueLoader, 30 ValueLocation*& _location, 31 Value*& _value); 32 ChildCreationNeedsValue()33 virtual bool ChildCreationNeedsValue() const 34 { return true; } 35 virtual status_t CreateChildren(TeamTypeInformation* info); 36 virtual int32 CountChildren() const; 37 virtual ValueNodeChild* ChildAt(int32 index) const; 38 39 virtual bool IsRangedContainer() const; 40 virtual bool IsContainerRangeFixed() const; 41 virtual void ClearChildren(); 42 virtual status_t CreateChildrenInRange( 43 TeamTypeInformation* info, 44 int32 lowIndex, int32 highIndex); 45 virtual status_t SupportedChildRange(int32& lowIndex, 46 int32& highIndex) const; 47 private: 48 class BListElementNodeChild; 49 class BListItemCountNodeChild; 50 51 // for GCC2 52 friend class BListElementNodeChild; 53 friend class BListItemCountNodeChild; 54 55 typedef BObjectList<ValueNodeChild> ChildNodeList; 56 57 private: 58 59 Type* fType; 60 ChildNodeList fChildren; 61 BVariant fDataLocation; 62 BVariant fItemCountLocation; 63 Type* fItemCountType; 64 int32 fItemCount; 65 bool fCountChildCreated; 66 }; 67 68 69 #endif // BLIST_VALUE_NODE_H 70