Class that exposes data to other modules. More...
#include <sockets.h>
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. | |
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.
| 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 >.
1.7.0