Public Member Functions | Protected Attributes

AP_Var< type > Class Template Reference

#include <AP_Common.h>

Inherited by AP_EEPromVar< type >.

List of all members.

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

Detailed Description

template<class type>
class AP_Var< type >

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.


Constructor & Destructor Documentation

template<class type >
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.


Member Function Documentation

template<class type >
const type& AP_Var< type >::get (  )  [inline]

Get the variable value.

Definition at line 114 of file AP_Common.h.

template<class type >
const float& AP_Var< type >::getAsFloat (  )  [inline]

Get the variable as a float

Definition at line 129 of file AP_Common.h.

template<class type >
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.

template<class type >
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.

template<class type >
virtual void AP_Var< type >::load (  )  [inline, virtual]

Load a variable from eeprom

Definition at line 144 of file AP_Common.h.

template<class type >
virtual void AP_Var< type >::save (  )  [inline, virtual]

Save a variable to eeprom

Definition at line 137 of file AP_Common.h.

template<class type >
void AP_Var< type >::set ( const type &  val  )  [inline]

Set the variable value

Definition at line 106 of file AP_Common.h.

template<class type >
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.

template<class type >
void AP_Var< type >::setSync ( bool  sync  )  [inline]

Definition at line 158 of file AP_Common.h.


Member Data Documentation

template<class type >
type AP_Var< type >::_data [protected]

Definition at line 161 of file AP_Common.h.

template<class type >
const char* AP_Var< type >::_name [protected]

The data that is stored on the heap

Definition at line 162 of file AP_Common.h.

template<class type >
bool AP_Var< type >::_sync [protected]

The variable name, useful for gcs and terminal output

Definition at line 163 of file AP_Common.h.


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