33#include <NDEVR/Buffer.h>
128 m_parents.removeElement(info);
137 return m_parents.size();
The equivelent of std::vector but with a bit more control.
A base class for templated resources.
ResourceBase(const ResourceBase &value)
Copy constructs a ResourceBase.
void removeListener(ResourceListener *listener) const
Removes a listener so it no longer receives update notifications.
ResourceBase()
Constructs a default ResourceBase with no listeners.
Buffer< ResourceListener * > m_listeners
The collection of listeners subscribed to this resource.
void addListener(ResourceListener *listener, bool silent_add) const
Adds a listener with optional silent registration.
ResourceListener * addListener(ResourceListener *listener) const
Adds a listener that will be notified when this resource changes.
void refreshListeners()
Notifies all registered listeners that the resource value has changed.
virtual ~ResourceBase()
Virtual destructor.
A class that can subscribe to any number of Resources which will get updates when the Resource(s) hav...
virtual void removeInfoParent(const ResourceBase *info)
Removes a ResourceBase from the list of parents this listener is observing.
ResourceListener()
Constructs a default ResourceListener.
uint04 getInfoParentSize() const
Returns the number of parent resources this listener is subscribed to.
void changeValue()
Triggers the value changed callback for this listener.
void disable(bool disable)
Enables or disables this listener.
virtual void addInfoParent(const ResourceBase *info)
Registers a ResourceBase as a parent that this listener is observing.
virtual ~ResourceListener()
Virtual destructor.
virtual void onValueChanged()=0
Called when a subscribed resource value has changed.
void disconnectListener()
Disconnects this listener from all parent resources it is subscribed to.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...