1
0
Fork 0

sender for bundles

This commit is contained in:
Kevin Matz 2023-05-15 11:28:53 -04:00
parent fdf801c962
commit 216a08f100
2 changed files with 19 additions and 0 deletions

View File

@ -23,6 +23,7 @@
*/
#include "sender.h"
#include "bundle.h"
namespace OSC {
@ -54,6 +55,21 @@ void Sender::send(std::shared_ptr<Message> msg) const
}
/**
* @brief Sender::send
* @param elements
* @param time
*/
void Sender::send(std::vector<std::shared_ptr<Message>> elements,
std::chrono::time_point<std::chrono::system_clock> time) const
{
auto msg = std::make_shared<Bundle>();
msg->time_tag.setTime(time);
msg->elements = elements;
send(msg);
}
/**
* @brief Sender::setSender
* @param cb

View File

@ -43,6 +43,9 @@ public:
virtual ~Sender();
void send(std::shared_ptr<Message>) const;
void send(std::vector<std::shared_ptr<Message>>,
std::chrono::time_point<std::chrono::system_clock>
= std::chrono::system_clock::now()) const;
std::shared_ptr<void> setSender(const std::function<void(std::shared_ptr<bufferstream>)>);