XMM - Probabilistic Models for Motion Recognition and Mapping

Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
xmm::Attribute< T > Class Template Reference

Generic Attribute. More...

#include <xmmAttribute.hpp>

Inheritance diagram for xmm::Attribute< T >:
[legend]
Collaboration diagram for xmm::Attribute< T >:
[legend]

Public Types

typedef std::function< void(AttributeBase *)> AttributeChangeCallback
 

Public Member Functions

template<typename U , typename args , class ListenerClass >
void onAttributeChange (U *owner, void(ListenerClass::*listenerMethod)(args))
 
 Attribute (T const &value=T(), T const &limit_min=defaultLimitMin(), T const &limit_max=defaultLimitMax())
 Default Constructor. More...
 
 Attribute (Attribute const &src)
 Copy Constructor. More...
 
template<typename U >
Attributeoperator= (Attribute< U > const &src)
 Assignment operator. More...
 
void set (T const &value, bool silently=false)
 Set the attribute value. More...
 
get () const
 get the attribute's current value More...
 
void setLimitMin (T const &limit_min=defaultLimitMin())
 set the attribute's minimum value More...
 
void setLimitMax (T const &limit_max=defaultLimitMax())
 set the attribute's maximum value More...
 
void setLimits (T const &limit_min=defaultLimitMin(), T const &limit_max=defaultLimitMax())
 set the attribute's limit values More...
 

Public Attributes

bool changed
 Defines if the value has been changed. More...
 

Protected Member Functions

template<>
xmm::GaussianDistribution::CovarianceMode defaultLimitMax ()
 
template<>
GaussianDistribution::CovarianceMode defaultLimitMax ()
 
template<>
xmm::HMM::TransitionMode defaultLimitMax ()
 
template<>
xmm::HMM::RegressionEstimator defaultLimitMax ()
 
template<>
HMM::TransitionMode defaultLimitMax ()
 
template<>
HMM::RegressionEstimator defaultLimitMax ()
 

Static Protected Member Functions

static T defaultLimitMin ()
 Attribute default minimum value. More...
 
static T defaultLimitMax ()
 Attribute default maximum value. More...
 

Protected Attributes

value_
 Current value of the attribute. More...
 
limit_min_
 Minimum value of the attribute. More...
 
limit_max_
 Maximum value of the attribute. More...
 
AttributeChangeCallback callback_
 Callback function to be called on attribute change. More...
 

Detailed Description

template<typename T>
class xmm::Attribute< T >

Generic Attribute.

Template Parameters
Tattribute type

Member Typedef Documentation

template<typename T>
typedef std::function<void(AttributeBase*)> xmm::Attribute< T >::AttributeChangeCallback

Constructor & Destructor Documentation

template<typename T>
xmm::Attribute< T >::Attribute ( T const &  value = T(),
T const &  limit_min = defaultLimitMin(),
T const &  limit_max = defaultLimitMax() 
)
inline

Default Constructor.

Parameters
valueattribute value
limit_minminimum limit
limit_maxmaximum limit
template<typename T>
xmm::Attribute< T >::Attribute ( Attribute< T > const &  src)
inline

Copy Constructor.

Parameters
srcsource attribute
Warning
the listener object is not copied from the source attribute

Member Function Documentation

template<>
xmm::HMM::TransitionMode xmm::Attribute< xmm::HMM::TransitionMode >::defaultLimitMax ( )
protected
template<>
HMM::TransitionMode xmm::Attribute< HMM::TransitionMode >::defaultLimitMax ( )
protected
template<>
xmm::HMM::RegressionEstimator xmm::Attribute< xmm::HMM::RegressionEstimator >::defaultLimitMax ( )
protected
template<>
HMM::RegressionEstimator xmm::Attribute< HMM::RegressionEstimator >::defaultLimitMax ( )
protected
template<typename T>
static T xmm::Attribute< T >::defaultLimitMax ( )
inlinestaticprotected

Attribute default maximum value.

template<typename T>
static T xmm::Attribute< T >::defaultLimitMin ( )
inlinestaticprotected

Attribute default minimum value.

template<typename T>
T xmm::Attribute< T >::get ( ) const
inline

get the attribute's current value

Returns
the attribute's current value
template<typename T>
template<typename U , typename args , class ListenerClass >
void xmm::Attribute< T >::onAttributeChange ( U *  owner,
void(ListenerClass::*)(args)  listenerMethod 
)
inline
template<typename T>
template<typename U >
Attribute& xmm::Attribute< T >::operator= ( Attribute< U > const &  src)
inline

Assignment operator.

Parameters
srcsource attribute
Returns
copy of the source Attribute object
Warning
the listener object is not copied from the source attribute
template<typename T>
void xmm::Attribute< T >::set ( T const &  value,
bool  silently = false 
)
inline

Set the attribute value.

Parameters
valuerequested value
silentlyif true, don't notify the listener object
Exceptions
domain_errorexception if the value exceeds the limits
runtime_errorexception if the limit checking are not implemented for the current type
template<typename T>
void xmm::Attribute< T >::setLimitMax ( T const &  limit_max = defaultLimitMax())
inline

set the attribute's maximum value

Parameters
limit_maxmaximum value
template<typename T>
void xmm::Attribute< T >::setLimitMin ( T const &  limit_min = defaultLimitMin())
inline

set the attribute's minimum value

Parameters
limit_minminimum value
template<typename T>
void xmm::Attribute< T >::setLimits ( T const &  limit_min = defaultLimitMin(),
T const &  limit_max = defaultLimitMax() 
)
inline

set the attribute's limit values

Parameters
limit_minminimum value
limit_maxmaximum value

Member Data Documentation

template<typename T>
AttributeChangeCallback xmm::Attribute< T >::callback_
protected

Callback function to be called on attribute change.

bool xmm::AttributeBase::changed
inherited

Defines if the value has been changed.

template<typename T>
T xmm::Attribute< T >::limit_max_
protected

Maximum value of the attribute.

template<typename T>
T xmm::Attribute< T >::limit_min_
protected

Minimum value of the attribute.

template<typename T>
T xmm::Attribute< T >::value_
protected

Current value of the attribute.


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