#include <AP_Common.h>
Inherited by AP_EEPromVar< type >.
Public Member Functions | |
AP_Var (const type &data, const char *name="", const bool &sync=false) | |
void | set (const type &val) |
const type & | get () |
void | setAsFloat (const float &val) |
const float & | getAsFloat () |
virtual void | save () |
virtual void | load () |
const char * | getName () |
const bool & | getSync () |
void | setSync (bool sync) |
Protected Attributes | |
type | _data |
const char * | _name |
bool | _sync |
The parameter template class. This class implements get/set/save/load etc for the abstract template type.
Definition at line 92 of file AP_Common.h.
AP_Var< type >::AP_Var | ( | const type & | data, | |
const char * | name = "" , |
|||
const bool & | sync = false | |||
) | [inline] |
The default constrcutor
Definition at line 98 of file AP_Common.h.
const type& AP_Var< type >::get | ( | ) | [inline] |
Get the variable value.
Definition at line 114 of file AP_Common.h.
const float& AP_Var< type >::getAsFloat | ( | ) | [inline] |
Get the variable as a float
Definition at line 129 of file AP_Common.h.
const char* AP_Var< type >::getName | ( | ) | [inline] |
Get the name. This is useful for ground stations.
Definition at line 151 of file AP_Common.h.
const bool& AP_Var< type >::getSync | ( | ) | [inline] |
If sync is true the a load will always occure before a get and a save will always occure before a set.
Definition at line 157 of file AP_Common.h.
virtual void AP_Var< type >::load | ( | ) | [inline, virtual] |
Load a variable from eeprom
Definition at line 144 of file AP_Common.h.
virtual void AP_Var< type >::save | ( | ) | [inline, virtual] |
Save a variable to eeprom
Definition at line 137 of file AP_Common.h.
void AP_Var< type >::set | ( | const type & | val | ) | [inline] |
Set the variable value
Definition at line 106 of file AP_Common.h.
void AP_Var< type >::setAsFloat | ( | const float & | val | ) | [inline] |
Set the variable value as a float
Definition at line 122 of file AP_Common.h.
void AP_Var< type >::setSync | ( | bool | sync | ) | [inline] |
Definition at line 158 of file AP_Common.h.
Definition at line 161 of file AP_Common.h.
The data that is stored on the heap
Definition at line 162 of file AP_Common.h.
The variable name, useful for gcs and terminal output
Definition at line 163 of file AP_Common.h.