39 std::variant<Message, std::unique_ptr<Bundle>>
content;
53 bool is_bundle()
const {
return std::holds_alternative<std::unique_ptr<Bundle>>(
content); }
66 elements.emplace_back(std::move(msg));
71 elements.emplace_back(std::make_unique<Bundle>(std::move(nested)));
78 static std::optional<Bundle>
deserialize(
const uint8_t* data,
size_t size);
bool address_matches(std::string_view pattern, std::string_view address)
OSC address pattern matching per OSC 1.0 spec.
const Message & message() const
Definition bundle.hpp:55
BundleElement(std::unique_ptr< Bundle > b)
Construct from a nested bundle (takes ownership).
Definition bundle.hpp:47
std::variant< Message, std::unique_ptr< Bundle > > content
Definition bundle.hpp:39
bool is_bundle() const
Definition bundle.hpp:53
BundleElement(Message msg)
Construct from a message.
Definition bundle.hpp:44
bool is_message() const
Definition bundle.hpp:52
const Bundle & bundle() const
Definition bundle.hpp:56
OSC Bundle — contains a timetag and a list of elements.
Definition bundle.hpp:60
TimeTag timetag
Definition bundle.hpp:61
std::vector< uint8_t > serialize() const
Serialize to OSC binary format.
void add(Bundle nested)
Add a nested bundle.
Definition bundle.hpp:70
static std::optional< Bundle > deserialize(const uint8_t *data, size_t size)
Deserialize from OSC binary.
std::vector< BundleElement > elements
Definition bundle.hpp:62
void add(Message msg)
Add a message to the bundle.
Definition bundle.hpp:65