CFx SDK Documentation  2022 SP0
Public Member Functions | List of all members
OdSaveState< T > Class Template Reference

#include <SaveState.h>

Public Member Functions

 OdSaveState (T &variable)
 
 OdSaveState (T &variable, const T &newValue)
 
 ~OdSaveState ()
 
 operator const T & () const
 

Detailed Description

template<class T>
class OdSaveState< T >

This template class implements SaveState objects which save and restore variables.

Remarks
Variables are saved locally on construction of OdSaveState objects. Variables are restored when OdSaveState objects go out of scope.

<group Other_Classes>

Definition at line 39 of file SaveState.h.

Constructor & Destructor Documentation

◆ OdSaveState() [1/2]

template<class T >
OdSaveState< T >::OdSaveState ( T &  variable)
inline
Parameters
variable[in] Variable to save.

Definition at line 46 of file SaveState.h.

◆ OdSaveState() [2/2]

template<class T >
OdSaveState< T >::OdSaveState ( T &  variable,
const T &  newValue 
)
inline
Parameters
newValue[in] New value for variable.

Definition at line 53 of file SaveState.h.

◆ ~OdSaveState()

template<class T >
OdSaveState< T >::~OdSaveState ( )
inline

Definition at line 59 of file SaveState.h.

Member Function Documentation

◆ operator const T &()

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

Returns the saved value of the variable.

Definition at line 66 of file SaveState.h.


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