Public Member Functions

Socket Class Reference

Class that exposes data to other modules. More...

#include <sockets.h>

Inheritance diagram for Socket:
Socket16 Socket32 SocketF SocketT< T > Parameter16 Parameter32 ParameterF ParameterT< T >

List of all members.

Public Member Functions

virtual void Print (class Print &dest)
 Print the contents of the socket to the given print destination.
virtual bool IsParameter ()
 Is this socket a parameter?
virtual bool Parse (const char *string)
 Convert a string to the parameter's data type.
virtual void * GetPayload (int &size)
 Get raw data pointer and size.
virtual const char * GetType ()
 Get the payload type name.

Detailed Description

Class that exposes data to other modules.

Sockets are the main method of communication between modules. Sockets can be read or written by other modules. They can be used pretty much like their data type. For instance Socket16 behaves to all intents and purposes like a short int. To expose sockets to other modules, use this syntax in your module's constructor:

 AddSocket("socket name", &socket);

Memory consumption of a socket or parameter is 2 bytes plus payload on von Neumann architecures. On Harvard architectures such as AVR, ram conumption may be much higher if the names are placed in RAM.

Very little if any CPU overhead, assuming the compiler does it's job properly.


Member Function Documentation

virtual void* Socket::GetPayload ( int &  size  )  [inline, virtual]

Get raw data pointer and size.

Used mainly for backing up to non volatile memory

Reimplemented in SocketT< T >, Socket16, Socket32, SocketF, and ParameterT< T >.

virtual const char* Socket::GetType (  )  [inline, virtual]

Get the payload type name.

mainly used by the module manager

Reimplemented in SocketT< T >, Socket16, Socket32, SocketF, and ParameterT< T >.

virtual bool Socket::IsParameter (  )  [inline, virtual]

Is this socket a parameter?

Parameters are special sockets that are storted in EEPROM

Reimplemented in ParameterT< T >, Parameter16, Parameter32, and ParameterF.

virtual bool Socket::Parse ( const char *  string  )  [inline, virtual]

Convert a string to the parameter's data type.

Reimplemented in ParameterT< T >, Parameter16, Parameter32, and ParameterF.

virtual void Socket::Print ( class Print &  dest  )  [inline, virtual]

Print the contents of the socket to the given print destination.

Reimplemented in SocketT< T >, Socket16, Socket32, SocketF, and ParameterT< T >.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines