![]() |
ufe
3.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
|
Abstract base class for Attributes interface. More...
#include <attributes.h>
Public Types | |
typedef std::shared_ptr< Attributes > | Ptr |
Public Member Functions | |
Attributes () | |
Constructor. More... | |
Attributes (const Attributes &)=default | |
Default copy constructor. More... | |
virtual | ~Attributes () |
Destructor. More... | |
virtual SceneItem::Ptr | sceneItem () const =0 |
virtual Attribute::Type | attributeType (const std::string &name)=0 |
virtual Attribute::Ptr | attribute (const std::string &name)=0 |
virtual std::vector< std::string > | attributeNames () const =0 |
virtual bool | hasAttribute (const std::string &name) const =0 |
Static Public Member Functions | |
static Ptr | attributes (const SceneItem::Ptr &item) |
static bool | addObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | addObserver (const Observer::Ptr &obs) |
static bool | removeObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | removeObserver (const Observer::Ptr &obs) |
static std::size_t | nbObservers (const SceneItem::Ptr &item) |
static std::size_t | nbObservers () |
static bool | hasObserver (const SceneItem::Ptr &item, const Observer::Ptr &obs) |
static bool | hasObserver (const Observer::Ptr &obs) |
static bool | hasObservers (const Path &path) |
static bool | hasObservers (Rtid runTimeId) |
static void | notify (const AttributeChanged ¬ification) |
Abstract base class for Attributes interface.
This base class defines an interface for factory objects that runtimes can implement to create attribute interface objects as well as query attribute names, attribute type and attribute existence. The Attributes interface object can be considered as a factory, because it provides an interface to create an Attribute object per attribute, given an attribute name. The Attribute object actually performs the work of reading from and writing to the attribute.
As with the rest of UFE, attribute observation is done through the Observer Pattern. Observers can be added to an individual scene item, to be notified when an attribute changes.
To avoid the memory-consuming "one proxy object per scene object" approach, attributes interface objects should be obtained and used within a local scope, and not stored.
Definition at line 49 of file attributes.h.
typedef std::shared_ptr<Attributes> Ufe::Attributes::Ptr |
Definition at line 52 of file attributes.h.
Ufe::Attributes::Attributes | ( | ) |
Constructor.
|
default |
Default copy constructor.
|
virtual |
Destructor.
|
static |
|
static |
Add observation for attribute changes on any item in the scene (global observation).
obs | Observer to add. |
|
pure virtual |
|
pure virtual |
|
static |
Convenience method that calls the attributes method on the attribute handler for the item. Returns a null pointer if the argument is null, or has an empty path.
item | SceneItem's Attributes interface to retrieve. |
|
pure virtual |
|
pure virtual |
Queries whether an attribute exists with the given name.
name | The attribute name to check. |
|
static |
|
static |
Query observation for attribute changes on any item in the scene (global observers).
obs | Observer to query. |
|
static |
path | Path to verify if being observed. |
|
static |
Helper query for runtimes, to determine if a path they are responsible for is being observed specifically. This only considers observation of that specific path, and does not consider observation of any item in the scene (global observation), which is in addition.
runTimeId | runtime Id to find observers on. |
|
static |
|
static |
Number of observers for attribute changes on any item in the scene (global observers).
|
static |
Notify all observers, including global observers. The order in which observers are notified is unspecified. If no observer exists, does nothing.
notification | Attribute notification to send. |
|
static |
|
static |
Remove observation for attribute changes on any item in the scene (global observation).
obs | Observer to remove. |
|
pure virtual |