SOLA
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
natter::Natter< T, NodeInfoT > Class Template Reference

#include <natter.h>

Public Types

using NodeInfo = NodeInfoT
 

Public Member Functions

 Natter (const Natter &)=delete
 
Natteroperator= (const Natter &other)=delete
 
 Natter (Natter &&)=delete
 
Natteroperator= (Natter &&)=delete
 
solanet::UUID publish (const std::string &topic, const std::string &msg_content)
 
bool addPeer (const std::string &topic, const NodeInfo &info)
 
void subscribeTopic (const std::string &topic, const NodeInfo &info)
 
bool isSubscribedToTopic (const std::string &topic) const
 
void unsubscribeTopic (const std::string &topic)
 
bool removePeer (const std::string &topic, const std::string &ip, uint16_t port)
 
solanet::UUID getUUID () const
 
NodeInfo getOwnNodeInfo (const std::string &topic) const
 
NetworkInfoIPv4 getNetworkInfo () const
 

Detailed Description

template<class T, class NodeInfoT>
class natter::Natter< T, NodeInfoT >

natter instance

Member Function Documentation

◆ addPeer()

template<class T , class NodeInfoT >
bool natter::Natter< T, NodeInfoT >::addPeer ( const std::string &  topic,
const NodeInfo &  info 
)
inline

Add peer to the set which natter will use for message dissemination

Parameters
topicTopic for which this node should be used
infoInformation about other peer (specific for selected dissemination algorithm)
Returns
true if peer was added successfully

◆ getNetworkInfo()

template<class T , class NodeInfoT >
NetworkInfoIPv4 natter::Natter< T, NodeInfoT >::getNetworkInfo ( ) const
inline

Returns IPv4 and port of this natter instance

Returns
ip

◆ getOwnNodeInfo()

template<class T , class NodeInfoT >
NodeInfo natter::Natter< T, NodeInfoT >::getOwnNodeInfo ( const std::string &  topic) const
inline

Returns the node info for a given topic of this natter instance

Parameters
topic
Returns

◆ getUUID()

template<class T , class NodeInfoT >
solanet::UUID natter::Natter< T, NodeInfoT >::getUUID ( ) const
inline

Returns UUID of this natter node

Returns
node uuid

◆ isSubscribedToTopic()

template<class T , class NodeInfoT >
bool natter::Natter< T, NodeInfoT >::isSubscribedToTopic ( const std::string &  topic) const
inline

Checks if this natter instance is subscribed to topic

Parameters
topic
Returns

◆ publish()

template<class T , class NodeInfoT >
solanet::UUID natter::Natter< T, NodeInfoT >::publish ( const std::string &  topic,
const std::string &  msg_content 
)
inline

Publish message to a topic

Parameters
topicTopic to publish to
msg_contentcontent to publish. Might be in any form. std::string acts as a container only.
Returns
the message id

◆ removePeer()

template<class T , class NodeInfoT >
bool natter::Natter< T, NodeInfoT >::removePeer ( const std::string &  topic,
const std::string &  ip,
uint16_t  port 
)
inline

Remove peer from the set which natter will use to gossip with

Parameters
topicTopic to unsubscribe
uuidunique-id of the node to be removed
Returns
true if peer was removed successfully

◆ subscribeTopic()

template<class T , class NodeInfoT >
void natter::Natter< T, NodeInfoT >::subscribeTopic ( const std::string &  topic,
const NodeInfo &  info 
)
inline

Subscribe topic so natter accept new peers on that topic

Parameters
topictopic name

◆ unsubscribeTopic()

template<class T , class NodeInfoT >
void natter::Natter< T, NodeInfoT >::unsubscribeTopic ( const std::string &  topic)
inline

Remove topic. This will remove all added peers for that topic.

Parameters
topic

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