Murl::ChangeController< DataType > Class Template Reference

The change controller template class to control changes of an object's value. More...

#include "murl_change_controller.h"

Public Types

using ValueType = DataType
 The template parameter value type.
 

Public Member Functions

 ChangeController ()
 The default constructor.
 
 ChangeController (const DataType &value)
 Constructor taking a default value. More...
 
Bool SetValue (const DataType &value)
 Set a value and increment the current frame if the value has been changed. More...
 
const DataType & GetValue () const
 Get the current value. More...
 
Bool WasChanged (ChangeInspector &inspector) const
 Check if the inspector's frame is different to the controller's frame. More...
 
void SetChanged ()
 Increment the current frame.
 
ChangeControlleroperator= (const DataType &value)
 Assignment operator. More...
 
 operator const DataType & () const
 Conversion operator. More...
 

Detailed Description

template<class DataType>
class Murl::ChangeController< DataType >

The change controller template class to control changes of an object's value.

The change controller counts a frame at each values's change and can check a frame change regarding to the ChangeInspector.

Constructor & Destructor Documentation

◆ ChangeController()

template<class DataType >
Murl::ChangeController< DataType >::ChangeController ( const DataType &  value)
inline

Constructor taking a default value.

Parameters
valueThe default value.

Member Function Documentation

◆ SetValue()

template<class DataType >
Bool Murl::ChangeController< DataType >::SetValue ( const DataType &  value)
inline

Set a value and increment the current frame if the value has been changed.

Parameters
valueThe value to set.
Returns
true if the value has been changed.

References Murl::ChangeController< DataType >::SetChanged().

Referenced by Murl::ChangeController< DataType >::operator=().

◆ GetValue()

template<class DataType >
const DataType& Murl::ChangeController< DataType >::GetValue ( ) const
inline

Get the current value.

Returns
The current value.

Referenced by Murl::ChangeController< AspectRatio >::operator const AspectRatio &().

◆ WasChanged()

template<class DataType >
Bool Murl::ChangeController< DataType >::WasChanged ( ChangeInspector inspector) const
inline

Check if the inspector's frame is different to the controller's frame.

Parameters
inspectorThe inspector to check.
Returns
true if the instpector's frame was dfifferent.

References Murl::ChangeInspector::CheckFrame().

◆ operator=()

template<class DataType >
ChangeController& Murl::ChangeController< DataType >::operator= ( const DataType &  value)
inline

Assignment operator.

Calls SetValue().

Parameters
valueThe value to assign.
Returns
The object itself.

References Murl::ChangeController< DataType >::SetValue().

◆ operator const DataType &()

template<class DataType >
Murl::ChangeController< DataType >::operator const DataType & ( ) const
inline

Conversion operator.

Returns
The value object.

The documentation for this class was generated from the following file:
  • murl_change_controller.h


Copyright © 2011-2024 Spraylight GmbH.