Merge branch 'simulationCom' of ssh://dev-gitea.ftewa.ti.unibw-hamburg.de:12000/hwinkel/whisper-com into simulationCom

This commit is contained in:
Henry Winkel
2022-12-21 14:12:58 +01:00
8 changed files with 846 additions and 23 deletions

View File

@@ -61,6 +61,11 @@ add_library(whisper-com STATIC
src/WHISPER/Messages/Leave.cpp src/WHISPER/Messages/Leave.cpp
<<<<<<< HEAD
=======
# include/WHISPER/Messages/Track.hpp
# src/WHISPER/Messages/Track.cpp
>>>>>>> 1ae59dbf28dcff8e15f88de743522c6021f0e26f
@@ -70,6 +75,10 @@ add_library(whisper-com STATIC
include/WHISPER/Messages/Protos/join.pb.cc include/WHISPER/Messages/Protos/join.pb.cc
include/WHISPER/Messages/Protos/leave.pb.cc include/WHISPER/Messages/Protos/leave.pb.cc
<<<<<<< HEAD
=======
# include/WHISPER/Messages/Protos/raw_track.pb.cc
>>>>>>> 1ae59dbf28dcff8e15f88de743522c6021f0e26f
) )

View File

@@ -0,0 +1,709 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: raw_track.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_raw_5ftrack_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_raw_5ftrack_2eproto
#include <limits>
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3021000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/port_undef.inc>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
#include <google/protobuf/timestamp.pb.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
#define PROTOBUF_INTERNAL_EXPORT_raw_5ftrack_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_raw_5ftrack_2eproto {
static const uint32_t offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_raw_5ftrack_2eproto;
namespace messages {
namespace raw_track {
class RawTrack;
struct RawTrackDefaultTypeInternal;
extern RawTrackDefaultTypeInternal _RawTrack_default_instance_;
class RawTrack_DISEntityID;
struct RawTrack_DISEntityIDDefaultTypeInternal;
extern RawTrack_DISEntityIDDefaultTypeInternal _RawTrack_DISEntityID_default_instance_;
} // namespace raw_track
} // namespace messages
PROTOBUF_NAMESPACE_OPEN
template<> ::messages::raw_track::RawTrack* Arena::CreateMaybeMessage<::messages::raw_track::RawTrack>(Arena*);
template<> ::messages::raw_track::RawTrack_DISEntityID* Arena::CreateMaybeMessage<::messages::raw_track::RawTrack_DISEntityID>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace messages {
namespace raw_track {
// ===================================================================
class RawTrack_DISEntityID final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.raw_track.RawTrack.DISEntityID) */ {
public:
inline RawTrack_DISEntityID() : RawTrack_DISEntityID(nullptr) {}
~RawTrack_DISEntityID() override;
explicit PROTOBUF_CONSTEXPR RawTrack_DISEntityID(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
RawTrack_DISEntityID(const RawTrack_DISEntityID& from);
RawTrack_DISEntityID(RawTrack_DISEntityID&& from) noexcept
: RawTrack_DISEntityID() {
*this = ::std::move(from);
}
inline RawTrack_DISEntityID& operator=(const RawTrack_DISEntityID& from) {
CopyFrom(from);
return *this;
}
inline RawTrack_DISEntityID& operator=(RawTrack_DISEntityID&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const RawTrack_DISEntityID& default_instance() {
return *internal_default_instance();
}
static inline const RawTrack_DISEntityID* internal_default_instance() {
return reinterpret_cast<const RawTrack_DISEntityID*>(
&_RawTrack_DISEntityID_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(RawTrack_DISEntityID& a, RawTrack_DISEntityID& b) {
a.Swap(&b);
}
inline void Swap(RawTrack_DISEntityID* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(RawTrack_DISEntityID* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
RawTrack_DISEntityID* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<RawTrack_DISEntityID>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const RawTrack_DISEntityID& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const RawTrack_DISEntityID& from) {
RawTrack_DISEntityID::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(RawTrack_DISEntityID* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "messages.raw_track.RawTrack.DISEntityID";
}
protected:
explicit RawTrack_DISEntityID(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kSiteFieldNumber = 1,
kApplicationFieldNumber = 2,
kEntityFieldNumber = 3,
};
// uint32 site = 1;
void clear_site();
uint32_t site() const;
void set_site(uint32_t value);
private:
uint32_t _internal_site() const;
void _internal_set_site(uint32_t value);
public:
// uint32 application = 2;
void clear_application();
uint32_t application() const;
void set_application(uint32_t value);
private:
uint32_t _internal_application() const;
void _internal_set_application(uint32_t value);
public:
// uint32 entity = 3;
void clear_entity();
uint32_t entity() const;
void set_entity(uint32_t value);
private:
uint32_t _internal_entity() const;
void _internal_set_entity(uint32_t value);
public:
// @@protoc_insertion_point(class_scope:messages.raw_track.RawTrack.DISEntityID)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
uint32_t site_;
uint32_t application_;
uint32_t entity_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_raw_5ftrack_2eproto;
};
// -------------------------------------------------------------------
class RawTrack final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.raw_track.RawTrack) */ {
public:
inline RawTrack() : RawTrack(nullptr) {}
~RawTrack() override;
explicit PROTOBUF_CONSTEXPR RawTrack(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
RawTrack(const RawTrack& from);
RawTrack(RawTrack&& from) noexcept
: RawTrack() {
*this = ::std::move(from);
}
inline RawTrack& operator=(const RawTrack& from) {
CopyFrom(from);
return *this;
}
inline RawTrack& operator=(RawTrack&& from) noexcept {
if (this == &from) return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const RawTrack& default_instance() {
return *internal_default_instance();
}
static inline const RawTrack* internal_default_instance() {
return reinterpret_cast<const RawTrack*>(
&_RawTrack_default_instance_);
}
static constexpr int kIndexInFileMessages =
1;
friend void swap(RawTrack& a, RawTrack& b) {
a.Swap(&b);
}
inline void Swap(RawTrack* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(RawTrack* other) {
if (other == this) return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
RawTrack* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final {
return CreateMaybeMessage<RawTrack>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const RawTrack& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom( const RawTrack& from) {
RawTrack::MergeImpl(*this, from);
}
private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _impl_._cached_size_.Get(); }
private:
void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned);
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(RawTrack* other);
private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "messages.raw_track.RawTrack";
}
protected:
explicit RawTrack(::PROTOBUF_NAMESPACE_ID::Arena* arena,
bool is_message_owned = false);
public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final;
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
typedef RawTrack_DISEntityID DISEntityID;
// accessors -------------------------------------------------------
enum : int {
kEntityIDFieldNumber = 2,
kTimestampFieldNumber = 3,
kTrackNoFieldNumber = 1,
};
// .messages.raw_track.RawTrack.DISEntityID EntityID = 2;
bool has_entityid() const;
private:
bool _internal_has_entityid() const;
public:
void clear_entityid();
const ::messages::raw_track::RawTrack_DISEntityID& entityid() const;
PROTOBUF_NODISCARD ::messages::raw_track::RawTrack_DISEntityID* release_entityid();
::messages::raw_track::RawTrack_DISEntityID* mutable_entityid();
void set_allocated_entityid(::messages::raw_track::RawTrack_DISEntityID* entityid);
private:
const ::messages::raw_track::RawTrack_DISEntityID& _internal_entityid() const;
::messages::raw_track::RawTrack_DISEntityID* _internal_mutable_entityid();
public:
void unsafe_arena_set_allocated_entityid(
::messages::raw_track::RawTrack_DISEntityID* entityid);
::messages::raw_track::RawTrack_DISEntityID* unsafe_arena_release_entityid();
// .google.protobuf.Timestamp timestamp = 3;
bool has_timestamp() const;
private:
bool _internal_has_timestamp() const;
public:
void clear_timestamp();
const ::PROTOBUF_NAMESPACE_ID::Timestamp& timestamp() const;
PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::Timestamp* release_timestamp();
::PROTOBUF_NAMESPACE_ID::Timestamp* mutable_timestamp();
void set_allocated_timestamp(::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp);
private:
const ::PROTOBUF_NAMESPACE_ID::Timestamp& _internal_timestamp() const;
::PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_timestamp();
public:
void unsafe_arena_set_allocated_timestamp(
::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp);
::PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_timestamp();
// uint32 trackNo = 1;
void clear_trackno();
uint32_t trackno() const;
void set_trackno(uint32_t value);
private:
uint32_t _internal_trackno() const;
void _internal_set_trackno(uint32_t value);
public:
// @@protoc_insertion_point(class_scope:messages.raw_track.RawTrack)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
struct Impl_ {
::messages::raw_track::RawTrack_DISEntityID* entityid_;
::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp_;
uint32_t trackno_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
};
union { Impl_ _impl_; };
friend struct ::TableStruct_raw_5ftrack_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// RawTrack_DISEntityID
// uint32 site = 1;
inline void RawTrack_DISEntityID::clear_site() {
_impl_.site_ = 0u;
}
inline uint32_t RawTrack_DISEntityID::_internal_site() const {
return _impl_.site_;
}
inline uint32_t RawTrack_DISEntityID::site() const {
// @@protoc_insertion_point(field_get:messages.raw_track.RawTrack.DISEntityID.site)
return _internal_site();
}
inline void RawTrack_DISEntityID::_internal_set_site(uint32_t value) {
_impl_.site_ = value;
}
inline void RawTrack_DISEntityID::set_site(uint32_t value) {
_internal_set_site(value);
// @@protoc_insertion_point(field_set:messages.raw_track.RawTrack.DISEntityID.site)
}
// uint32 application = 2;
inline void RawTrack_DISEntityID::clear_application() {
_impl_.application_ = 0u;
}
inline uint32_t RawTrack_DISEntityID::_internal_application() const {
return _impl_.application_;
}
inline uint32_t RawTrack_DISEntityID::application() const {
// @@protoc_insertion_point(field_get:messages.raw_track.RawTrack.DISEntityID.application)
return _internal_application();
}
inline void RawTrack_DISEntityID::_internal_set_application(uint32_t value) {
_impl_.application_ = value;
}
inline void RawTrack_DISEntityID::set_application(uint32_t value) {
_internal_set_application(value);
// @@protoc_insertion_point(field_set:messages.raw_track.RawTrack.DISEntityID.application)
}
// uint32 entity = 3;
inline void RawTrack_DISEntityID::clear_entity() {
_impl_.entity_ = 0u;
}
inline uint32_t RawTrack_DISEntityID::_internal_entity() const {
return _impl_.entity_;
}
inline uint32_t RawTrack_DISEntityID::entity() const {
// @@protoc_insertion_point(field_get:messages.raw_track.RawTrack.DISEntityID.entity)
return _internal_entity();
}
inline void RawTrack_DISEntityID::_internal_set_entity(uint32_t value) {
_impl_.entity_ = value;
}
inline void RawTrack_DISEntityID::set_entity(uint32_t value) {
_internal_set_entity(value);
// @@protoc_insertion_point(field_set:messages.raw_track.RawTrack.DISEntityID.entity)
}
// -------------------------------------------------------------------
// RawTrack
// uint32 trackNo = 1;
inline void RawTrack::clear_trackno() {
_impl_.trackno_ = 0u;
}
inline uint32_t RawTrack::_internal_trackno() const {
return _impl_.trackno_;
}
inline uint32_t RawTrack::trackno() const {
// @@protoc_insertion_point(field_get:messages.raw_track.RawTrack.trackNo)
return _internal_trackno();
}
inline void RawTrack::_internal_set_trackno(uint32_t value) {
_impl_.trackno_ = value;
}
inline void RawTrack::set_trackno(uint32_t value) {
_internal_set_trackno(value);
// @@protoc_insertion_point(field_set:messages.raw_track.RawTrack.trackNo)
}
// .messages.raw_track.RawTrack.DISEntityID EntityID = 2;
inline bool RawTrack::_internal_has_entityid() const {
return this != internal_default_instance() && _impl_.entityid_ != nullptr;
}
inline bool RawTrack::has_entityid() const {
return _internal_has_entityid();
}
inline void RawTrack::clear_entityid() {
if (GetArenaForAllocation() == nullptr && _impl_.entityid_ != nullptr) {
delete _impl_.entityid_;
}
_impl_.entityid_ = nullptr;
}
inline const ::messages::raw_track::RawTrack_DISEntityID& RawTrack::_internal_entityid() const {
const ::messages::raw_track::RawTrack_DISEntityID* p = _impl_.entityid_;
return p != nullptr ? *p : reinterpret_cast<const ::messages::raw_track::RawTrack_DISEntityID&>(
::messages::raw_track::_RawTrack_DISEntityID_default_instance_);
}
inline const ::messages::raw_track::RawTrack_DISEntityID& RawTrack::entityid() const {
// @@protoc_insertion_point(field_get:messages.raw_track.RawTrack.EntityID)
return _internal_entityid();
}
inline void RawTrack::unsafe_arena_set_allocated_entityid(
::messages::raw_track::RawTrack_DISEntityID* entityid) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityid_);
}
_impl_.entityid_ = entityid;
if (entityid) {
} else {
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.raw_track.RawTrack.EntityID)
}
inline ::messages::raw_track::RawTrack_DISEntityID* RawTrack::release_entityid() {
::messages::raw_track::RawTrack_DISEntityID* temp = _impl_.entityid_;
_impl_.entityid_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
if (GetArenaForAllocation() == nullptr) { delete old; }
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::messages::raw_track::RawTrack_DISEntityID* RawTrack::unsafe_arena_release_entityid() {
// @@protoc_insertion_point(field_release:messages.raw_track.RawTrack.EntityID)
::messages::raw_track::RawTrack_DISEntityID* temp = _impl_.entityid_;
_impl_.entityid_ = nullptr;
return temp;
}
inline ::messages::raw_track::RawTrack_DISEntityID* RawTrack::_internal_mutable_entityid() {
if (_impl_.entityid_ == nullptr) {
auto* p = CreateMaybeMessage<::messages::raw_track::RawTrack_DISEntityID>(GetArenaForAllocation());
_impl_.entityid_ = p;
}
return _impl_.entityid_;
}
inline ::messages::raw_track::RawTrack_DISEntityID* RawTrack::mutable_entityid() {
::messages::raw_track::RawTrack_DISEntityID* _msg = _internal_mutable_entityid();
// @@protoc_insertion_point(field_mutable:messages.raw_track.RawTrack.EntityID)
return _msg;
}
inline void RawTrack::set_allocated_entityid(::messages::raw_track::RawTrack_DISEntityID* entityid) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete _impl_.entityid_;
}
if (entityid) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(entityid);
if (message_arena != submessage_arena) {
entityid = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, entityid, submessage_arena);
}
} else {
}
_impl_.entityid_ = entityid;
// @@protoc_insertion_point(field_set_allocated:messages.raw_track.RawTrack.EntityID)
}
// .google.protobuf.Timestamp timestamp = 3;
inline bool RawTrack::_internal_has_timestamp() const {
return this != internal_default_instance() && _impl_.timestamp_ != nullptr;
}
inline bool RawTrack::has_timestamp() const {
return _internal_has_timestamp();
}
inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& RawTrack::_internal_timestamp() const {
const ::PROTOBUF_NAMESPACE_ID::Timestamp* p = _impl_.timestamp_;
return p != nullptr ? *p : reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Timestamp&>(
::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_);
}
inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& RawTrack::timestamp() const {
// @@protoc_insertion_point(field_get:messages.raw_track.RawTrack.timestamp)
return _internal_timestamp();
}
inline void RawTrack::unsafe_arena_set_allocated_timestamp(
::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp) {
if (GetArenaForAllocation() == nullptr) {
delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.timestamp_);
}
_impl_.timestamp_ = timestamp;
if (timestamp) {
} else {
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.raw_track.RawTrack.timestamp)
}
inline ::PROTOBUF_NAMESPACE_ID::Timestamp* RawTrack::release_timestamp() {
::PROTOBUF_NAMESPACE_ID::Timestamp* temp = _impl_.timestamp_;
_impl_.timestamp_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp);
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
if (GetArenaForAllocation() == nullptr) { delete old; }
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArenaForAllocation() != nullptr) {
temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return temp;
}
inline ::PROTOBUF_NAMESPACE_ID::Timestamp* RawTrack::unsafe_arena_release_timestamp() {
// @@protoc_insertion_point(field_release:messages.raw_track.RawTrack.timestamp)
::PROTOBUF_NAMESPACE_ID::Timestamp* temp = _impl_.timestamp_;
_impl_.timestamp_ = nullptr;
return temp;
}
inline ::PROTOBUF_NAMESPACE_ID::Timestamp* RawTrack::_internal_mutable_timestamp() {
if (_impl_.timestamp_ == nullptr) {
auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Timestamp>(GetArenaForAllocation());
_impl_.timestamp_ = p;
}
return _impl_.timestamp_;
}
inline ::PROTOBUF_NAMESPACE_ID::Timestamp* RawTrack::mutable_timestamp() {
::PROTOBUF_NAMESPACE_ID::Timestamp* _msg = _internal_mutable_timestamp();
// @@protoc_insertion_point(field_mutable:messages.raw_track.RawTrack.timestamp)
return _msg;
}
inline void RawTrack::set_allocated_timestamp(::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp) {
::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
if (message_arena == nullptr) {
delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.timestamp_);
}
if (timestamp) {
::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(timestamp));
if (message_arena != submessage_arena) {
timestamp = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
message_arena, timestamp, submessage_arena);
}
} else {
}
_impl_.timestamp_ = timestamp;
// @@protoc_insertion_point(field_set_allocated:messages.raw_track.RawTrack.timestamp)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
} // namespace raw_track
} // namespace messages
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_raw_5ftrack_2eproto

