Entire Class Index | Main Class Index | Cross Index | Global Index

# Class CL_NetVariables

Easy serialization of a data structure.
Contained in: global
Derived from: none
Derived by: none
Group: Network (NetObjects)

#include <ClanLib/network.h>

### public function member index:

### Construction:

`` | `CL_NetVariables` | `()`;
``virtual`` | `~CL_NetVariables` | `()`;

### Attributes:

``bool`` | `is_different` | `()`;

### Operations:

``void`` | `add_bool` | `(`bool`* `var`, `int` `array` = 1)`;
``void`` | `add_int` | `(`int`* `var`, `int` `array` = 1)`;
``void`` | `add_short` | `(`short`* `var`, `int` `array` = 1)`;
``void`` | `add_float` | `(`float`* `var`, `int` `array` = 1)`;
``void`` | `add_double` | `(`double`* `var`, `int` `array` = 1)`;
``void`` | `add_vars` | `(`CL_NetVariables`* `variables`, `int` `array` = 1)`;
``void`` | `save_all` | `(`class` `CL_OutputSource`* `msg`)`;
``void`` | `load_all` | `(`class` `CL_InputSource`* `msg`)`;
``void`` | `save_diff` | `(`class` `CL_OutputSource`* `msg`)`;
``void`` | `load_diff` | `(`class` `CL_InputSource`* `msg`)`;

## Description:

The netvariables class is used to read a set of variables from an object, and write them structured, in network byte order, to an output source.
The Netvariables interface can also read the data again, and produce 'diff' packages where it only write variables that have changed since last write.

## Function Member Descriptions:

CL_NetVariables::CL_NetVariables - Construct a netvariables object.
`` `CL_NetVariables` `()`;

CL_NetVariables::add_bool - Add booleans to the data structure.
``void`` `add_bool` `(`bool`* `var`, `int` `array` = 1)`;

CL_NetVariables::add_double - Add doubles to the data structure.
``void`` `add_double` `(`double`* `var`, `int` `array` = 1)`;

CL_NetVariables::add_float - Add floats to the data structure.
``void`` `add_float` `(`float`* `var`, `int` `array` = 1)`;

CL_NetVariables::add_int - Add integers to the data structure.
``void`` `add_int` `(`int`* `var`, `int` `array` = 1)`;

CL_NetVariables::add_short - Add shorts to the data structure.
``void`` `add_short` `(`short`* `var`, `int` `array` = 1)`;

CL_NetVariables::add_vars - Add structures to the data structure.
``void`` `add_vars` `(`CL_NetVariables`* `variables`, `int` `array` = 1)`;

CL_NetVariables::is_different - Returns true if the variables have changed since last save.
``bool`` `is_different` `()`;

CL_NetVariables::load_all - Read all variables in the data structure from the input source.
``void`` `load_all` `(`class` `CL_InputSource`* `msg`)`;

CL_NetVariables::load_diff - Read a diff produced with save_diff from the input source.
``void`` `load_diff` `(`class` `CL_InputSource`* `msg`)`;

CL_NetVariables::save_all - Write all variables in the data structure to the output source.
``void`` `save_all` `(`class` `CL_OutputSource`* `msg`)`;

CL_NetVariables::save_diff - Write all variables that have changed since last save.
``void`` `save_diff` `(`class` `CL_OutputSource`* `msg`)`;

CL_NetVariables::~CL_NetVariables - Net Variables Destructor
``virtual`` `~CL_NetVariables` `()`;

## Variable Member Descriptions: