#include <kanzi/core.ui/node/content_reference.hpp>
Public Types | |
| typedef function< void()> | CallbackType |
| typedef shared_ptr< TResourceType > | ResourceTypePtr |
Public Member Functions | |
| void | attachOverride () override |
| Attaches the content reference. | |
| ContentReference (Node &thisObject) | |
| ContentReference (Node &thisObject, const ResourceID &id) | |
| void | detachOverride () override |
| Detaches the content reference. | |
| ResourceTypePtr | get () const |
| ResourceSharedPtr | getResource () override |
| ResourceID | getResourceId () const |
| Gets the resource ID the content reference is tracking. | |
| ResourceTypePtr | getUserResource () const |
| Access user resource. | |
| ResourceTypePtr | makeLocal () |
| Clone reference to be an internal copy. | |
| void | onResourceChangeOverride () override |
| This method is called when the resource referenced by the existing resource-ID is changed. | |
| operator bool_type () const | |
| TResourceType & | operator* () const |
| TResourceType * | operator-> () const |
| void | resetUserResource () |
| Clear user resource. | |
| void | setCallback (CallbackType callback) |
| void | setResource (const ResourceID &id) |
| Sets the resource-ID of the content reference. | |
| void | setUserResource (ResourceTypePtr userResource) |
| Set user resource. | |
| ~ContentReference () override | |
Public Member Functions inherited from kanzi::AbstractResourceReference | |
| bool | isAttached () const |
| Indicates whether this resource reference has been attached. | |
Protected Member Functions | |
| void | notifyCallback () |
| ResourceTypePtr & | resolve () |
| const ResourceTypePtr & | resolve () const |
| void | updateChangeFlags () const |
| void | updateResolveNotify (bool onDetach) |
| void | updateResource () |
Protected Member Functions inherited from kanzi::AbstractResourceReference | |
| virtual | ~AbstractResourceReference ()=default |
| Destructor. | |
Additional Inherited Members | |
Protected Attributes inherited from kanzi::AbstractResourceReference | |
| bool | m_attached |
| Current resource reference state. Note that attach() is only called once. | |
| typedef function<void()> kanzi::ContentReference< TResourceType >::CallbackType |
| typedef shared_ptr<TResourceType> kanzi::ContentReference< TResourceType >::ResourceTypePtr |
|
explicit |
|
explicit |
|
override |
|
inline |
|
inline |
Sets the resource-ID of the content reference.
If the current reference is attached, acquires the resource.
|
inline |
Gets the resource ID the content reference is tracking.
|
inlineoverridevirtual |
Attaches the content reference.
Acquires the resource referenced by the resource ID.
Note: The attach() is only called once.
Implements kanzi::AbstractResourceReference.
|
inlineoverridevirtual |
This method is called when the resource referenced by the existing resource-ID is changed.
Acquires the new resource and executes the callback only if the the new resource is not the same as before.
Note: This method is only called on attached resource references.
Implements kanzi::AbstractResourceReference.
|
inlineoverridevirtual |
Detaches the content reference.
Resets the referenced resource.
Note: The detach() is only called once.
Implements kanzi::AbstractResourceReference.
|
inlineoverridevirtual |
Implements kanzi::AbstractResourceReference.
|
inline |
Clone reference to be an internal copy.
Default implementation clones nothing, and returns an empty shared pointer.
|
inline |
Access user resource.
|
inline |
Clear user resource.
|
inline |
Set user resource.
| userResource | New user resource. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
protected |
|
protected |
|
inlineprotected |
|
inlineprotected |