View File

@@ -0,0 +1,23 @@
// [START declaration]
syntax = "proto3";
package messages.raw_track;
import "google/protobuf/timestamp.proto";
// [END declaration]
// [START messages]
message RawTrack {
uint32 trackNo = 1;
message DISEntityID {
uint32 site = 1;
uint32 application = 2;
uint32 entity = 3;
}
DISEntityID EntityID = 2;
google.protobuf.Timestamp timestamp = 3;
}

View File

@@ -0,0 +1,25 @@
#pragma once
#include "google/protobuf/message.h"
#include <WHISPER/Messages/Message.hpp>
#include <WHISPER/Messages/Protos/raw_track.pb.h>
#include <string>
#include <loguru.hpp>
namespace WHISPER {
class RawTrack : public Message
{
private:
messages::raw_track::RawTrack trackMessage;
public:
std::uint32_t trackNo;
RawTrack(std::string receivedMessage);
RawTrack(std::uint32_t deviceID,WHISPER::MsgTopics topic, SourceType src,std::uint32_t trackNo);
};
}

View File

@@ -16,23 +16,23 @@ namespace WHISPER {
msgType_ = msg.msgtype(); msgType_ = msg.msgtype();
joinMessage = messages::join::Join(); joinMessage = messages::join::Join();
deviceId_ = msg.sourceid(); deviceId_ = msg.sourceid();
if ( msg.payload_size()) { if ( msg.payload_size()) {
if (msg.payload().begin()->Is<messages::join::Join>()) { if (msg.payload().begin()->Is<messages::join::Join>()) {
msg.payload().begin()->UnpackTo(&joinMessage); msg.payload().begin()->UnpackTo(&joinMessage);
} }
} }
port = joinMessage.port(); port = joinMessage.port();
sourceAddr = joinMessage.srcaddress(); sourceAddr = joinMessage.srcaddress();
} catch (const std::exception& e) { } catch (const std::exception& e) {
LOG_S(ERROR)<<e.what(); LOG_S(ERROR)<<e.what();
} }
} }
WHISPER::Join::Join(std::uint32_t deviceID, SourceType src,std::uint32_t port, std::string addr): WHISPER::Join::Join(std::uint32_t deviceID, SourceType src,std::uint32_t port, std::string addr):
Message(deviceID,WHISPER::MsgTopics::MANAGEMENT,WHISPER::JOIN,src),port(port),sourceAddr(addr) Message(deviceID,WHISPER::MsgTopics::MANAGEMENT,WHISPER::JOIN,src),port(port),sourceAddr(addr)
@@ -44,11 +44,11 @@ namespace WHISPER {
auto payloadMessage = std::make_shared<google::protobuf::Any>(); auto payloadMessage = std::make_shared<google::protobuf::Any>();
payloadMessage->PackFrom(joinMessage); payloadMessage->PackFrom(joinMessage);
addPayLoad(payloadMessage); addPayLoad(payloadMessage);
} }
} }

