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

Most generic node type of SPSP. More...

#include <node.hpp>

Public Member Functions

 INode ()
 Constructs a new generic node. More...
 
virtual bool publish (const std::string &topic, const std::string &payload)=0
 Publishes payload to topic. More...
 
virtual bool subscribe (const std::string &topic, SubscribeCb cb)=0
 Subscribes to topic. More...
 
virtual bool unsubscribe (const std::string &topic)=0
 Unsubscribes from topic. More...
 
virtual void resubscribeAll ()=0
 Resubscribes to all topics. More...
 

Detailed Description

Most generic node type of SPSP.

Doesn't do anything at all.

Definition at line 49 of file node.hpp.

Constructor & Destructor Documentation

◆ INode()

SPSP::INode::INode ( )
inline

Constructs a new generic node.

Definition at line 56 of file node.hpp.

Member Function Documentation

◆ publish()

virtual bool SPSP::INode::publish ( const std::string &  topic,
const std::string &  payload 
)
pure virtual

Publishes payload to topic.

This is primary endpoint for publishing data locally on all node types.

Parameters
topicTopic
payloadPayload
Returns
true Delivery successful
false Delivery failed

◆ resubscribeAll()

virtual void SPSP::INode::resubscribeAll ( )
pure virtual

Resubscribes to all topics.

◆ subscribe()

virtual bool SPSP::INode::subscribe ( const std::string &  topic,
SubscribeCb  cb 
)
pure virtual

Subscribes to topic.

This is primary endpoint for subscribing locally on all node types.

Parameters
topicTopic
cbCallback function
Returns
true Subscribe successful
false Subscribe failed

◆ unsubscribe()

virtual bool SPSP::INode::unsubscribe ( const std::string &  topic)
pure virtual

Unsubscribes from topic.

This is primary endpoint for unsubscribing locally on all node types.

Parameters
topicTopic
Returns
true Unsubscribe successful
false Unsubscribe failed

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