Ardour  9.0-pre0-582-g084a23a80d
PBD::SharedStatefulProperty< T > Class Template Reference

#include <properties.h>

Inheritance diagram for PBD::SharedStatefulProperty< T >:
[legend]

Public Types

typedef std::shared_ptr< T > Ptr
 

Public Member Functions

 SharedStatefulProperty (PropertyID d, Ptr p)
 
 SharedStatefulProperty (PropertyID d, Ptr o, Ptr c)
 
bool set_value (XMLNode const &node)
 
void get_value (XMLNode &node) const
 
void clear_changes ()
 
bool changed () const
 
void invert ()
 
void get_changes_as_xml (XMLNode *history_node) const
 
void get_changes_as_properties (PropertyList &changes, Command *) const
 
void apply_change (PropertyBase const *p)
 
Ptr val () const
 
T * operator-> () const
 
 operator bool () const
 
- Public Member Functions inherited from PBD::PropertyBase
 PropertyBase (PropertyID pid)
 
virtual ~PropertyBase ()
 
virtual void clear_owned_changes ()
 
virtual void rdiff (std::vector< PBD::Command * > &) const
 
virtual PropertyBaseclone_from_xml (const XMLNode &) const
 
virtual PropertyBaseclone () const =0
 
const gchar * property_name () const
 
PropertyID property_id () const
 
bool operator== (PropertyID pid) const
 

Protected Attributes

Ptr _old
 
Ptr _current
 

Private Member Functions

 SharedStatefulProperty (SharedStatefulProperty< T > const &)
 
SharedStatefulProperty< T > & operator= (SharedStatefulProperty< T > const &)
 

Additional Inherited Members

- Protected Member Functions inherited from PBD::PropertyBase
 PropertyBase (PropertyBase const &b)
 

Detailed Description

template<class T>
class PBD::SharedStatefulProperty< T >

A Property which holds a shared_ptr to a Stateful object, and handles undo using the somewhat inefficient approach of saving the complete XML state of its object before and after changes. A sort of half-way house between the old complete-state undo system and the new difference-based one.

Definition at line 371 of file properties.h.

Member Typedef Documentation

◆ Ptr

template<class T >
typedef std::shared_ptr<T> PBD::SharedStatefulProperty< T >::Ptr

Definition at line 374 of file properties.h.

Constructor & Destructor Documentation

◆ SharedStatefulProperty() [1/3]

template<class T >
PBD::SharedStatefulProperty< T >::SharedStatefulProperty ( PropertyID  d,
Ptr  p 
)
inline

Definition at line 376 of file properties.h.

◆ SharedStatefulProperty() [2/3]

template<class T >
PBD::SharedStatefulProperty< T >::SharedStatefulProperty ( PropertyID  d,
Ptr  o,
Ptr  c 
)
inline

Definition at line 383 of file properties.h.

◆ SharedStatefulProperty() [3/3]

template<class T >
PBD::SharedStatefulProperty< T >::SharedStatefulProperty ( SharedStatefulProperty< T > const &  )
private

Member Function Documentation

◆ apply_change()

template<class T >
void PBD::SharedStatefulProperty< T >::apply_change ( PropertyBase const *  )
inlinevirtual

Set this property's current state from another

Implements PBD::PropertyBase.

Definition at line 450 of file properties.h.

◆ changed()

template<class T >
bool PBD::SharedStatefulProperty< T >::changed ( ) const
inlinevirtual
Returns
true if this property has changed in value since construction or since the last call to clear_changes (), whichever was more recent.

Implements PBD::PropertyBase.

Definition at line 421 of file properties.h.

◆ clear_changes()

template<class T >
void PBD::SharedStatefulProperty< T >::clear_changes ( )
inlinevirtual

Forget about any old changes to this property's value

Implements PBD::PropertyBase.

Definition at line 414 of file properties.h.

◆ get_changes_as_properties()

template<class T >
void PBD::SharedStatefulProperty< T >::get_changes_as_properties ( PropertyList changes,
Command  
) const
inlinevirtual

If this Property has changed, clone it and add it to a given list. Used for making StatefulDiffCommands.

Implements PBD::PropertyBase.

Definition at line 444 of file properties.h.

◆ get_changes_as_xml()

template<class T >
void PBD::SharedStatefulProperty< T >::get_changes_as_xml ( XMLNode ) const
inlinevirtual

Get any changes in this property as XML and add them to a StatefulDiffCommand node.

Implements PBD::PropertyBase.

Definition at line 433 of file properties.h.

◆ get_value()

template<class T >
void PBD::SharedStatefulProperty< T >::get_value ( XMLNode node) const
inlinevirtual

Get this property's value and put it into a Stateful node

Implements PBD::PropertyBase.

Definition at line 409 of file properties.h.

◆ invert()

template<class T >
void PBD::SharedStatefulProperty< T >::invert ( )
inlinevirtual

Invert the changes in this property

Implements PBD::PropertyBase.

Definition at line 429 of file properties.h.

◆ operator bool()

template<class T >
PBD::SharedStatefulProperty< T >::operator bool ( ) const
inline

Definition at line 462 of file properties.h.

◆ operator->()

template<class T >
T* PBD::SharedStatefulProperty< T >::operator-> ( ) const
inline

Definition at line 458 of file properties.h.

◆ operator=()

template<class T >
SharedStatefulProperty<T>& PBD::SharedStatefulProperty< T >::operator= ( SharedStatefulProperty< T > const &  )
private

◆ set_value()

template<class T >
bool PBD::SharedStatefulProperty< T >::set_value ( XMLNode const &  )
inlinevirtual

Set the value of this property from a Stateful node.

Returns
true if the value was set.

Implements PBD::PropertyBase.

Definition at line 391 of file properties.h.

◆ val()

template<class T >
Ptr PBD::SharedStatefulProperty< T >::val ( ) const
inline

Definition at line 454 of file properties.h.

Member Data Documentation

◆ _current

template<class T >
Ptr PBD::SharedStatefulProperty< T >::_current
protected

Definition at line 469 of file properties.h.

◆ _old

template<class T >
Ptr PBD::SharedStatefulProperty< T >::_old
protected

Definition at line 468 of file properties.h.


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