CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
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

Constructor for objects of the OdSaveState class. Saves a variable without assigning it a new value.

Parameters
variable[in] Variable to save.

Definition at line 51 of file SaveState.h.

◆ OdSaveState() [2/2]

template<class T >
OdSaveState< T >::OdSaveState ( T &  variable,
const T &  newValue 
)
inline

Constructor for objects of the OdSaveState class. Saves a variable and assigns it a new value.

Parameters
variable[in] Variable to save.
newValue[in] New value for a variable.

Definition at line 64 of file SaveState.h.

◆ ~OdSaveState()

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

Destructor for objects of the OdSaveState class. Restores the old value of a variable.

Definition at line 75 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 83 of file SaveState.h.


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