# RakNet::VariableListDeltaTracker Class Reference

`#include <VariableListDeltaTracker.h>`

List of all members.

## Public Member Functions

template<class VarType >
bool | WriteVar (const VarType &varData)
template<class VarType >
bool | WriteVarToBitstream (const VarType &varData, RakNet::BitStream *bitStream)
| Calls WriteVar. If the variable has changed, writes true, and writes the variable. Otherwise writes false.
template<class VarType >
bool | WriteVarToBitstream (const VarType &varData, RakNet::BitStream *bitStream, unsigned char *bArray, unsigned short writeOffset)
| Calls WriteVarToBitstream(). Additionally, adds the boolean result of WriteVar() to boolean bit array.
void | FlagDirtyFromBitArray (unsigned char *bArray)

## Static Public Member Functions

template<class VarType >
static bool | ReadVarFromBitstream (const VarType &varData, RakNet::BitStream *bitStream)
| Paired with a call to WriteVarToBitstream(), will read a variable if it had changed. Otherwise the values remains the same.

## Detailed Description

Class to write a series of variables, copy the contents to memory, and return if the newly written value is different than what was last written Can also encode the reads, writes, and results directly to/from a bitstream

## Member Function Documentation

void RakNet::VariableListDeltaTracker::FlagDirtyFromBitArray | ( | unsigned char * | bArray | ) |

Variables flagged dirty will cause WriteVar() to return true, even if the variable had not otherwise changed This updates all the variables in the list, where in each index varsWritten is true, so will the variable at the corresponding index be flagged dirty

template<class VarType >

bool RakNet::VariableListDeltaTracker::WriteVar | ( | const VarType & | varData | ) | `[inline]`

Records the passed value of the variable to memory, and returns true if the value is different from the write before that (or if it is the first write)

Precondition:
  Call StartWrite() before doing the first of a series of calls to WriteVar or other functions that call WriteVar

Note:
  Variables must be of the same type, written in the same order, each time

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

- d:/RakNet-3.x/Source/VariableListDeltaTracker.h