1*fce4895dSRene Gollent /* 2*fce4895dSRene Gollent * Copyright 2012-2016, Rene Gollent, rene@gollent.com. 3*fce4895dSRene Gollent * Distributed under the terms of the MIT License. 4*fce4895dSRene Gollent */ 5*fce4895dSRene Gollent #ifndef VALUE_NODE_MANAGER_H 6*fce4895dSRene Gollent #define VALUE_NODE_MANAGER_H 7*fce4895dSRene Gollent 8*fce4895dSRene Gollent #include <Referenceable.h> 9*fce4895dSRene Gollent 10*fce4895dSRene Gollent #include "ValueNodeContainer.h" 11*fce4895dSRene Gollent 12*fce4895dSRene Gollent class StackFrame; 13*fce4895dSRene Gollent class Thread; 14*fce4895dSRene Gollent class Variable; 15*fce4895dSRene Gollent 16*fce4895dSRene Gollent 17*fce4895dSRene Gollent class ValueNodeManager : public BReferenceable, 18*fce4895dSRene Gollent private ValueNodeContainer::Listener { 19*fce4895dSRene Gollent public: 20*fce4895dSRene Gollent ValueNodeManager(bool addFrameNodes = true); 21*fce4895dSRene Gollent virtual ~ValueNodeManager(); 22*fce4895dSRene Gollent 23*fce4895dSRene Gollent status_t SetStackFrame(::Thread* thread, 24*fce4895dSRene Gollent StackFrame* frame); 25*fce4895dSRene Gollent 26*fce4895dSRene Gollent bool AddListener( 27*fce4895dSRene Gollent ValueNodeContainer::Listener* listener); 28*fce4895dSRene Gollent void RemoveListener( 29*fce4895dSRene Gollent ValueNodeContainer::Listener* listener); 30*fce4895dSRene Gollent 31*fce4895dSRene Gollent virtual void ValueNodeChanged(ValueNodeChild* nodeChild, 32*fce4895dSRene Gollent ValueNode* oldNode, ValueNode* newNode); 33*fce4895dSRene Gollent virtual void ValueNodeChildrenCreated(ValueNode* node); 34*fce4895dSRene Gollent virtual void ValueNodeChildrenDeleted(ValueNode* node); 35*fce4895dSRene Gollent virtual void ValueNodeValueChanged(ValueNode* node); 36*fce4895dSRene Gollent GetContainer()37*fce4895dSRene Gollent ValueNodeContainer* GetContainer() const { return fContainer; }; 38*fce4895dSRene Gollent 39*fce4895dSRene Gollent status_t AddChildNodes(ValueNodeChild* nodeChild); 40*fce4895dSRene Gollent 41*fce4895dSRene Gollent private: 42*fce4895dSRene Gollent typedef BObjectList<ValueNodeContainer::Listener> ListenerList; 43*fce4895dSRene Gollent 44*fce4895dSRene Gollent void _AddNode(Variable* variable); 45*fce4895dSRene Gollent status_t _CreateValueNode(ValueNodeChild* nodeChild); 46*fce4895dSRene Gollent 47*fce4895dSRene Gollent private: 48*fce4895dSRene Gollent bool fAddFrameNodes; 49*fce4895dSRene Gollent ValueNodeContainer* fContainer; 50*fce4895dSRene Gollent StackFrame* fStackFrame; 51*fce4895dSRene Gollent ::Thread* fThread; 52*fce4895dSRene Gollent ListenerList fListeners; 53*fce4895dSRene Gollent }; 54*fce4895dSRene Gollent 55*fce4895dSRene Gollent #endif // VALUE_NODE_MANAGER_H 56