|
Robot Raconteur Core C++ Library
|
Base class for PipeBroadcaster. More...
#include <PipeMember.h>
Public Member Functions | |
| boost::function< bool(const boost::shared_ptr< PipeBroadcasterBase > &, uint32_t, int32_t)> | GetPredicate () |
| Get the current predicate callback function. | |
| void | SetPredicate (boost::function< bool(const boost::shared_ptr< PipeBroadcasterBase > &, uint32_t, int32_t)> f) |
| Set the predicate callback function. | |
| int32_t | GetMaxBacklog () |
| Gets the currently configured maximum backlog. | |
| void | SetMaxBacklog (int32_t maximum_backlog) |
| Set the maximum backlog. | |
Base class for PipeBroadcaster.
Base class for templated PipeBroadcaster class
| int32_t RobotRaconteur::PipeBroadcasterBase::GetMaxBacklog | ( | ) |
Gets the currently configured maximum backlog.
| boost::function< bool(const boost::shared_ptr< PipeBroadcasterBase > &, uint32_t, int32_t)> RobotRaconteur::PipeBroadcasterBase::GetPredicate | ( | ) |
Get the current predicate callback function.
| void RobotRaconteur::PipeBroadcasterBase::SetMaxBacklog | ( | int32_t | maximum_backlog | ) |
Set the maximum backlog.
PipeBroadcaster provides flow control by optionally tracking how many packets are in flight to each client pipe endpoint. (This is accomplished using packet acks.) If a maximum backlog is specified, pipe endpoints exceeding this count will stop sending packets.
| maximum_backlog | The maximum number of packets in flight, or -1 for unlimited |
| void RobotRaconteur::PipeBroadcasterBase::SetPredicate | ( | boost::function< bool(const boost::shared_ptr< PipeBroadcasterBase > &, uint32_t, int32_t)> | f | ) |
Set the predicate callback function.
A predicate is optionally used to regulate when packets are sent to clients. This is used by the BroadcastDownsampler to regulate update rates of packets sent to clients.
The predicate callback is invoked before the broadcaster sends a packet to an endpoint. If the predicate returns true, the packet will be sent. If it is false, the packet will not be sent to that endpoint. The predicate callback must have the following signature:
bool broadcaster_predicate(PipeBroadcasterBasePtr& broadcaster, uint32_t client_endpoint, int32_t
pipe_endpoint_index);
It receives the broadcaster, the client endpoint ID, and the pipe endpoint index. It returns true to send the packet, or false to not send the packet.
| f | The predicate callback function |