Fawkes API  Fawkes Development Version
protobuf_clips::ClipsProtobufCommunicator Class Reference

CLIPS protobuf integration class. More...

#include <>>

Public Member Functions

 ClipsProtobufCommunicator (CLIPS::Environment *env, fawkes::Mutex &env_mutex, fawkes::Logger *logger=NULL)
 Constructor. More...
 
 ClipsProtobufCommunicator (CLIPS::Environment *env, fawkes::Mutex &env_mutex, std::vector< std::string > &proto_path, fawkes::Logger *logger=NULL)
 Constructor. More...
 
 ~ClipsProtobufCommunicator ()
 Destructor. More...
 
void enable_server (int port)
 Enable protobuf stream server. More...
 
void disable_server ()
 Disable protobu stream server. More...
 
protobuf_comm::ProtobufStreamServerserver () const
 Get Protobuf server. More...
 
const std::map< long int, protobuf_comm::ProtobufBroadcastPeer * > & peers () const
 Get protobuf_comm peers. More...
 
protobuf_comm::MessageRegistermessage_register ()
 Get the communicator's message register. More...
 
boost::signals2::signal< void(protobuf_comm::ProtobufStreamServer::ClientID, std::shared_ptr< google::protobuf::Message >)> & signal_server_sent ()
 Signal invoked for a message that has been sent to a server client. More...
 
boost::signals2::signal< void(std::string, unsigned short, std::shared_ptr< google::protobuf::Message >)> & signal_client_sent ()
 Signal invoked for a message that has been sent to a client. More...
 
boost::signals2::signal< void(long, std::shared_ptr< google::protobuf::Message >)> & signal_peer_sent ()
 Signal invoked for a message that has been sent via broadcast. More...
 

Detailed Description

CLIPS protobuf integration class.

This class adds functionality related to protobuf to a given CLIPS environment. It supports the creation of communication channels through protobuf_comm. An instance maintains its own message register shared among server, peer, and clients.

Author
Tim Niemueller

Definition at line 61 of file communicator.h.

Constructor & Destructor Documentation

◆ ClipsProtobufCommunicator() [1/2]

protobuf_clips::ClipsProtobufCommunicator::ClipsProtobufCommunicator ( CLIPS::Environment *  env,
fawkes::Mutex env_mutex,
fawkes::Logger logger = NULL 
)

Constructor.

Parameters
envCLIPS environment to which to provide the protobuf functionality
env_mutexmutex to lock when operating on the CLIPS environment.
loggeroptional logger for informational output

Definition at line 71 of file communicator.cpp.

◆ ClipsProtobufCommunicator() [2/2]

protobuf_clips::ClipsProtobufCommunicator::ClipsProtobufCommunicator ( CLIPS::Environment *  env,
fawkes::Mutex env_mutex,
std::vector< std::string > &  proto_path,
fawkes::Logger logger = NULL 
)

Constructor.

Parameters
envCLIPS environment to which to provide the protobuf functionality
env_mutexmutex to lock when operating on the CLIPS environment.
proto_pathproto path passed to a newly instantiated message register
loggeroptional logger for informational output

Definition at line 87 of file communicator.cpp.

◆ ~ClipsProtobufCommunicator()

protobuf_clips::ClipsProtobufCommunicator::~ClipsProtobufCommunicator ( )

Destructor.

Definition at line 100 of file communicator.cpp.

References disable_server(), and enable_server().

Member Function Documentation

◆ disable_server()

◆ enable_server()

void protobuf_clips::ClipsProtobufCommunicator::enable_server ( int  port)

◆ message_register()

protobuf_comm::MessageRegister& protobuf_clips::ClipsProtobufCommunicator::message_register ( )
inline

Get the communicator's message register.

Returns
message register

Definition at line 87 of file communicator.h.

◆ peers()

const std::map<long int, protobuf_comm::ProtobufBroadcastPeer *>& protobuf_clips::ClipsProtobufCommunicator::peers ( ) const
inline

Get protobuf_comm peers.

Returns
protobuf_comm peer

Definition at line 82 of file communicator.h.

◆ server()

protobuf_comm::ProtobufStreamServer* protobuf_clips::ClipsProtobufCommunicator::server ( ) const
inline

Get Protobuf server.

Returns
protobuf server

Definition at line 76 of file communicator.h.

◆ signal_client_sent()

boost::signals2::signal<void (std::string, unsigned short, std::shared_ptr<google::protobuf::Message>)>& protobuf_clips::ClipsProtobufCommunicator::signal_client_sent ( )
inline

Signal invoked for a message that has been sent to a client.

Returns
signal

Definition at line 102 of file communicator.h.

◆ signal_peer_sent()

boost::signals2::signal<void (long, std::shared_ptr<google::protobuf::Message>)>& protobuf_clips::ClipsProtobufCommunicator::signal_peer_sent ( )
inline

Signal invoked for a message that has been sent via broadcast.

Returns
signal

Definition at line 109 of file communicator.h.

◆ signal_server_sent()

boost::signals2::signal<void (protobuf_comm::ProtobufStreamServer::ClientID, std::shared_ptr<google::protobuf::Message>)>& protobuf_clips::ClipsProtobufCommunicator::signal_server_sent ( )
inline

Signal invoked for a message that has been sent to a server client.

Returns
signal

Definition at line 95 of file communicator.h.


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