Rumba C++ SDK
maquina::NodeDelegate::AttributeDelegate Class Referenceabstract

A node attribute delegate. More...

#include <NodeDelegate.h>

Inheritance diagram for maquina::NodeDelegate::AttributeDelegate:
maquina::NodeDelegateMaquinaAttributeDelegate maquina::VirtualPlugAttributeDelegate

Public Member Functions

virtual ~AttributeDelegate ()
 
virtual std::shared_ptr< NodeDelegateowner ()=0
 Returns the owner node. More...
 
virtual std::string name () const =0
 Return the attribute name. More...
 
virtual bool is_mutable () const
 Return true is the attribute can be modified. More...
 
virtual bool is_visible () const
 Return true is the attribute is visible. More...
 
virtual bool is_animable () const
 Return true is the attribute is animable. More...
 
virtual bool accepts_overrides () const
 Return true is the attribute accepts overrides. More...
 
virtual bool is_overridden () const
 Return true is the attribute is overridden. More...
 
virtual void add_override ()
 Add add override. More...
 
virtual void remove_override ()
 Remove the override. More...
 
virtual Value value (const QueryContext &qc=QueryContext::at_current_frame) const =0
 Return the attribute value. More...
 
virtual StringView type_name () const =0
 Get the attribute type name, without evaluating the attribute. More...
 
virtual bool is_plug () const
 Return true if this attribute is a Rumba Plug. More...
 
virtual Plug plug () const
 Return the plug behind this attribute. More...
 
virtual std::shared_ptr< AttributeDescriptordescription () const
 Return the description for this attribute (see Plug description). More...
 
virtual bool has_node_delegate () const
 Return true if this attribute has a dedicated node delegate to traverse its structure. More...
 
virtual std::shared_ptr< NodeDelegatenode_delegate ()
 Return the dedicated node delegate. More...
 
virtual void set_value (const Value &value, const ModificationContext &mc=ModificationContext::undoable)
 Set the attribute value. More...
 
virtual std::shared_ptr< Observercreate_observer (const std::function< void()> &func, bool in_interactive=true)
 Return an observer which will call the func function when the attribute is possibly modified. More...
 
virtual std::shared_ptr< Channelchannel ()
 If this attribute has a single channel, return it, return nullptr otherwise. More...
 
virtual std::shared_ptr< Channelchannel (const ChannelType sc)
 Return the specified channel if available, return nullptr otherwise. More...
 
virtual std::vector< Channelchannels ()
 Return all the attribute's channels. More...
 

Detailed Description

A node attribute delegate.

Constructor & Destructor Documentation

◆ ~AttributeDelegate()

virtual maquina::NodeDelegate::AttributeDelegate::~AttributeDelegate ( )
inlinevirtual

Member Function Documentation

◆ accepts_overrides()

virtual bool maquina::NodeDelegate::AttributeDelegate::accepts_overrides ( ) const
virtual

Return true is the attribute accepts overrides.

The default implementation returns false.

Reimplemented in maquina::VirtualPlugAttributeDelegate.

◆ add_override()

virtual void maquina::NodeDelegate::AttributeDelegate::add_override ( )
virtual

Add add override.

The default implementation does nothing.

Reimplemented in maquina::VirtualPlugAttributeDelegate.

◆ channel() [1/2]

virtual std::shared_ptr<Channel> maquina::NodeDelegate::AttributeDelegate::channel ( )
virtual

If this attribute has a single channel, return it, return nullptr otherwise.

◆ channel() [2/2]

virtual std::shared_ptr<Channel> maquina::NodeDelegate::AttributeDelegate::channel ( const ChannelType  sc)
virtual

Return the specified channel if available, return nullptr otherwise.

◆ channels()

virtual std::vector<Channel> maquina::NodeDelegate::AttributeDelegate::channels ( )
virtual

Return all the attribute's channels.

◆ create_observer()

virtual std::shared_ptr<Observer> maquina::NodeDelegate::AttributeDelegate::create_observer ( const std::function< void()> &  func,
bool  in_interactive = true 
)
virtual

Return an observer which will call the func function when the attribute is possibly modified.

The observer is called when the attribute is modified. It may be called more than necessary in some implementation, like with the Values's attributes.

To stop the function to be called, un-reference the Observer shared pointer.

If no observer can be created, returns nullptr.

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ description()

virtual std::shared_ptr<AttributeDescriptor> maquina::NodeDelegate::AttributeDelegate::description ( ) const
virtual

Return the description for this attribute (see Plug description).

Reimplemented in maquina::VirtualPlugAttributeDelegate.

◆ has_node_delegate()

virtual bool maquina::NodeDelegate::AttributeDelegate::has_node_delegate ( ) const
virtual

Return true if this attribute has a dedicated node delegate to traverse its structure.

The default implementation returns false

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ is_animable()

virtual bool maquina::NodeDelegate::AttributeDelegate::is_animable ( ) const
virtual

Return true is the attribute is animable.

The default implementation returns false.

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ is_mutable()

virtual bool maquina::NodeDelegate::AttributeDelegate::is_mutable ( ) const
virtual

Return true is the attribute can be modified.

The default implementation returns false.

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ is_overridden()

virtual bool maquina::NodeDelegate::AttributeDelegate::is_overridden ( ) const
virtual

Return true is the attribute is overridden.

The default implementation returns false.

Reimplemented in maquina::VirtualPlugAttributeDelegate.

◆ is_plug()

virtual bool maquina::NodeDelegate::AttributeDelegate::is_plug ( ) const
virtual

Return true if this attribute is a Rumba Plug.

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ is_visible()

virtual bool maquina::NodeDelegate::AttributeDelegate::is_visible ( ) const
virtual

Return true is the attribute is visible.

The default implementation returns true.

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ name()

virtual std::string maquina::NodeDelegate::AttributeDelegate::name ( ) const
pure virtual

◆ node_delegate()

virtual std::shared_ptr<NodeDelegate> maquina::NodeDelegate::AttributeDelegate::node_delegate ( )
virtual

Return the dedicated node delegate.

Implemented by the plug-in.

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ owner()

virtual std::shared_ptr<NodeDelegate> maquina::NodeDelegate::AttributeDelegate::owner ( )
pure virtual

Returns the owner node.

Implemented by the plug-in.

Implemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ plug()

virtual Plug maquina::NodeDelegate::AttributeDelegate::plug ( ) const
virtual

Return the plug behind this attribute.

Exceptions
std::runtime_errorif the attribute is not mapped to a Plug

Reimplemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ remove_override()

virtual void maquina::NodeDelegate::AttributeDelegate::remove_override ( )
virtual

Remove the override.

The default implementation does nothing.

Reimplemented in maquina::VirtualPlugAttributeDelegate.

◆ set_value()

virtual void maquina::NodeDelegate::AttributeDelegate::set_value ( const Value value,
const ModificationContext mc = ModificationContext::undoable 
)
virtual

◆ type_name()

virtual StringView maquina::NodeDelegate::AttributeDelegate::type_name ( ) const
pure virtual

Get the attribute type name, without evaluating the attribute.

Implemented in maquina::VirtualPlugAttributeDelegate, and maquina::NodeDelegateMaquinaAttributeDelegate.

◆ value()

virtual Value maquina::NodeDelegate::AttributeDelegate::value ( const QueryContext qc = QueryContext::at_current_frame) const
pure virtual

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