|
VR-Engage
2.3
|
Provides the connection management interface for registering and deregistering callbacks with DtAttribute instances. Derived classes implement the invoke() method to define how they respond to attribute changes. The destructor automatically disconnects from all connected attributes.
#include <attributeCallback.h>
Public Member Functions | |
| DtAttributeCallbackBase () | |
| virtual | ~DtAttributeCallbackBase () |
| virtual void | connect (DtAttributeHandle attribute, bool invokeNowIfSet=false) |
| virtual void | disconnect (DtAttributeHandle attribute) |
| virtual void | disconnectAll () |
| virtual bool | isConnected (const DtAttributeHandle &attribute) const |
| virtual bool | hasConnection () const |
Protected Types | |
| using | AttributeList = std::list<DtAttributeHandle> |
Protected Member Functions | |
| virtual void | invoke (const DtAttributeHandle &changedAttribute) const =0 |
Protected Attributes | |
| AttributeList | myConnections |
Friends | |
| class | DtAttribute |
|
protected |
Type definition for the list of connected attributes.
| makVre::DtAttributeCallbackBase::DtAttributeCallbackBase | ( | ) |
Constructor.
Captures the calling thread's ID so that callbacks are dispatched on the correct thread.
|
virtual |
Virtual destructor.
Automatically disconnects from all connected attributes
|
virtual |
Connects the callback to an attribute.
| attribute | Reference to the attribute to connect to |
| invokeNowIfSet | Optional, default False. If set True, the callback is invoked immediately, if the attribute value has been set. |
|
virtual |
Disconnects the callback from a specific attribute.
| attribute | Reference to the attribute to disconnect from |
|
virtual |
Disconnects the callback from all connected attributes.
|
virtual |
Checks if the callback is connected to a specific attribute.
| attribute | Reference to the attribute to check |
|
virtual |
Checks if the callback is connected to any attributes.
|
protectedpure virtual |
Invoked by DtAttribute when the connected attribute's value changes.
Derived classes implement this method to deliver the change notification to the registered function or functor.
| changedAttribute | Handle to the attribute whose value changed |
Implemented in makVre::DtAttributeChangeCallback, and makVre::DtAttributeValueCallback< T >.
|
friend |
References DtAttribute.
Referenced by DtAttribute.
|
protected |
List of attributes this callback is connected to.