Fawkes API  Fawkes Development Version
fawkes::GossipGroup Class Reference

Gossip group communication handler. More...

#include <>>

Public Member Functions

 ~GossipGroup ()
 Destructor. More...
 
void send (std::string &peer, google::protobuf::Message &m)
 Send a message. More...
 
void broadcast (google::protobuf::Message &m)
 Broadcast a message to all peers in the group. More...
 
protobuf_comm::MessageRegistermessage_register ()
 Get the protobuf message register. More...
 
boost::signals2::signal< void(boost::asio::ip::udp::endpoint &, uint16_t, uint16_t, std::shared_ptr< google::protobuf::Message >)> & signal_received ()
 Signal that is invoked when a message has been received. More...
 
boost::signals2::signal< void(boost::asio::ip::udp::endpoint &, std::string)> & signal_recv_error ()
 Signal that is invoked when receiving a message failed. More...
 
boost::signals2::signal< void(std::string)> & signal_send_error ()
 Signal that is invoked when sending a message failed. More...
 
const std::string & name () const
 Get group name. More...
 
std::shared_ptr< protobuf_comm::ProtobufBroadcastPeerpeer () const
 Get Protobuf broadcast peer. More...
 

Friends

class GossipGroupManager
 

Detailed Description

Gossip group communication handler.

The group communication handler cares about joining groups and sending and receiving data.

Author
Tim Niemueller

Definition at line 46 of file gossip_group.h.

Constructor & Destructor Documentation

◆ ~GossipGroup()

fawkes::GossipGroup::~GossipGroup ( )

Destructor.

Definition at line 106 of file gossip_group.cpp.

Member Function Documentation

◆ broadcast()

void fawkes::GossipGroup::broadcast ( google::protobuf::Message &  m)

Broadcast a message to all peers in the group.

Parameters
mmessage to send

Definition at line 130 of file gossip_group.cpp.

◆ message_register()

protobuf_comm::MessageRegister& fawkes::GossipGroup::message_register ( )
inline

Get the protobuf message register.

Returns
message register

Definition at line 60 of file gossip_group.h.

◆ name()

const std::string& fawkes::GossipGroup::name ( ) const
inline

Get group name.

Returns
group name.

Definition at line 84 of file gossip_group.h.

◆ peer()

std::shared_ptr<protobuf_comm::ProtobufBroadcastPeer> fawkes::GossipGroup::peer ( ) const
inline

Get Protobuf broadcast peer.

Returns
protobuf broadcast peer.

Definition at line 88 of file gossip_group.h.

◆ send()

void fawkes::GossipGroup::send ( std::string &  peer,
google::protobuf::Message &  m 
)

Send a message.

Parameters
peerpeer to send message to
mmessage to send

Definition at line 119 of file gossip_group.cpp.

◆ signal_received()

boost::signals2::signal<void (boost::asio::ip::udp::endpoint &, uint16_t, uint16_t, std::shared_ptr<google::protobuf::Message>)>& fawkes::GossipGroup::signal_received ( )
inline

Signal that is invoked when a message has been received.

Returns
signal

Definition at line 67 of file gossip_group.h.

◆ signal_recv_error()

boost::signals2::signal<void (boost::asio::ip::udp::endpoint &, std::string)>& fawkes::GossipGroup::signal_recv_error ( )
inline

Signal that is invoked when receiving a message failed.

Returns
signal

Definition at line 73 of file gossip_group.h.

◆ signal_send_error()

boost::signals2::signal<void (std::string)>& fawkes::GossipGroup::signal_send_error ( )
inline

Signal that is invoked when sending a message failed.

Returns
signal

Definition at line 79 of file gossip_group.h.


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