STOFFVariable< T > Struct Template Reference

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

`#include <libstaroffice_internal.hxx>`

## Public Member Functions

| STOFFVariable ()
| constructor
| STOFFVariable (T const &def)
| constructor with a default value
| STOFFVariable (STOFFVariable const &orig)
| copy constructor
STOFFVariable & | operator= (STOFFVariable const &orig)
| copy operator
STOFFVariable & | operator= (T const &val)
| set a value
void | insert (STOFFVariable 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

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

## Detailed Description

template<class T>
struct STOFFVariable< 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.

## Constructor & Destructor Documentation

## STOFFVariable() [1/3]

template<class T>

STOFFVariable< T >::STOFFVariable | ( |  | ) |

inline

constructor

Referenced by insert(), operator=(), operator=(), and STOFFVariable().

## STOFFVariable() [2/3]

template<class T>

STOFFVariable< T >::STOFFVariable | ( | T const & | def | ) |

inline explicit

constructor with a default value

## STOFFVariable() [3/3]

template<class T>

STOFFVariable< T >::STOFFVariable | ( | STOFFVariable< T > const & | orig | ) |

inline

copy constructor

## Member Function Documentation

## get()

template<class T>

T const & STOFFVariable< T >::get | ( |  | ) | const

inline

return the current value

## insert()

template<class T>

void STOFFVariable< T >::insert | ( | STOFFVariable< T > const & | orig | ) |

inline

update the current value if orig is set

## isSet()

template<class T>

bool STOFFVariable< T >::isSet | ( |  | ) | const

inline

return true if the variable is set

## operator*() [1/2]

template<class T>

T & STOFFVariable< T >::operator* | ( |  | ) |

inline

operator*

## operator*() [2/2]

template<class T>

T const & STOFFVariable< T >::operator* | ( |  | ) | const

inline

operator*

## operator->() [1/2]

template<class T>

T * STOFFVariable< T >::operator-> | ( |  | ) |

inline

operator*

## operator->() [2/2]

template<class T>

T const * STOFFVariable< T >::operator-> | ( |  | ) | const

inline

operator*

## operator=() [1/2]

template<class T>

STOFFVariable & STOFFVariable< T >::operator= | ( | STOFFVariable< T > const & | orig | ) |

inline

copy operator

## operator=() [2/2]

template<class T>

STOFFVariable & STOFFVariable< T >::operator= | ( | T const & | val | ) |

inline

set a value

## setSet()

template<class T>

void STOFFVariable< T >::setSet | ( | bool | newVal | ) |

inline

define if the variable is set

## Member Data Documentation

## m_data

template<class T>

T STOFFVariable< T >::m_data

protected

the value

Referenced by get(), insert(), operator*(), operator*(), operator->(), operator->(), operator=(), operator=(), STOFFVariable(), STOFFVariable(), and STOFFVariable().

## m_set

template<class T>

bool STOFFVariable< T >::m_set

protected

a flag to know if the variable is set or not

Referenced by insert(), isSet(), operator*(), operator->(), operator=(), operator=(), setSet(), STOFFVariable(), STOFFVariable(), and STOFFVariable().

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

- libstaroffice_internal.hxx