Robot Raconteur Core C++ Library
Toggle main menu visibility
Loading...
Searching...
No Matches
RobotRaconteurCore
include
RobotRaconteur
BroadcastDownsampler.h
Go to the documentation of this file.
1
23
24
#pragma once
25
26
#include "
RobotRaconteur/RobotRaconteurConfig.h
"
27
#include <boost/unordered_map.hpp>
28
29
namespace
RobotRaconteur
30
{
31
class
ROBOTRACONTEUR_CORE_API
ServerContext
;
32
class
ROBOTRACONTEUR_CORE_API
PipeBroadcasterBase
;
33
class
ROBOTRACONTEUR_CORE_API
WireBroadcasterBase
;
34
63
class
ROBOTRACONTEUR_CORE_API
BroadcastDownsampler
:
public
RR_ENABLE_SHARED_FROM_THIS<BroadcastDownsampler>
64
{
65
public
:
74
BroadcastDownsampler
();
75
82
void
Init
(
const
RR_SHARED_PTR<ServerContext>& context, uint32_t default_downsample = 0);
83
90
uint32_t
GetClientDownsample
(uint32_t ep);
91
98
void
SetClientDownsample
(uint32_t ep, uint32_t downsample);
99
106
void
BeginStep
();
107
114
void
EndStep
();
115
123
void
AddPipeBroadcaster
(
const
RR_SHARED_PTR<PipeBroadcasterBase>& broadcaster);
124
132
void
AddWireBroadcaster
(
const
RR_SHARED_PTR<WireBroadcasterBase>& broadcaster);
133
134
protected
:
135
RR_WEAK_PTR<ServerContext> context;
136
137
uint32_t default_downsample;
138
uint64_t step_count;
139
RR_UNORDERED_MAP<uint32_t, uint32_t> client_downsamples;
140
141
boost::mutex this_lock;
142
143
static
bool
wire_predicate(RR_WEAK_PTR<BroadcastDownsampler> this_,
const
RR_SHARED_PTR<WireBroadcasterBase>& wire,
144
uint32_t ep);
145
static
bool
pipe_predicate(RR_WEAK_PTR<BroadcastDownsampler> this_,
const
RR_SHARED_PTR<PipeBroadcasterBase>& wire,
146
uint32_t ep, uint32_t index);
147
148
static
void
server_event(RR_WEAK_PTR<BroadcastDownsampler> this_,
const
RR_SHARED_PTR<ServerContext>& ctx,
149
ServerServiceListenerEventType
evt,
const
RR_SHARED_PTR<void>& p);
150
};
151
160
class
ROBOTRACONTEUR_CORE_API
BroadcastDownsamplerStep
161
{
162
RR_SHARED_PTR<BroadcastDownsampler>& _downsampler;
163
164
public
:
174
BroadcastDownsamplerStep
(RR_SHARED_PTR<BroadcastDownsampler>& downsampler);
175
~BroadcastDownsamplerStep
();
176
};
177
178
#ifndef ROBOTRACONTEUR_NO_CXX11_TEMPLATE_ALIASES
180
using
BroadcastDownsamplerPtr
= RR_SHARED_PTR<BroadcastDownsampler>;
181
#endif
182
}
// namespace RobotRaconteur
RobotRaconteur::BroadcastDownsamplerPtr
boost::shared_ptr< BroadcastDownsampler > BroadcastDownsamplerPtr
Convenience alias for BroadcastDownsampler shared_ptr.
Definition
BroadcastDownsampler.h:180
RobotRaconteurConfig.h
RobotRaconteur::ServerServiceListenerEventType
ServerServiceListenerEventType
Enum of service listener events.
Definition
RobotRaconteurConstants.h:518
RobotRaconteur::BroadcastDownsampler::BroadcastDownsampler
BroadcastDownsampler()
Construct a new BroadcastDownsampler.
RobotRaconteur::BroadcastDownsampler::SetClientDownsample
void SetClientDownsample(uint32_t ep, uint32_t downsample)
Set the downsample for the specified client.
RobotRaconteur::BroadcastDownsampler::AddPipeBroadcaster
void AddPipeBroadcaster(const boost::shared_ptr< PipeBroadcasterBase > &broadcaster)
Add a PipeBroadcaster to the downsampler.
RobotRaconteur::BroadcastDownsampler::GetClientDownsample
uint32_t GetClientDownsample(uint32_t ep)
Get the downsample for the specified client.
RobotRaconteur::BroadcastDownsampler::BeginStep
void BeginStep()
Begin the update loop step.
RobotRaconteur::BroadcastDownsampler::EndStep
void EndStep()
End the update loop step.
RobotRaconteur::BroadcastDownsampler::AddWireBroadcaster
void AddWireBroadcaster(const boost::shared_ptr< WireBroadcasterBase > &broadcaster)
Add a WireBroadcaster to the downsampler.
RobotRaconteur::BroadcastDownsampler::Init
void Init(const boost::shared_ptr< ServerContext > &context, uint32_t default_downsample=0)
Initialize the BroadcastDownsampler.
RobotRaconteur::BroadcastDownsamplerStep::BroadcastDownsamplerStep
BroadcastDownsamplerStep(boost::shared_ptr< BroadcastDownsampler > &downsampler)
Construct a BroadcastDownsampler.
RobotRaconteur::PipeBroadcasterBase
Base class for PipeBroadcaster.
Definition
PipeMember.h:1092
RobotRaconteur::ServerContext
Context for services registered in a node for use by clients.
Definition
Service.h:253
RobotRaconteur::WireBroadcasterBase
Base class for WireBroadcaster.
Definition
WireMember.h:1472
Generated by
1.17.0