View File

@@ -16,23 +16,23 @@ namespace WHISPER {
msgType_ = msg.msgtype(); msgType_ = msg.msgtype();
leaveMessage = messages::leave::Leave(); leaveMessage = messages::leave::Leave();
if ( msg.payload_size()) { if ( msg.payload_size()) {
if (msg.payload().begin()->Is<messages::leave::Leave>()) { if (msg.payload().begin()->Is<messages::leave::Leave>()) {
msg.payload().begin()->UnpackTo(&leaveMessage); msg.payload().begin()->UnpackTo(&leaveMessage);
} }
} }
port = leaveMessage.port(); port = leaveMessage.port();
sourceAddr = leaveMessage.srcaddress(); sourceAddr = leaveMessage.srcaddress();
} catch (const std::exception& e) { } catch (const std::exception& e) {
LOG_S(ERROR)<<e.what(); LOG_S(ERROR)<<e.what();
} }
} }
Leave::Leave(std::uint32_t deviceID, SourceType src,std::uint32_t port, std::string addr): Leave::Leave(std::uint32_t deviceID, SourceType src,std::uint32_t port, std::string addr):
Message(deviceID,WHISPER::MsgTopics::MANAGEMENT,WHISPER::LEAVE,src),port(port),sourceAddr(addr) Message(deviceID,WHISPER::MsgTopics::MANAGEMENT,WHISPER::LEAVE,src),port(port),sourceAddr(addr)
@@ -45,11 +45,11 @@ namespace WHISPER {
auto payloadMessage = std::make_shared<google::protobuf::Any>(); auto payloadMessage = std::make_shared<google::protobuf::Any>();
payloadMessage->PackFrom(leaveMessage); payloadMessage->PackFrom(leaveMessage);
addPayLoad(payloadMessage); addPayLoad(payloadMessage);
} }
} }

