ardour
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
PBD::SharedStatefulProperty< T > Class Template Reference

#include <properties.h>

Inheritance diagram for PBD::SharedStatefulProperty< T >:
PBD::PropertyBase

Public Types

typedef boost::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_changes (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< 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 355 of file properties.h.

Member Typedef Documentation

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

Definition at line 358 of file properties.h.

Constructor & Destructor Documentation

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

Definition at line 360 of file properties.h.

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

Definition at line 367 of file properties.h.

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

Member Function Documentation

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

Set this property's current state from another

Implements PBD::PropertyBase.

Definition at line 433 of file properties.h.

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 405 of file properties.h.

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 398 of file properties.h.

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 427 of file properties.h.

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 416 of file properties.h.

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 393 of file properties.h.

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

Invert the changes in this property

Implements PBD::PropertyBase.

Definition at line 412 of file properties.h.

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

Definition at line 445 of file properties.h.

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

Definition at line 441 of file properties.h.

template<class T>
SharedStatefulProperty<T>& PBD::SharedStatefulProperty< T >::operator= ( SharedStatefulProperty< T > const &  )
private
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 375 of file properties.h.

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

Definition at line 437 of file properties.h.

Member Data Documentation

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

Definition at line 452 of file properties.h.

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

Definition at line 451 of file properties.h.


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