Ardour  9.0-pre0-582-g084a23a80d
PBD::PropertyTemplate< T > Class Template Referenceabstract

#include <properties.h>

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

Public Member Functions

 PropertyTemplate (PropertyDescriptor< T > p, T const &v)
 
 PropertyTemplate (PropertyDescriptor< T > p, T const &o, T const &c)
 
 PropertyTemplate (PropertyDescriptor< T > p, PropertyTemplate< T > const &s)
 
T & operator= (T const &v)
 
PropertyTemplate< T > & operator= (PropertyTemplate< T > const &p)
 
T & operator+= (T const &v)
 
operator- (T const other) const
 
bool operator< (T const &other) const
 
bool operator> (T const &other) const
 
bool operator== (const T &other) const
 
bool operator!= (const T &other) const
 
 operator T const & () const
 
T const & val () const
 
T & non_const_val ()
 
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)
 
- 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 Member Functions

void set (T const &v)
 
virtual std::string to_string (T const &v) const =0
 
virtual T from_string (std::string const &s) const =0
 
- Protected Member Functions inherited from PBD::PropertyBase
 PropertyBase (PropertyBase const &b)
 

Protected Attributes

bool _have_old
 
_current
 
_old
 

Private Member Functions

 PropertyTemplate (PropertyTemplate< T > const &)
 

Detailed Description

template<class T>
class PBD::PropertyTemplate< T >

Parent class for classes which represent a single scalar property in a Stateful object

Definition at line 41 of file properties.h.

Constructor & Destructor Documentation

◆ PropertyTemplate() [1/4]

template<class T >
PBD::PropertyTemplate< T >::PropertyTemplate ( PropertyDescriptor< T >  p,
T const &  v 
)
inline

Definition at line 44 of file properties.h.

◆ PropertyTemplate() [2/4]

template<class T >
PBD::PropertyTemplate< T >::PropertyTemplate ( PropertyDescriptor< T >  p,
T const &  o,
T const &  c 
)
inline

Definition at line 50 of file properties.h.

◆ PropertyTemplate() [3/4]

template<class T >
PBD::PropertyTemplate< T >::PropertyTemplate ( PropertyDescriptor< T >  p,
PropertyTemplate< T > const &  s 
)
inline

Definition at line 57 of file properties.h.

◆ PropertyTemplate() [4/4]

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

Member Function Documentation

◆ apply_change()

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

Set this property's current state from another

Implements PBD::PropertyBase.

Definition at line 172 of file properties.h.

◆ changed()

template<class T >
bool PBD::PropertyTemplate< 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 146 of file properties.h.

◆ clear_changes()

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

Forget about any old changes to this property's value

Implements PBD::PropertyBase.

Definition at line 142 of file properties.h.

◆ from_string()

◆ get_changes_as_properties()

template<class T >
void PBD::PropertyTemplate< 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 163 of file properties.h.

◆ get_changes_as_xml()

template<class T >
void PBD::PropertyTemplate< 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 157 of file properties.h.

◆ get_value()

template<class T >
void PBD::PropertyTemplate< 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 135 of file properties.h.

◆ invert()

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

Invert the changes in this property

Implements PBD::PropertyBase.

Definition at line 148 of file properties.h.

◆ non_const_val()

template<class T >
T& PBD::PropertyTemplate< T >::non_const_val ( )
inline

Definition at line 113 of file properties.h.

◆ operator T const &()

template<class T >
PBD::PropertyTemplate< T >::operator T const & ( ) const
inline

Definition at line 105 of file properties.h.

◆ operator!=()

template<class T >
bool PBD::PropertyTemplate< T >::operator!= ( const T &  other) const
inline

Definition at line 101 of file properties.h.

◆ operator+=()

template<class T >
T& PBD::PropertyTemplate< T >::operator+= ( T const &  v)
inline

Definition at line 80 of file properties.h.

◆ operator-()

template<class T >
T PBD::PropertyTemplate< T >::operator- ( T const  other) const
inline

Definition at line 85 of file properties.h.

◆ operator<()

template<class T >
bool PBD::PropertyTemplate< T >::operator< ( T const &  other) const
inline

Definition at line 89 of file properties.h.

◆ operator=() [1/2]

template<class T >
PropertyTemplate<T>& PBD::PropertyTemplate< T >::operator= ( PropertyTemplate< T > const &  p)
inline

Definition at line 75 of file properties.h.

◆ operator=() [2/2]

template<class T >
T& PBD::PropertyTemplate< T >::operator= ( T const &  v)
inline

Definition at line 66 of file properties.h.

◆ operator==()

template<class T >
bool PBD::PropertyTemplate< T >::operator== ( const T &  other) const
inline

Definition at line 97 of file properties.h.

◆ operator>()

template<class T >
bool PBD::PropertyTemplate< T >::operator> ( T const &  other) const
inline

Definition at line 93 of file properties.h.

◆ set()

template<class T >
void PBD::PropertyTemplate< T >::set ( T const &  v)
inlineprotected

Definition at line 181 of file properties.h.

◆ set_value()

template<class T >
bool PBD::PropertyTemplate< 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 119 of file properties.h.

◆ to_string()

template<class T >
virtual std::string PBD::PropertyTemplate< T >::to_string ( T const &  v) const
protectedpure virtual

◆ val()

template<class T >
T const& PBD::PropertyTemplate< T >::val ( ) const
inline

Definition at line 109 of file properties.h.

Member Data Documentation

◆ _current

template<class T >
T PBD::PropertyTemplate< T >::_current
protected

Definition at line 206 of file properties.h.

◆ _have_old

template<class T >
bool PBD::PropertyTemplate< T >::_have_old
protected

Definition at line 205 of file properties.h.

◆ _old

template<class T >
T PBD::PropertyTemplate< T >::_old
protected

Definition at line 207 of file properties.h.


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