View File

@@ -22,16 +22,16 @@ namespace WHISPER {
} catch (const std::exception& e) { } catch (const std::exception& e) {
LOG_S(ERROR)<<e.what(); LOG_S(ERROR)<<e.what();
} }
} }
Message::Message(std::int32_t deviceId, MsgTopics topic, MsgType Type,SourceType src):topic_(topic),sourceType_(src),msgType_(Type){ Message::Message(std::int32_t deviceId, MsgTopics topic, MsgType Type,SourceType src):topic_(topic),sourceType_(src),msgType_(Type){
msg = messages::header::Message(); msg = messages::header::Message();
if(msg.IsInitialized()) if(msg.IsInitialized())
{ {
msg.set_sourceid(deviceId); msg.set_sourceid(deviceId);
msg.set_topic(topic); msg.set_topic(topic);
msg.set_sourcetype(sourceType_); msg.set_sourcetype(sourceType_);
@@ -44,24 +44,25 @@ namespace WHISPER {
} }
std::string Message::getPayloadString(){ std::string Message::getPayloadString(){
return payloadString_; return payloadString_;
} }
void Message::addPayLoad(std::shared_ptr<google::protobuf::Any> payload){ void Message::addPayLoad(std::shared_ptr<google::protobuf::Any> payload){
payload_ = payload; payload_ = payload;
msg.clear_payload();
msg.add_payload()->CopyFrom(*payload_); msg.add_payload()->CopyFrom(*payload_);
} }
std::string Message::serialize(){ std::string Message::serialize(){
std::string serializedMessage; std::string serializedMessage;
if (msg.IsInitialized()) { if (msg.IsInitialized()) {
serializedMessage = msg.SerializeAsString(); serializedMessage = msg.SerializeAsString();
@@ -69,5 +70,5 @@ namespace WHISPER {
return serializedMessage; return serializedMessage;
} }
} }

View File

@@ -0,0 +1,56 @@
#include "WHISPER/Messages/Message.hpp"
#include "WHISPER/Messages/Protos/raw_track.pb.h"
#include <WHISPER/Messages/Track.hpp>
#include <memory>
namespace WHISPER {
RawTrack::RawTrack(std::string receivedMessage){
msg = messages::header::Message();
try {
msg.ParseFromString(receivedMessage);
topic_ = msg.topic();
sourceType_ = msg.sourcetype();
msgType_ = msg.msgtype();
trackMessage = messages::raw_track::RawTrack();
if ( msg.payload_size()) {
if (msg.payload().begin()->Is<messages::raw_track::RawTrack>()) {
msg.payload().begin()->UnpackTo(&trackMessage);
}
}
trackNo = trackMessage.trackno();
} catch (const std::exception& e) {
LOG_S(ERROR)<<e.what();
}
}
RawTrack::RawTrack(std::uint32_t deviceID,WHISPER::MsgTopics topic, SourceType src,std::uint32_t trackNo):
Message(deviceID,WHISPER::MsgTopics::TRACK,WHISPER::RAW_TRACK,src),trackNo(trackNo)
{
trackMessage = messages::raw_track::RawTrack();
trackMessage.set_trackno(trackNo);
auto payloadMessage = std::make_shared<google::protobuf::Any>();
payloadMessage->PackFrom(trackMessage);
addPayLoad(payloadMessage);
}
}