111 #include <string_view>
113 #include "../base/bytes.h"
184 bool operator>>(Bytes& bytes)
const noexcept;
191 [[nodiscard]] uint32_t control_id()
const noexcept;
198 [[nodiscard]] uint32_t mode()
const noexcept;
205 [[nodiscard]] int64_t timestamp()
const noexcept;
212 [[nodiscard]] int64_t seq()
const noexcept;
219 [[nodiscard]] uint32_t schema()
const noexcept;
226 [[nodiscard]] Bytes raw()
const noexcept;
233 [[nodiscard]] std::string_view url()
const noexcept;
240 [[nodiscard]] std::string_view ser()
const noexcept;
247 [[nodiscard]] std::string_view hostname()
const noexcept;
254 void set_control_id(uint32_t control_id) noexcept;
261 void set_mode(uint32_t mode) noexcept;
268 void set_timestamp(int64_t timestamp) noexcept;
275 void set_seq(int64_t seq) noexcept;
282 void set_schema(uint32_t schema) noexcept;
290 [[nodiscard]]
static bool check_valid(
const Bytes& bytes) noexcept;
309 [[nodiscard]]
bool is_valid()
const noexcept;
317 bool shallow_copy(
const ProxyData& target) noexcept;
325 bool deep_copy(
const ProxyData& target) noexcept;
333 bool move_copy(
ProxyData& target) noexcept;
350 void create(
const Bytes& raw, std::string_view url, std::string_view ser, uint32_t schema = 0,
351 std::string_view hostname = {}) noexcept;
356 void clear() noexcept;
363 [[nodiscard]]
size_t size()
const noexcept;
370 [[nodiscard]]
bool is_owner()
const noexcept;
377 [[nodiscard]] uint8_t& get_reserved() noexcept;
384 [[nodiscard]] uint16_t& get_reserved2() noexcept;
386 static constexpr
bool kZerocopyTypes{
true};
389 uint8_t* data_{
nullptr};
391 uint32_t control_id_{0};
393 int64_t timestamp_{0};
395 uint32_t data_pos_{0};
396 uint32_t data_size_{0};
397 uint32_t url_pos_{0};
398 uint32_t url_size_{0};
399 uint32_t ser_pos_{0};
400 uint32_t ser_size_{0};
401 uint32_t hostname_pos_{0};
402 uint32_t hostname_size_{0};
404 bool is_owner_{
false};
405 uint8_t reserved_buf_{0};
406 uint16_t reserved_buf2_{0};
408 static constexpr uint32_t kMagicNumberBegin{0x98B7F12A};
409 static constexpr uint32_t kMagicNumberEnd{0x98B7F12F};
constexpr bool is_valid() noexcept
Definition: name_detector.h:382
size_t get_serialized_size(const T &src) noexcept
Returns a serialised-size hint for src with explicit codec tag.
Definition: serializer-inl.h:298
VLINK_EXPORT std::ostream & operator<<(std::ostream &ostream, const BasePtr &status) noexcept
Writes the human-readable description of status to ostream.
struct VLINK_EXPORT_AND_ALIGNED(8) AudioFrame final
Definition: audio_frame.h:140
80-byte POD envelope packing payload, URL, serialisation type and host string.