MWAWVariable< T > Struct Template Reference

a generic variable template: value + flag to know if the variable is set More...

#include <libmwaw_internal.hxx>

Public Member Functions

 MWAWVariable ()
 constructor
 
 MWAWVariable (T const &def)
 constructor with a default value
 
 MWAWVariable (MWAWVariable const &orig)
 copy constructor
 
MWAWVariableoperator= (MWAWVariable const &)=default
 copy operator
 
MWAWVariableoperator= (T const &val)
 set a value
 
void insert (MWAWVariable const &orig)
 update the current value if orig is set
 
T const * operator-> () const
 operator*
 
T * operator-> ()
 operator*
 
T const & operator* () const
 operator*
 
T & operator* ()
 operator*
 
T const & get () const
 return the current value
 
bool isSet () const
 return true if the variable is set
 
void setSet (bool newVal)
 define if the variable is set
 

Protected Attributes

m_data
 the value
 
bool m_set
 a flag to know if the variable is set or not
 

Detailed Description

template<class T>
struct MWAWVariable< T >

a generic variable template: value + flag to know if the variable is set

Note
the variable is considered set as soon a new value is set or when its content is acceded by a function which returns a not-const reference... You can use the function setSet to unset it.
must be replaced by std::optional when we will be comptable with std::c++-17

Constructor & Destructor Documentation

◆ MWAWVariable() [1/3]

template<class T >
MWAWVariable< T >::MWAWVariable ( )
inline

constructor

◆ MWAWVariable() [2/3]

template<class T >
MWAWVariable< T >::MWAWVariable ( T const &  def)
inlineexplicit

constructor with a default value

◆ MWAWVariable() [3/3]

template<class T >
MWAWVariable< T >::MWAWVariable ( MWAWVariable< T > const &  orig)
inline

copy constructor

Member Function Documentation

◆ get()

◆ insert()

◆ isSet()

◆ operator*() [1/2]

template<class T >
T & MWAWVariable< T >::operator* ( )
inline

operator*

◆ operator*() [2/2]

template<class T >
T const & MWAWVariable< T >::operator* ( ) const
inline

operator*

◆ operator->() [1/2]

template<class T >
T * MWAWVariable< T >::operator-> ( )
inline

operator*

◆ operator->() [2/2]

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

operator*

◆ operator=() [1/2]

template<class T >
MWAWVariable & MWAWVariable< T >::operator= ( MWAWVariable< T > const &  )
default

copy operator

◆ operator=() [2/2]

template<class T >
MWAWVariable & MWAWVariable< T >::operator= ( T const &  val)
inline

set a value

◆ setSet()

template<class T >
void MWAWVariable< T >::setSet ( bool  newVal)
inline

define if the variable is set

Referenced by MWAWParagraph::MWAWParagraph(), and Canvas5StyleManager::readColor().

Member Data Documentation

◆ m_data

◆ m_set

template<class T >
bool MWAWVariable< T >::m_set
protected

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

Generated on Thu Jan 19 2023 00:00:00 for libmwaw by doxygen 1.9.6