become more constant
This commit is contained in:
parent
c4cf9768ab
commit
45cee71b19
|
@ -107,7 +107,7 @@ void Component::DmpReceiver(std::shared_ptr<ACN::PDU::Block<Pdu>> block)
|
|||
* @brief Component::sendMessage
|
||||
* @param message
|
||||
*/
|
||||
void Component::sendDMP(PDU::Message<DMP::Pdu> message)
|
||||
void Component::sendDMP(PDU::Message<DMP::Pdu> message) const
|
||||
{
|
||||
for( const auto & sender : dmp_senders_)
|
||||
sender(message);
|
||||
|
|
|
@ -40,9 +40,8 @@ Component::Component(UUID::uuid cid, std::string fctn, bool ipv4, bool ipv6)
|
|||
: ACN::Component(cid, fctn)
|
||||
, enable_IPv4(ipv4)
|
||||
, enable_IPv6(ipv6)
|
||||
, rlp_header_(std::make_shared<rlp_header>())
|
||||
{
|
||||
/// All RLP PDU generated by this component will referance the same header.
|
||||
rlp_header_ = std::make_shared<rlp_header>();
|
||||
rlp_header_->cid = cid;
|
||||
};
|
||||
|
||||
|
@ -51,7 +50,7 @@ Component::Component(UUID::uuid cid, std::string fctn, bool ipv4, bool ipv6)
|
|||
* @brief \cite epi17 EPI 17 payload receiver for UDP
|
||||
* @param stream
|
||||
*/
|
||||
void Component::UdpPayloadReceiver(PDU::Stream stream)
|
||||
void Component::UdpPayloadReceiver(PDU::Stream stream) const
|
||||
{
|
||||
/// Read the input stream as EPI 17 transported RLP
|
||||
auto transport = RLP::UDP::transport();
|
||||
|
@ -71,7 +70,7 @@ void Component::UdpPayloadReceiver(PDU::Stream stream)
|
|||
*/
|
||||
void Component::rlpSendUdp (const uint32_t vector,
|
||||
const PDU::Message<PDU::pdu_data> data,
|
||||
const SDT::UDP::ipAddress& ip)
|
||||
const SDT::UDP::ipAddress& ip) const
|
||||
{
|
||||
switch (ip.type) {
|
||||
case ACN::SDT::SDT_ADDR_IPV4:
|
||||
|
@ -111,7 +110,7 @@ void Component::rlpSendUdp (const uint32_t vector,
|
|||
* @brief \cite epi33 EPI 33 payload receiver for TCP
|
||||
* @param stream
|
||||
*/
|
||||
void Component::TcpPacketReceiver(PDU::Stream stream)
|
||||
void Component::TcpPacketReceiver(PDU::Stream stream) const
|
||||
{
|
||||
/// Read input stream as EPI 33 transported RLP
|
||||
auto transport = RLP::TCP::transport();
|
||||
|
@ -131,7 +130,7 @@ void Component::TcpPacketReceiver(PDU::Stream stream)
|
|||
*/
|
||||
void Component::rlpSendTcp (const uint32_t vector,
|
||||
const PDU::Message<PDU::pdu_data> data,
|
||||
const SDT::UDP::ipAddress& ip)
|
||||
const SDT::UDP::ipAddress& ip) const
|
||||
{
|
||||
switch (ip.type) {
|
||||
case ACN::SDT::SDT_ADDR_IPV4:
|
||||
|
@ -173,7 +172,7 @@ void Component::rlpSendTcp (const uint32_t vector,
|
|||
*
|
||||
* Dispatch a recieved RLP PDU to the appropriate vector handlers.
|
||||
*/
|
||||
void Component::RlpReceiver(PDU::Message<RLP::Pdu> root)
|
||||
void Component::RlpReceiver(PDU::Message<RLP::Pdu> root) const
|
||||
{
|
||||
/// To this point, the data segment of the RLP PDU will not have been read.
|
||||
/// The root PDU must have not failed, and still have bytes available to read.
|
||||
|
@ -186,7 +185,7 @@ void Component::RlpReceiver(PDU::Message<RLP::Pdu> root)
|
|||
|
||||
/// The root PDU is passed to every registered handler for the vector, in the
|
||||
/// order in which the handlers were registered.
|
||||
for(const auto &handler : rlp_vectors_[root->vector()])
|
||||
for(const auto &handler : rlp_vectors_.at(root->vector()))
|
||||
handler(root);
|
||||
}
|
||||
|
||||
|
@ -213,7 +212,7 @@ void Component::RlpRegisterVector(uint32_t vect, PDU::Handler<RLP::Pdu> handle)
|
|||
* The base class behavior is to do nothing.
|
||||
*/
|
||||
void Component::sendUDP(const PDU::Stream stream,
|
||||
const SDT::UDP::ipAddress& ip)
|
||||
const SDT::UDP::ipAddress& ip) const
|
||||
{
|
||||
(void)stream;
|
||||
(void)ip;
|
||||
|
@ -231,7 +230,7 @@ void Component::sendUDP(const PDU::Stream stream,
|
|||
* The base class behavior is to do nothing.
|
||||
*/
|
||||
void Component::sendTCP(const PDU::Stream stream,
|
||||
const SDT::UDP::ipAddress& ip)
|
||||
const SDT::UDP::ipAddress& ip) const
|
||||
{
|
||||
(void)stream;
|
||||
(void)ip;
|
||||
|
|
|
@ -64,21 +64,21 @@ public:
|
|||
bool isEnabledIPv6() const {return enable_IPv6;}
|
||||
|
||||
// EPI 17 - ACN RLP on UDP
|
||||
virtual void UdpPayloadReceiver(PDU::Stream);
|
||||
virtual void UdpPayloadReceiver(PDU::Stream) const;
|
||||
void rlpSendUdp(const uint32_t vector, const PDU::Message<PDU::pdu_data> data,
|
||||
const SDT::UDP::ipAddress&);
|
||||
const SDT::UDP::ipAddress&) const;
|
||||
|
||||
// EPI 33 - ACN RLP Operation on TCP
|
||||
virtual void TcpPacketReceiver(PDU::Stream);
|
||||
virtual void TcpPacketReceiver(PDU::Stream) const;
|
||||
void rlpSendTcp(const uint32_t vector, const PDU::Message<PDU::pdu_data> data,
|
||||
const SDT::UDP::ipAddress&);
|
||||
const SDT::UDP::ipAddress&) const;
|
||||
|
||||
protected:
|
||||
void RlpReceiver(PDU::Message<RLP::Pdu>);
|
||||
void RlpReceiver(PDU::Message<RLP::Pdu>) const;
|
||||
void RlpRegisterVector(uint32_t, PDU::Handler<RLP::Pdu>);
|
||||
|
||||
virtual void sendUDP(const PDU::Stream, const SDT::UDP::ipAddress&);
|
||||
virtual void sendTCP(const PDU::Stream, const SDT::UDP::ipAddress&);
|
||||
virtual void sendUDP(const PDU::Stream, const SDT::UDP::ipAddress&) const;
|
||||
virtual void sendTCP(const PDU::Stream, const SDT::UDP::ipAddress&) const;
|
||||
|
||||
bool enable_IPv4; //!< enable rx/tx with IPv4
|
||||
bool enable_IPv6; //!< enable rx/tx with IPv6
|
||||
|
|
|
@ -206,7 +206,8 @@ void Receiver::extendedReceiver(ACN::PDU::Message<ACN::RLP::Pdu> root)
|
|||
* Merging will be based on frame header. PDU data will be read as a block of
|
||||
* DMP PDUs and passed to the universe.
|
||||
*/
|
||||
void Receiver::dataFrameHandler(ACN::PDU::Message<DATA::Pdu> frame) {
|
||||
void Receiver::dataFrameHandler(ACN::PDU::Message<DATA::Pdu> frame)
|
||||
{
|
||||
#ifdef RTTI_ENABLED
|
||||
auto metadata = std::dynamic_pointer_cast<DATA::data_header>(frame->header());
|
||||
#else
|
||||
|
|
|
@ -92,7 +92,7 @@ void Source::terminate(const uint16_t num)
|
|||
void Source::sendExtendedFrame(const uint16_t vector,
|
||||
std::shared_ptr<ACN::PDU::pdu_header> header,
|
||||
std::shared_ptr<ACN::PDU::pdu_data> data,
|
||||
const ACN::SDT::UDP::ipAddress& ip)
|
||||
const ACN::SDT::UDP::ipAddress& ip) const
|
||||
{
|
||||
if (!(vector == VECTOR_E131_EXTENDED_DISCOVERY ||
|
||||
vector == VECTOR_E131_EXTENDED_SYNCHRONIZATION))
|
||||
|
|
|
@ -62,7 +62,7 @@ protected:
|
|||
void sendExtendedFrame(const uint16_t vector,
|
||||
std::shared_ptr<ACN::PDU::pdu_header> header,
|
||||
std::shared_ptr<ACN::PDU::pdu_data> data,
|
||||
const ACN::SDT::UDP::ipAddress&);
|
||||
const ACN::SDT::UDP::ipAddress&) const;
|
||||
|
||||
private:
|
||||
std::unordered_map <uint16_t, std::shared_ptr<Universe>> universes_;
|
||||
|
|
|
@ -89,7 +89,7 @@ UniverseSender::~UniverseSender()
|
|||
* @brief UniverseSender::isSending
|
||||
* @return
|
||||
*/
|
||||
bool UniverseSender::isSending()
|
||||
bool UniverseSender::isSending() const
|
||||
{
|
||||
std::shared_lock lk_ctl(mtx_control);
|
||||
return (worker_.joinable());
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
UniverseSender(Source*, Universe *);
|
||||
~UniverseSender();
|
||||
|
||||
bool isSending();
|
||||
bool isSending() const;
|
||||
|
||||
void flush();
|
||||
void kill();
|
||||
|
|
Loading…
Reference in New Issue