NDEVR
API Documentation
ResourceListenerabstract

A class that can subscribe to any number of Resources which will get updates when the Resource(s) have been modified. More...

Inheritance diagram for ResourceListener:
[legend]

Public Member Functions

 ResourceListener ()
 Constructs a default ResourceListener.
virtual ~ResourceListener ()
 Virtual destructor.
virtual void addInfoParent (const ResourceBase *info)
 Registers a ResourceBase as a parent that this listener is observing.
void changeValue ()
 Triggers the value changed callback for this listener.
void disable (bool disable)
 Enables or disables this listener.
void disconnectListener ()
 Disconnects this listener from all parent resources it is subscribed to.
uint04 getInfoParentSize () const
 Returns the number of parent resources this listener is subscribed to.
virtual void onValueChanged ()=0
 Called when a subscribed resource value has changed.
virtual void removeInfoParent (const ResourceBase *info)
 Removes a ResourceBase from the list of parents this listener is observing.

Detailed Description

A class that can subscribe to any number of Resources which will get updates when the Resource(s) have been modified.


Definition at line 93 of file ResourceListener.h.

Constructor & Destructor Documentation

◆ ~ResourceListener()

virtual ResourceListener::~ResourceListener ( )
virtual

Virtual destructor.

Disconnects from all parent resources.

Member Function Documentation

◆ addInfoParent()

virtual void ResourceListener::addInfoParent ( const ResourceBase * info)
virtual

Registers a ResourceBase as a parent that this listener is observing.

Parameters
[in]infoThe resource to add as a parent.

Reimplemented in ResourceMirror< t_type >.

Referenced by ResourceMirror< t_type >::addInfoParent().

◆ disable()

void ResourceListener::disable ( bool disable)
inline

Enables or disables this listener.

Parameters
[in]disableIf true, the listener is set to active; if false, it is deactivated.

Definition at line 144 of file ResourceListener.h.

References disable().

Referenced by disable().

◆ getInfoParentSize()

uint04 ResourceListener::getInfoParentSize ( ) const
inline

Returns the number of parent resources this listener is subscribed to.

Returns
The number of parent resources.

Definition at line 135 of file ResourceListener.h.

◆ onValueChanged()

virtual void ResourceListener::onValueChanged ( )
pure virtual

Called when a subscribed resource value has changed.

Subclasses must implement this to define their response to resource updates.

Implemented in BasicResourceListener, EnvironmentalVariable, QTAbstractResourceListener, and ResourceMirror< t_type >.

◆ removeInfoParent()

virtual void ResourceListener::removeInfoParent ( const ResourceBase * info)
inlinevirtual

Removes a ResourceBase from the list of parents this listener is observing.

Parameters
[in]infoThe resource to remove as a parent.

Reimplemented in ResourceMirror< t_type >.

Definition at line 126 of file ResourceListener.h.

Referenced by ResourceMirror< t_type >::removeInfoParent().


The documentation for this class was generated from the following file: