SPSP
Simple publish-subscribe protocol. Connects low power IoT clients to MQTT.
All Classes Files Functions Variables Typedefs Enumerations
Public Types | Public Member Functions | List of all members
SPSP::ILocalLayer< TLocalMessage > Class Template Referenceabstract

Interface for local layer. More...

#include <layers.hpp>

Public Types

using LocalAddrT = typename TLocalMessage::LocalAddrT
 
using LocalMessageT = TLocalMessage
 

Public Member Functions

void setNode (void *n)
 Sets pointer to the owner node. More...
 
ILocalNode< ILocalLayer > * getNode () const
 Gets the node object. More...
 
bool nodeConnected () const
 Checks whether the owner node is connected. More...
 
virtual bool send (const TLocalMessage &msg)=0
 Sends the message to given node. More...
 

Detailed Description

template<typename TLocalMessage>
class SPSP::ILocalLayer< TLocalMessage >

Interface for local layer.

Template Parameters
TLocalMessageType of local message

Definition at line 26 of file layers.hpp.

Member Function Documentation

◆ getNode()

template<typename TLocalMessage >
ILocalNode<ILocalLayer>* SPSP::ILocalLayer< TLocalMessage >::getNode ( ) const
inline

Gets the node object.

Returns
Node pointer

Definition at line 49 of file layers.hpp.

◆ nodeConnected()

template<typename TLocalMessage >
bool SPSP::ILocalLayer< TLocalMessage >::nodeConnected ( ) const
inline

Checks whether the owner node is connected.

Returns
true Node is connected
false Node is disconnected

Definition at line 60 of file layers.hpp.

◆ send()

template<typename TLocalMessage >
virtual bool SPSP::ILocalLayer< TLocalMessage >::send ( const TLocalMessage &  msg)
pure virtual

Sends the message to given node.

Should be used by INode only!

In the message, empty address means send to the bridge peer.

Parameters
msgMessage
Returns
true Delivery successful
false Delivery failed

◆ setNode()

template<typename TLocalMessage >
void SPSP::ILocalLayer< TLocalMessage >::setNode ( void *  n)
inline

Sets pointer to the owner node.

Parameters
nOwner node

Definition at line 39 of file layers.hpp.


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