Public Member Functions | Protected Attributes

AP_Var< type > Class Template Reference

#include <AP_Var.h>

Inherits AP_VarI.

Inherited by AP_EEPromVar< type >.

Collaboration diagram for AP_Var< type >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AP_Var (const type &data, const char *name="", const char *parentName="", const bool &sync=false)
 The default constrcutor.
 AP_Var (AP_VarI &v)
 float copy constructor
void set (const type &val)
 Set the variable value.
const type & get ()
 Get the variable value.
virtual void setF (const float &val)
 Set the variable value as a float.
virtual const float getF ()
 Get the variable as a float.
virtual void setI (const int16_t &val)
 Set the variable value as an Int16.
virtual const int16_t getI ()
 Get the variable value as an Int16.
virtual void setB (const bool &val)
 Set the variable value as an Int16.
virtual const bool getB ()
 Get the variable value as an Int16.
virtual void save ()
 Save a variable to eeprom.
virtual void load ()
 Load a variable from eeprom.
virtual const char * getName ()
 Get the name. This is useful for ground stations.
virtual const char * getParentName ()
 Get the parent name. This is also useful for ground stations.
virtual const bool & getSync ()
virtual void setSync (const bool &sync)
 Set the sync property.

Protected Attributes

type _data
const char * _name
 The data that is stored on the heap */.
const char * _parentName
 The variable name, useful for gcs and terminal output.
bool _sync
 The variable parent name, useful for gcs and terminal output.

Detailed Description

template<class type>
class AP_Var< type >

The variable template class. This class implements get/set/save/load etc for the abstract template type.

Definition at line 57 of file AP_Var.h.


Constructor & Destructor Documentation

template<class type >
AP_Var< type >::AP_Var ( const type &  data,
const char *  name = "",
const char *  parentName = "",
const bool &  sync = false 
) [inline]

The default constrcutor.

Definition at line 61 of file AP_Var.h.

template<class type >
AP_Var< type >::AP_Var ( AP_VarI v  )  [inline]

float copy constructor

Definition at line 67 of file AP_Var.h.


Member Function Documentation

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

Get the variable value.

Definition at line 79 of file AP_Var.h.

template<class type >
virtual const bool AP_Var< type >::getB (  )  [inline, virtual]

Get the variable value as an Int16.

Implements AP_VarI.

Definition at line 110 of file AP_Var.h.

template<class type >
virtual const float AP_Var< type >::getF (  )  [inline, virtual]

Get the variable as a float.

Implements AP_VarI.

Definition at line 90 of file AP_Var.h.

template<class type >
virtual const int16_t AP_Var< type >::getI (  )  [inline, virtual]

Get the variable value as an Int16.

Implements AP_VarI.

Definition at line 100 of file AP_Var.h.

template<class type >
virtual const char* AP_Var< type >::getName (  )  [inline, virtual]

Get the name. This is useful for ground stations.

Implements AP_VarI.

Definition at line 125 of file AP_Var.h.

template<class type >
virtual const char* AP_Var< type >::getParentName (  )  [inline, virtual]

Get the parent name. This is also useful for ground stations.

Definition at line 128 of file AP_Var.h.

template<class type >
virtual const bool& AP_Var< type >::getSync (  )  [inline, virtual]

If sync is true the a load will always occure before a get and a save will always occure before a set.

Implements AP_VarI.

Definition at line 132 of file AP_Var.h.

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

Load a variable from eeprom.

Implements AP_VarI.

Definition at line 120 of file AP_Var.h.

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

Save a variable to eeprom.

Implements AP_VarI.

Definition at line 115 of file AP_Var.h.

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

Set the variable value.

Definition at line 73 of file AP_Var.h.

template<class type >
virtual void AP_Var< type >::setB ( const bool &  val  )  [inline, virtual]

Set the variable value as an Int16.

Implements AP_VarI.

Definition at line 105 of file AP_Var.h.

template<class type >
virtual void AP_Var< type >::setF ( const float &  val  )  [inline, virtual]

Set the variable value as a float.

Implements AP_VarI.

Definition at line 85 of file AP_Var.h.

template<class type >
virtual void AP_Var< type >::setI ( const int16_t &  val  )  [inline, virtual]

Set the variable value as an Int16.

Implements AP_VarI.

Definition at line 95 of file AP_Var.h.

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

Set the sync property.

Implements AP_VarI.

Definition at line 133 of file AP_Var.h.


Member Data Documentation

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

Definition at line 136 of file AP_Var.h.

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

The data that is stored on the heap */.

Definition at line 137 of file AP_Var.h.

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

The variable name, useful for gcs and terminal output.

Definition at line 138 of file AP_Var.h.

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

The variable parent name, useful for gcs and terminal output.

Definition at line 139 of file AP_Var.h.


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