132 #include <string_view>
134 #include "../base/bytes.h"
155 enum MotionState : uint8_t {
157 kMotionStationary = 1,
166 enum SourceType : uint8_t {
172 kSourceUltrasonic = 5,
193 float position[3]{0};
197 float velocity[3]{0};
199 float acceleration[3]{0};
200 float existence_probability{0};
201 float position_covariance[6]{0};
202 uint32_t class_id{0};
203 uint32_t track_id{0};
205 uint32_t num_observations{0};
206 MotionState motion_state{kMotionUnknown};
207 SourceType source_type{kSourceUnknown};
208 uint16_t subtype_id{0};
209 uint32_t reserved_buf{0};
258 bool operator<<(const Bytes& bytes) noexcept;
266 bool operator>>(Bytes& bytes) const noexcept;
274 [[nodiscard]] static
bool check_valid(const Bytes& bytes) noexcept;
289 [[nodiscard]]
bool is_valid() const noexcept;
297 bool shallow_copy(const
ObjectArray& target) noexcept;
305 bool deep_copy(const
ObjectArray& target) noexcept;
321 bool create(
size_t count) noexcept;
326 void clear() noexcept;
334 bool push_value(const
Object&
object) noexcept;
343 bool set_value(uint32_t index, const
Object&
object) noexcept;
352 bool get_value(uint32_t index,
Object&
object) const noexcept;
360 [[nodiscard]]
Object get_value(uint32_t index) const noexcept;
368 bool resize(uint32_t count) noexcept;
375 [[nodiscard]] uint64_t update_time_ns() const noexcept;
382 [[nodiscard]] std::string_view source_id() const noexcept;
389 [[nodiscard]] uint32_t channel() const noexcept;
396 [[nodiscard]] uint32_t freq() const noexcept;
403 [[nodiscard]] uint32_t count() const noexcept;
410 [[nodiscard]] uint32_t pack_size() const noexcept;
418 [[nodiscard]] const
Object* objects(uint32_t index = 0) const noexcept;
425 [[nodiscard]] const uint8_t* data() const noexcept;
432 [[nodiscard]]
size_t capacity() const noexcept;
439 [[nodiscard]]
bool is_owner() const noexcept;
446 void set_update_time_ns(uint64_t update_time_ns) noexcept;
453 void set_source_id(std::string_view source_id) noexcept;
460 void set_channel(uint32_t channel) noexcept;
467 void set_freq(uint32_t freq) noexcept;
474 uint8_t& get_reserved() noexcept {
return reserved_buf_; }
481 uint16_t& get_reserved2() noexcept {
return reserved_buf2_; }
488 uint32_t& get_reserved3() noexcept {
return reserved_buf3_; }
495 uint32_t& get_reserved4() noexcept {
return reserved_buf4_; }
502 uint32_t& get_reserved5() noexcept {
return reserved_buf5_; }
506 static constexpr
bool kZerocopyTypes{
true};
509 uint8_t* data_{
nullptr};
511 uint64_t update_time_ns_{0};
512 char source_id_[16]{0};
513 uint32_t channel_{0};
516 uint32_t pack_size_{0};
517 bool is_owner_{
false};
518 uint8_t reserved_buf_{0};
519 uint16_t reserved_buf2_{0};
520 uint32_t reserved_buf3_{0};
521 uint32_t reserved_buf4_{0};
522 uint32_t reserved_buf5_{0};
524 static constexpr uint32_t kMagicNumberBegin{0x98B7F18A};
525 static constexpr uint32_t kMagicNumberEnd{0x98B7F18F};
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
struct VLINK_EXPORT_AND_ALIGNED(8) AudioFrame final
Definition: audio_frame.h:140
112-byte POD container holding a packed array of 144-byte Object records.
Definition: object_array.h:151