diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c3b893..5b278c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,21 +27,34 @@ protobuf_generate_cpp(PROTO_PATH include/SimCore/Messages/Protos CPP_PATH inclu add_library(SimCore STATIC - include/SimCore/Entity.hpp - src/SimCore/Entity.cpp - + include/SimCore/Messages/Track.hpp src/SimCore/Messages/Track.cpp include/SimCore/Messages/RadarTrack.hpp src/SimCore/Messages/RadarTrack.cpp + include/SimCore/Messages/ESMTrack.hpp + src/SimCore/Messages/ESMTrack.cpp + + include/SimCore/Messages/SensorTrack.hpp + src/SimCore/Messages/SensorTrack.cpp include/SimCore/Messages/Protos/Track.pb.cc include/SimCore/Messages/Protos/GeocentricPosition.pb.cc include/SimCore/Messages/Protos/Identifier.pb.cc include/SimCore/Messages/Protos/RadarTrack.pb.cc + include/SimCore/Messages/Protos/ESMTrack.pb.cc + include/SimCore/Messages/Protos/ESMData.pb.cc + + + include/SimCore/Messages/Protos/SensorTrack.pb.cc + + include/SimCore/Messages/Protos/GroundTruthTrack.pb.cc + + include/SimCore/Messages/GroundThruthTrack.hpp + src/SimCore/Messages/GroundThruthTrack.cpp include/SimCore/Position.hpp src/SimCore/Position.cpp @@ -58,9 +71,14 @@ add_library(SimCore STATIC include/SimCore/UtilFunctions.hpp src/SimCore/UtilFunctions.cpp - include/SimCore/Sensor.hpp - src/SimCore/Sensor.cpp -) + include/SimCore/Templates/Sensor.hpp + src/SimCore/Templates/Sensor.cpp + + include/SimCore/Templates/Entity.hpp + src/SimCore/Templates/Entity.cpp + + ) + target_link_libraries(SimCore whisper-com @@ -107,9 +125,9 @@ IF (${TEST_SIMCORE_LIBRARY}) target_link_libraries(test_PositionClass Catch2::Catch2 SimCore eigen loguru) catch_discover_tests(test_PositionClass) - add_executable(test_TrackClass tests/test_TrackClass.cpp) - target_link_libraries(test_TrackClass Catch2::Catch2 SimCore eigen loguru) - catch_discover_tests(test_TrackClass) + add_executable(test_GroundTruthTrackClass tests/test_GroundTruthTrackClass.cpp) + target_link_libraries(test_GroundTruthTrackClass Catch2::Catch2 SimCore eigen loguru) + catch_discover_tests(test_GroundTruthTrackClass) add_executable(test_RadarTrackClass tests/test_RadarTrackClass.cpp) target_link_libraries(test_RadarTrackClass Catch2::Catch2 SimCore loguru) @@ -136,6 +154,13 @@ IF (${TEST_SIMCORE_LIBRARY}) target_link_libraries(test_SensorClass Catch2::Catch2 SimCore loguru) catch_discover_tests(test_SensorClass) + add_executable(test_EntityClass tests/test_EntityClass.cpp) + target_link_libraries(test_EntityClass Catch2::Catch2 SimCore loguru) + catch_discover_tests(test_EntityClass) + + add_executable(test_Trackstore tests/test_Trackstore.cpp) + target_link_libraries(test_Trackstore Catch2::Catch2 SimCore loguru) + catch_discover_tests(test_SensorClass) ENDIF() diff --git a/graphics/systemdesign/entity.drawio b/graphics/systemdesign/entity.drawio new file mode 100644 index 0000000..11e4627 --- /dev/null +++ b/graphics/systemdesign/entity.drawio @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/graphics/systemdesign/trackMessage.drawio b/graphics/systemdesign/trackMessage.drawio new file mode 100644 index 0000000..f130f4f --- /dev/null +++ b/graphics/systemdesign/trackMessage.drawio @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/include/SimCore/Entity.hpp b/include/SimCore/Entity.hpp deleted file mode 100644 index 7210fde..0000000 --- a/include/SimCore/Entity.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - - - -#include -namespace SimCore { - - class Entity { - public: - Entity(); - - - - private: - Position position_; - - }; -} \ No newline at end of file diff --git a/include/SimCore/Identifier.hpp b/include/SimCore/Identifier.hpp index 69c25fb..8abb1ca 100644 --- a/include/SimCore/Identifier.hpp +++ b/include/SimCore/Identifier.hpp @@ -30,19 +30,19 @@ namespace SimCore { * @brief returns the number of the object, this plus the number of the parent make it unique * @return uint32_t */ - std::uint32_t getNumber(); + std::uint32_t getNumber() const; /** * @brief return the number of the parent, if 0 the parent is the Sim Manager * @return uint32_t */ - std::uint32_t getParentNumber(); + std::uint32_t getParentNumber() const; /** * @brief returns true if the ID belongs to an external ofject * @return bool */ - bool isExternal(); + bool isExternal() const; /** * @brief return true if the number is bigger than 0 diff --git a/include/SimCore/Messages/ESMTrack.hpp b/include/SimCore/Messages/ESMTrack.hpp index e69de29..d66e54d 100644 --- a/include/SimCore/Messages/ESMTrack.hpp +++ b/include/SimCore/Messages/ESMTrack.hpp @@ -0,0 +1,29 @@ +#pragma once + + + +#include +#include +#include + + +namespace SimCore +{ + class ESMTrack : public Track + { + private: + + + + + public: + ESMTrack(WHISPER::SourceType src,SimCore::Identifier id); + + static ESMTrack unpack(WHISPER::Message msg); + + virtual WHISPER::Message buildMessage(SimCore::Identifier parentID) override; + + + }; + +} \ No newline at end of file diff --git a/include/SimCore/Messages/GroundThruthTrack.hpp b/include/SimCore/Messages/GroundThruthTrack.hpp new file mode 100644 index 0000000..4edc074 --- /dev/null +++ b/include/SimCore/Messages/GroundThruthTrack.hpp @@ -0,0 +1,79 @@ +#pragma once + + + + +#include "WHISPER/Messages/Message.hpp" +#include +namespace SimCore +{ + class GroundTruthTrack : public Track + { + public: + GroundTruthTrack(WHISPER::SourceType src,SimCore::Identifier id,SimCore::TrackKind kind); + + virtual WHISPER::Message buildMessage(SimCore::Identifier parentID) override; + + /// set course + void setEnvironment(SimCore::EntityKind); + + /// returns course + SimCore::EntityKind getEnvironment(); + + + /** + * @brief set the position of the track + * @param Position object of the position class + * + */ + void setPosition(Position pos); + + /** + * @brief set the position of the track + * @param 3x double set the x,y,z coordinates direkt which causes that an + * object of position class is created + */ + void setPosition(double x, double y, double z); + + /** + * @brief returns the position + * @return object of position class + * + */ + Position getPostion(); + + /// sets speed + void setSpeed(double speed); + + /// set speed in knots + void setSpeedinKnots(double knots); + + /// return sspeed + double getSpeed(); + + /// returns speed as knots + double getSpeedinKnots(); + + /// set course + void setCourse(double course); + + /// returns course + double getCourse(); + + static GroundTruthTrack unpack(WHISPER::Message msg); + + private: + //environment (AIR,SURFACE,SUBSURFACE,SPACE) + SimCore::EntityKind environemnt_; + /// position of the track + Position position_; + /// speed the track + double speed_ = 0; + /// course of the track + double course_ = 0; + + + + + }; +} \ No newline at end of file diff --git a/include/SimCore/Messages/Protos/ESMData.pb.cc b/include/SimCore/Messages/Protos/ESMData.pb.cc new file mode 100644 index 0000000..591c230 --- /dev/null +++ b/include/SimCore/Messages/Protos/ESMData.pb.cc @@ -0,0 +1,371 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ESMData.proto + +#include "ESMData.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace messages { +namespace track { +PROTOBUF_CONSTEXPR ESMData::ESMData( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.frequency_)*/0 + , /*decltype(_impl_.pulserepetitionfrequency_)*/0 + , /*decltype(_impl_.pulsewidth_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ESMDataDefaultTypeInternal { + PROTOBUF_CONSTEXPR ESMDataDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ESMDataDefaultTypeInternal() {} + union { + ESMData _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ESMDataDefaultTypeInternal _ESMData_default_instance_; +} // namespace track +} // namespace messages +static ::_pb::Metadata file_level_metadata_ESMData_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_ESMData_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_ESMData_2eproto = nullptr; + +const uint32_t TableStruct_ESMData_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::messages::track::ESMData, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::messages::track::ESMData, _impl_.frequency_), + PROTOBUF_FIELD_OFFSET(::messages::track::ESMData, _impl_.pulserepetitionfrequency_), + PROTOBUF_FIELD_OFFSET(::messages::track::ESMData, _impl_.pulsewidth_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::messages::track::ESMData)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::messages::track::_ESMData_default_instance_._instance, +}; + +const char descriptor_table_protodef_ESMData_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\rESMData.proto\022\016messages.track\"R\n\007ESMDa" + "ta\022\021\n\tFrequency\030\001 \001(\001\022 \n\030PulseRepetition" + "Frequency\030\002 \001(\001\022\022\n\nPulseWidth\030\003 \001(\001b\006pro" + "to3" + ; +static ::_pbi::once_flag descriptor_table_ESMData_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_ESMData_2eproto = { + false, false, 123, descriptor_table_protodef_ESMData_2eproto, + "ESMData.proto", + &descriptor_table_ESMData_2eproto_once, nullptr, 0, 1, + schemas, file_default_instances, TableStruct_ESMData_2eproto::offsets, + file_level_metadata_ESMData_2eproto, file_level_enum_descriptors_ESMData_2eproto, + file_level_service_descriptors_ESMData_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_ESMData_2eproto_getter() { + return &descriptor_table_ESMData_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_ESMData_2eproto(&descriptor_table_ESMData_2eproto); +namespace messages { +namespace track { + +// =================================================================== + +class ESMData::_Internal { + public: +}; + +ESMData::ESMData(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:messages.track.ESMData) +} +ESMData::ESMData(const ESMData& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ESMData* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.frequency_){} + , decltype(_impl_.pulserepetitionfrequency_){} + , decltype(_impl_.pulsewidth_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.frequency_, &from._impl_.frequency_, + static_cast(reinterpret_cast(&_impl_.pulsewidth_) - + reinterpret_cast(&_impl_.frequency_)) + sizeof(_impl_.pulsewidth_)); + // @@protoc_insertion_point(copy_constructor:messages.track.ESMData) +} + +inline void ESMData::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.frequency_){0} + , decltype(_impl_.pulserepetitionfrequency_){0} + , decltype(_impl_.pulsewidth_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +ESMData::~ESMData() { + // @@protoc_insertion_point(destructor:messages.track.ESMData) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ESMData::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void ESMData::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ESMData::Clear() { +// @@protoc_insertion_point(message_clear_start:messages.track.ESMData) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.frequency_, 0, static_cast( + reinterpret_cast(&_impl_.pulsewidth_) - + reinterpret_cast(&_impl_.frequency_)) + sizeof(_impl_.pulsewidth_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ESMData::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // double Frequency = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 9)) { + _impl_.frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // double PulseRepetitionFrequency = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 17)) { + _impl_.pulserepetitionfrequency_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // double PulseWidth = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 25)) { + _impl_.pulsewidth_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ESMData::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:messages.track.ESMData) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // double Frequency = 1; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_frequency = this->_internal_frequency(); + uint64_t raw_frequency; + memcpy(&raw_frequency, &tmp_frequency, sizeof(tmp_frequency)); + if (raw_frequency != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(1, this->_internal_frequency(), target); + } + + // double PulseRepetitionFrequency = 2; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_pulserepetitionfrequency = this->_internal_pulserepetitionfrequency(); + uint64_t raw_pulserepetitionfrequency; + memcpy(&raw_pulserepetitionfrequency, &tmp_pulserepetitionfrequency, sizeof(tmp_pulserepetitionfrequency)); + if (raw_pulserepetitionfrequency != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(2, this->_internal_pulserepetitionfrequency(), target); + } + + // double PulseWidth = 3; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_pulsewidth = this->_internal_pulsewidth(); + uint64_t raw_pulsewidth; + memcpy(&raw_pulsewidth, &tmp_pulsewidth, sizeof(tmp_pulsewidth)); + if (raw_pulsewidth != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(3, this->_internal_pulsewidth(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:messages.track.ESMData) + return target; +} + +size_t ESMData::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:messages.track.ESMData) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // double Frequency = 1; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_frequency = this->_internal_frequency(); + uint64_t raw_frequency; + memcpy(&raw_frequency, &tmp_frequency, sizeof(tmp_frequency)); + if (raw_frequency != 0) { + total_size += 1 + 8; + } + + // double PulseRepetitionFrequency = 2; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_pulserepetitionfrequency = this->_internal_pulserepetitionfrequency(); + uint64_t raw_pulserepetitionfrequency; + memcpy(&raw_pulserepetitionfrequency, &tmp_pulserepetitionfrequency, sizeof(tmp_pulserepetitionfrequency)); + if (raw_pulserepetitionfrequency != 0) { + total_size += 1 + 8; + } + + // double PulseWidth = 3; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_pulsewidth = this->_internal_pulsewidth(); + uint64_t raw_pulsewidth; + memcpy(&raw_pulsewidth, &tmp_pulsewidth, sizeof(tmp_pulsewidth)); + if (raw_pulsewidth != 0) { + total_size += 1 + 8; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ESMData::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ESMData::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ESMData::GetClassData() const { return &_class_data_; } + + +void ESMData::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:messages.track.ESMData) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_frequency = from._internal_frequency(); + uint64_t raw_frequency; + memcpy(&raw_frequency, &tmp_frequency, sizeof(tmp_frequency)); + if (raw_frequency != 0) { + _this->_internal_set_frequency(from._internal_frequency()); + } + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_pulserepetitionfrequency = from._internal_pulserepetitionfrequency(); + uint64_t raw_pulserepetitionfrequency; + memcpy(&raw_pulserepetitionfrequency, &tmp_pulserepetitionfrequency, sizeof(tmp_pulserepetitionfrequency)); + if (raw_pulserepetitionfrequency != 0) { + _this->_internal_set_pulserepetitionfrequency(from._internal_pulserepetitionfrequency()); + } + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_pulsewidth = from._internal_pulsewidth(); + uint64_t raw_pulsewidth; + memcpy(&raw_pulsewidth, &tmp_pulsewidth, sizeof(tmp_pulsewidth)); + if (raw_pulsewidth != 0) { + _this->_internal_set_pulsewidth(from._internal_pulsewidth()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ESMData::CopyFrom(const ESMData& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:messages.track.ESMData) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ESMData::IsInitialized() const { + return true; +} + +void ESMData::InternalSwap(ESMData* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ESMData, _impl_.pulsewidth_) + + sizeof(ESMData::_impl_.pulsewidth_) + - PROTOBUF_FIELD_OFFSET(ESMData, _impl_.frequency_)>( + reinterpret_cast(&_impl_.frequency_), + reinterpret_cast(&other->_impl_.frequency_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ESMData::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_ESMData_2eproto_getter, &descriptor_table_ESMData_2eproto_once, + file_level_metadata_ESMData_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::messages::track::ESMData* +Arena::CreateMaybeMessage< ::messages::track::ESMData >(Arena* arena) { + return Arena::CreateMessageInternal< ::messages::track::ESMData >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/include/SimCore/Messages/Protos/ESMData.pb.h b/include/SimCore/Messages/Protos/ESMData.pb.h new file mode 100644 index 0000000..28b330f --- /dev/null +++ b/include/SimCore/Messages/Protos/ESMData.pb.h @@ -0,0 +1,313 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ESMData.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_ESMData_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_ESMData_2eproto + +#include +#include + +#include +#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 +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_ESMData_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_ESMData_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ESMData_2eproto; +namespace messages { +namespace track { +class ESMData; +struct ESMDataDefaultTypeInternal; +extern ESMDataDefaultTypeInternal _ESMData_default_instance_; +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> ::messages::track::ESMData* Arena::CreateMaybeMessage<::messages::track::ESMData>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace messages { +namespace track { + +// =================================================================== + +class ESMData final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.track.ESMData) */ { + public: + inline ESMData() : ESMData(nullptr) {} + ~ESMData() override; + explicit PROTOBUF_CONSTEXPR ESMData(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ESMData(const ESMData& from); + ESMData(ESMData&& from) noexcept + : ESMData() { + *this = ::std::move(from); + } + + inline ESMData& operator=(const ESMData& from) { + CopyFrom(from); + return *this; + } + inline ESMData& operator=(ESMData&& 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 ESMData& default_instance() { + return *internal_default_instance(); + } + static inline const ESMData* internal_default_instance() { + return reinterpret_cast( + &_ESMData_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(ESMData& a, ESMData& b) { + a.Swap(&b); + } + inline void Swap(ESMData* 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(ESMData* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ESMData* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ESMData& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ESMData& from) { + ESMData::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(ESMData* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "messages.track.ESMData"; + } + protected: + explicit ESMData(::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 { + kFrequencyFieldNumber = 1, + kPulseRepetitionFrequencyFieldNumber = 2, + kPulseWidthFieldNumber = 3, + }; + // double Frequency = 1; + void clear_frequency(); + double frequency() const; + void set_frequency(double value); + private: + double _internal_frequency() const; + void _internal_set_frequency(double value); + public: + + // double PulseRepetitionFrequency = 2; + void clear_pulserepetitionfrequency(); + double pulserepetitionfrequency() const; + void set_pulserepetitionfrequency(double value); + private: + double _internal_pulserepetitionfrequency() const; + void _internal_set_pulserepetitionfrequency(double value); + public: + + // double PulseWidth = 3; + void clear_pulsewidth(); + double pulsewidth() const; + void set_pulsewidth(double value); + private: + double _internal_pulsewidth() const; + void _internal_set_pulsewidth(double value); + public: + + // @@protoc_insertion_point(class_scope:messages.track.ESMData) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + double frequency_; + double pulserepetitionfrequency_; + double pulsewidth_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_ESMData_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ESMData + +// double Frequency = 1; +inline void ESMData::clear_frequency() { + _impl_.frequency_ = 0; +} +inline double ESMData::_internal_frequency() const { + return _impl_.frequency_; +} +inline double ESMData::frequency() const { + // @@protoc_insertion_point(field_get:messages.track.ESMData.Frequency) + return _internal_frequency(); +} +inline void ESMData::_internal_set_frequency(double value) { + + _impl_.frequency_ = value; +} +inline void ESMData::set_frequency(double value) { + _internal_set_frequency(value); + // @@protoc_insertion_point(field_set:messages.track.ESMData.Frequency) +} + +// double PulseRepetitionFrequency = 2; +inline void ESMData::clear_pulserepetitionfrequency() { + _impl_.pulserepetitionfrequency_ = 0; +} +inline double ESMData::_internal_pulserepetitionfrequency() const { + return _impl_.pulserepetitionfrequency_; +} +inline double ESMData::pulserepetitionfrequency() const { + // @@protoc_insertion_point(field_get:messages.track.ESMData.PulseRepetitionFrequency) + return _internal_pulserepetitionfrequency(); +} +inline void ESMData::_internal_set_pulserepetitionfrequency(double value) { + + _impl_.pulserepetitionfrequency_ = value; +} +inline void ESMData::set_pulserepetitionfrequency(double value) { + _internal_set_pulserepetitionfrequency(value); + // @@protoc_insertion_point(field_set:messages.track.ESMData.PulseRepetitionFrequency) +} + +// double PulseWidth = 3; +inline void ESMData::clear_pulsewidth() { + _impl_.pulsewidth_ = 0; +} +inline double ESMData::_internal_pulsewidth() const { + return _impl_.pulsewidth_; +} +inline double ESMData::pulsewidth() const { + // @@protoc_insertion_point(field_get:messages.track.ESMData.PulseWidth) + return _internal_pulsewidth(); +} +inline void ESMData::_internal_set_pulsewidth(double value) { + + _impl_.pulsewidth_ = value; +} +inline void ESMData::set_pulsewidth(double value) { + _internal_set_pulsewidth(value); + // @@protoc_insertion_point(field_set:messages.track.ESMData.PulseWidth) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace track +} // namespace messages + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_ESMData_2eproto diff --git a/include/SimCore/Messages/Protos/ESMData.proto b/include/SimCore/Messages/Protos/ESMData.proto new file mode 100644 index 0000000..faabdc7 --- /dev/null +++ b/include/SimCore/Messages/Protos/ESMData.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package messages.track; + + + + +message ESMData { + + double Frequency = 1; + double PulseRepetitionFrequency = 2; + double PulseWidth = 3; +} \ No newline at end of file diff --git a/include/SimCore/Messages/Protos/ESMTrack.pb.cc b/include/SimCore/Messages/Protos/ESMTrack.pb.cc new file mode 100644 index 0000000..3a4463c --- /dev/null +++ b/include/SimCore/Messages/Protos/ESMTrack.pb.cc @@ -0,0 +1,503 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ESMTrack.proto + +#include "ESMTrack.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace messages { +namespace track { +PROTOBUF_CONSTEXPR ESMTrack::ESMTrack( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.esmsensorid_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.entityidentifier_)*/nullptr + , /*decltype(_impl_.esmdata_)*/nullptr + , /*decltype(_impl_.timestamp_)*/nullptr + , /*decltype(_impl_.contactbearing_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct ESMTrackDefaultTypeInternal { + PROTOBUF_CONSTEXPR ESMTrackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~ESMTrackDefaultTypeInternal() {} + union { + ESMTrack _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ESMTrackDefaultTypeInternal _ESMTrack_default_instance_; +} // namespace track +} // namespace messages +static ::_pb::Metadata file_level_metadata_ESMTrack_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_ESMTrack_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_ESMTrack_2eproto = nullptr; + +const uint32_t TableStruct_ESMTrack_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::messages::track::ESMTrack, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::messages::track::ESMTrack, _impl_.esmsensorid_), + PROTOBUF_FIELD_OFFSET(::messages::track::ESMTrack, _impl_.entityidentifier_), + PROTOBUF_FIELD_OFFSET(::messages::track::ESMTrack, _impl_.esmdata_), + PROTOBUF_FIELD_OFFSET(::messages::track::ESMTrack, _impl_.contactbearing_), + PROTOBUF_FIELD_OFFSET(::messages::track::ESMTrack, _impl_.timestamp_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::messages::track::ESMTrack)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::messages::track::_ESMTrack_default_instance_._instance, +}; + +const char descriptor_table_protodef_ESMTrack_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\016ESMTrack.proto\022\016messages.track\032\020Identi" + "fier.proto\032\rESMData.proto\032\030GeocentricPos" + "ition.proto\032\037google/protobuf/timestamp.p" + "roto\"\306\001\n\010ESMTrack\022\023\n\013ESMSensorID\030\001 \001(\t\0224" + "\n\020EntityIdentifier\030\002 \001(\0132\032.messages.trac" + "k.Identifier\022(\n\007ESMData\030\003 \001(\0132\027.messages" + ".track.ESMData\022\026\n\016ContactBearing\030\004 \001(\001\022-" + "\n\ttimestamp\030\005 \001(\0132\032.google.protobuf.Time" + "stampb\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_ESMTrack_2eproto_deps[4] = { + &::descriptor_table_ESMData_2eproto, + &::descriptor_table_GeocentricPosition_2eproto, + &::descriptor_table_Identifier_2eproto, + &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto, +}; +static ::_pbi::once_flag descriptor_table_ESMTrack_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_ESMTrack_2eproto = { + false, false, 333, descriptor_table_protodef_ESMTrack_2eproto, + "ESMTrack.proto", + &descriptor_table_ESMTrack_2eproto_once, descriptor_table_ESMTrack_2eproto_deps, 4, 1, + schemas, file_default_instances, TableStruct_ESMTrack_2eproto::offsets, + file_level_metadata_ESMTrack_2eproto, file_level_enum_descriptors_ESMTrack_2eproto, + file_level_service_descriptors_ESMTrack_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_ESMTrack_2eproto_getter() { + return &descriptor_table_ESMTrack_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_ESMTrack_2eproto(&descriptor_table_ESMTrack_2eproto); +namespace messages { +namespace track { + +// =================================================================== + +class ESMTrack::_Internal { + public: + static const ::messages::track::Identifier& entityidentifier(const ESMTrack* msg); + static const ::messages::track::ESMData& esmdata(const ESMTrack* msg); + static const ::PROTOBUF_NAMESPACE_ID::Timestamp& timestamp(const ESMTrack* msg); +}; + +const ::messages::track::Identifier& +ESMTrack::_Internal::entityidentifier(const ESMTrack* msg) { + return *msg->_impl_.entityidentifier_; +} +const ::messages::track::ESMData& +ESMTrack::_Internal::esmdata(const ESMTrack* msg) { + return *msg->_impl_.esmdata_; +} +const ::PROTOBUF_NAMESPACE_ID::Timestamp& +ESMTrack::_Internal::timestamp(const ESMTrack* msg) { + return *msg->_impl_.timestamp_; +} +void ESMTrack::clear_entityidentifier() { + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; +} +void ESMTrack::clear_esmdata() { + if (GetArenaForAllocation() == nullptr && _impl_.esmdata_ != nullptr) { + delete _impl_.esmdata_; + } + _impl_.esmdata_ = nullptr; +} +void ESMTrack::clear_timestamp() { + if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { + delete _impl_.timestamp_; + } + _impl_.timestamp_ = nullptr; +} +ESMTrack::ESMTrack(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:messages.track.ESMTrack) +} +ESMTrack::ESMTrack(const ESMTrack& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + ESMTrack* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.esmsensorid_){} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.esmdata_){nullptr} + , decltype(_impl_.timestamp_){nullptr} + , decltype(_impl_.contactbearing_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.esmsensorid_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.esmsensorid_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_esmsensorid().empty()) { + _this->_impl_.esmsensorid_.Set(from._internal_esmsensorid(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_entityidentifier()) { + _this->_impl_.entityidentifier_ = new ::messages::track::Identifier(*from._impl_.entityidentifier_); + } + if (from._internal_has_esmdata()) { + _this->_impl_.esmdata_ = new ::messages::track::ESMData(*from._impl_.esmdata_); + } + if (from._internal_has_timestamp()) { + _this->_impl_.timestamp_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.timestamp_); + } + _this->_impl_.contactbearing_ = from._impl_.contactbearing_; + // @@protoc_insertion_point(copy_constructor:messages.track.ESMTrack) +} + +inline void ESMTrack::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.esmsensorid_){} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.esmdata_){nullptr} + , decltype(_impl_.timestamp_){nullptr} + , decltype(_impl_.contactbearing_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.esmsensorid_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.esmsensorid_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +ESMTrack::~ESMTrack() { + // @@protoc_insertion_point(destructor:messages.track.ESMTrack) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void ESMTrack::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.esmsensorid_.Destroy(); + if (this != internal_default_instance()) delete _impl_.entityidentifier_; + if (this != internal_default_instance()) delete _impl_.esmdata_; + if (this != internal_default_instance()) delete _impl_.timestamp_; +} + +void ESMTrack::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void ESMTrack::Clear() { +// @@protoc_insertion_point(message_clear_start:messages.track.ESMTrack) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.esmsensorid_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.esmdata_ != nullptr) { + delete _impl_.esmdata_; + } + _impl_.esmdata_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { + delete _impl_.timestamp_; + } + _impl_.timestamp_ = nullptr; + _impl_.contactbearing_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* ESMTrack::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string ESMSensorID = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_esmsensorid(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "messages.track.ESMTrack.ESMSensorID")); + } else + goto handle_unusual; + continue; + // .messages.track.Identifier EntityIdentifier = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_entityidentifier(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .messages.track.ESMData ESMData = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_esmdata(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // double ContactBearing = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 33)) { + _impl_.contactbearing_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // .google.protobuf.Timestamp timestamp = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_timestamp(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* ESMTrack::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:messages.track.ESMTrack) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string ESMSensorID = 1; + if (!this->_internal_esmsensorid().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_esmsensorid().data(), static_cast(this->_internal_esmsensorid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "messages.track.ESMTrack.ESMSensorID"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_esmsensorid(), target); + } + + // .messages.track.Identifier EntityIdentifier = 2; + if (this->_internal_has_entityidentifier()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::entityidentifier(this), + _Internal::entityidentifier(this).GetCachedSize(), target, stream); + } + + // .messages.track.ESMData ESMData = 3; + if (this->_internal_has_esmdata()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::esmdata(this), + _Internal::esmdata(this).GetCachedSize(), target, stream); + } + + // double ContactBearing = 4; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactbearing = this->_internal_contactbearing(); + uint64_t raw_contactbearing; + memcpy(&raw_contactbearing, &tmp_contactbearing, sizeof(tmp_contactbearing)); + if (raw_contactbearing != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(4, this->_internal_contactbearing(), target); + } + + // .google.protobuf.Timestamp timestamp = 5; + if (this->_internal_has_timestamp()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::timestamp(this), + _Internal::timestamp(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:messages.track.ESMTrack) + return target; +} + +size_t ESMTrack::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:messages.track.ESMTrack) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string ESMSensorID = 1; + if (!this->_internal_esmsensorid().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_esmsensorid()); + } + + // .messages.track.Identifier EntityIdentifier = 2; + if (this->_internal_has_entityidentifier()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.entityidentifier_); + } + + // .messages.track.ESMData ESMData = 3; + if (this->_internal_has_esmdata()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.esmdata_); + } + + // .google.protobuf.Timestamp timestamp = 5; + if (this->_internal_has_timestamp()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.timestamp_); + } + + // double ContactBearing = 4; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactbearing = this->_internal_contactbearing(); + uint64_t raw_contactbearing; + memcpy(&raw_contactbearing, &tmp_contactbearing, sizeof(tmp_contactbearing)); + if (raw_contactbearing != 0) { + total_size += 1 + 8; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData ESMTrack::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + ESMTrack::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*ESMTrack::GetClassData() const { return &_class_data_; } + + +void ESMTrack::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:messages.track.ESMTrack) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_esmsensorid().empty()) { + _this->_internal_set_esmsensorid(from._internal_esmsensorid()); + } + if (from._internal_has_entityidentifier()) { + _this->_internal_mutable_entityidentifier()->::messages::track::Identifier::MergeFrom( + from._internal_entityidentifier()); + } + if (from._internal_has_esmdata()) { + _this->_internal_mutable_esmdata()->::messages::track::ESMData::MergeFrom( + from._internal_esmdata()); + } + if (from._internal_has_timestamp()) { + _this->_internal_mutable_timestamp()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom( + from._internal_timestamp()); + } + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactbearing = from._internal_contactbearing(); + uint64_t raw_contactbearing; + memcpy(&raw_contactbearing, &tmp_contactbearing, sizeof(tmp_contactbearing)); + if (raw_contactbearing != 0) { + _this->_internal_set_contactbearing(from._internal_contactbearing()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void ESMTrack::CopyFrom(const ESMTrack& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:messages.track.ESMTrack) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ESMTrack::IsInitialized() const { + return true; +} + +void ESMTrack::InternalSwap(ESMTrack* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.esmsensorid_, lhs_arena, + &other->_impl_.esmsensorid_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(ESMTrack, _impl_.contactbearing_) + + sizeof(ESMTrack::_impl_.contactbearing_) + - PROTOBUF_FIELD_OFFSET(ESMTrack, _impl_.entityidentifier_)>( + reinterpret_cast(&_impl_.entityidentifier_), + reinterpret_cast(&other->_impl_.entityidentifier_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata ESMTrack::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_ESMTrack_2eproto_getter, &descriptor_table_ESMTrack_2eproto_once, + file_level_metadata_ESMTrack_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::messages::track::ESMTrack* +Arena::CreateMaybeMessage< ::messages::track::ESMTrack >(Arena* arena) { + return Arena::CreateMessageInternal< ::messages::track::ESMTrack >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/include/SimCore/Messages/Protos/ESMTrack.pb.h b/include/SimCore/Messages/Protos/ESMTrack.pb.h new file mode 100644 index 0000000..dd2637f --- /dev/null +++ b/include/SimCore/Messages/Protos/ESMTrack.pb.h @@ -0,0 +1,636 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: ESMTrack.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_ESMTrack_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_ESMTrack_2eproto + +#include +#include + +#include +#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 +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "Identifier.pb.h" +#include "ESMData.pb.h" +#include "GeocentricPosition.pb.h" +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_ESMTrack_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_ESMTrack_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_ESMTrack_2eproto; +namespace messages { +namespace track { +class ESMTrack; +struct ESMTrackDefaultTypeInternal; +extern ESMTrackDefaultTypeInternal _ESMTrack_default_instance_; +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> ::messages::track::ESMTrack* Arena::CreateMaybeMessage<::messages::track::ESMTrack>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace messages { +namespace track { + +// =================================================================== + +class ESMTrack final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.track.ESMTrack) */ { + public: + inline ESMTrack() : ESMTrack(nullptr) {} + ~ESMTrack() override; + explicit PROTOBUF_CONSTEXPR ESMTrack(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + ESMTrack(const ESMTrack& from); + ESMTrack(ESMTrack&& from) noexcept + : ESMTrack() { + *this = ::std::move(from); + } + + inline ESMTrack& operator=(const ESMTrack& from) { + CopyFrom(from); + return *this; + } + inline ESMTrack& operator=(ESMTrack&& 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 ESMTrack& default_instance() { + return *internal_default_instance(); + } + static inline const ESMTrack* internal_default_instance() { + return reinterpret_cast( + &_ESMTrack_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(ESMTrack& a, ESMTrack& b) { + a.Swap(&b); + } + inline void Swap(ESMTrack* 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(ESMTrack* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + ESMTrack* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ESMTrack& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const ESMTrack& from) { + ESMTrack::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(ESMTrack* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "messages.track.ESMTrack"; + } + protected: + explicit ESMTrack(::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 { + kESMSensorIDFieldNumber = 1, + kEntityIdentifierFieldNumber = 2, + kESMDataFieldNumber = 3, + kTimestampFieldNumber = 5, + kContactBearingFieldNumber = 4, + }; + // string ESMSensorID = 1; + void clear_esmsensorid(); + const std::string& esmsensorid() const; + template + void set_esmsensorid(ArgT0&& arg0, ArgT... args); + std::string* mutable_esmsensorid(); + PROTOBUF_NODISCARD std::string* release_esmsensorid(); + void set_allocated_esmsensorid(std::string* esmsensorid); + private: + const std::string& _internal_esmsensorid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_esmsensorid(const std::string& value); + std::string* _internal_mutable_esmsensorid(); + public: + + // .messages.track.Identifier EntityIdentifier = 2; + bool has_entityidentifier() const; + private: + bool _internal_has_entityidentifier() const; + public: + void clear_entityidentifier(); + const ::messages::track::Identifier& entityidentifier() const; + PROTOBUF_NODISCARD ::messages::track::Identifier* release_entityidentifier(); + ::messages::track::Identifier* mutable_entityidentifier(); + void set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier); + private: + const ::messages::track::Identifier& _internal_entityidentifier() const; + ::messages::track::Identifier* _internal_mutable_entityidentifier(); + public: + void unsafe_arena_set_allocated_entityidentifier( + ::messages::track::Identifier* entityidentifier); + ::messages::track::Identifier* unsafe_arena_release_entityidentifier(); + + // .messages.track.ESMData ESMData = 3; + bool has_esmdata() const; + private: + bool _internal_has_esmdata() const; + public: + void clear_esmdata(); + const ::messages::track::ESMData& esmdata() const; + PROTOBUF_NODISCARD ::messages::track::ESMData* release_esmdata(); + ::messages::track::ESMData* mutable_esmdata(); + void set_allocated_esmdata(::messages::track::ESMData* esmdata); + private: + const ::messages::track::ESMData& _internal_esmdata() const; + ::messages::track::ESMData* _internal_mutable_esmdata(); + public: + void unsafe_arena_set_allocated_esmdata( + ::messages::track::ESMData* esmdata); + ::messages::track::ESMData* unsafe_arena_release_esmdata(); + + // .google.protobuf.Timestamp timestamp = 5; + 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(); + + // double ContactBearing = 4; + void clear_contactbearing(); + double contactbearing() const; + void set_contactbearing(double value); + private: + double _internal_contactbearing() const; + void _internal_set_contactbearing(double value); + public: + + // @@protoc_insertion_point(class_scope:messages.track.ESMTrack) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr esmsensorid_; + ::messages::track::Identifier* entityidentifier_; + ::messages::track::ESMData* esmdata_; + ::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp_; + double contactbearing_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_ESMTrack_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ESMTrack + +// string ESMSensorID = 1; +inline void ESMTrack::clear_esmsensorid() { + _impl_.esmsensorid_.ClearToEmpty(); +} +inline const std::string& ESMTrack::esmsensorid() const { + // @@protoc_insertion_point(field_get:messages.track.ESMTrack.ESMSensorID) + return _internal_esmsensorid(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void ESMTrack::set_esmsensorid(ArgT0&& arg0, ArgT... args) { + + _impl_.esmsensorid_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:messages.track.ESMTrack.ESMSensorID) +} +inline std::string* ESMTrack::mutable_esmsensorid() { + std::string* _s = _internal_mutable_esmsensorid(); + // @@protoc_insertion_point(field_mutable:messages.track.ESMTrack.ESMSensorID) + return _s; +} +inline const std::string& ESMTrack::_internal_esmsensorid() const { + return _impl_.esmsensorid_.Get(); +} +inline void ESMTrack::_internal_set_esmsensorid(const std::string& value) { + + _impl_.esmsensorid_.Set(value, GetArenaForAllocation()); +} +inline std::string* ESMTrack::_internal_mutable_esmsensorid() { + + return _impl_.esmsensorid_.Mutable(GetArenaForAllocation()); +} +inline std::string* ESMTrack::release_esmsensorid() { + // @@protoc_insertion_point(field_release:messages.track.ESMTrack.ESMSensorID) + return _impl_.esmsensorid_.Release(); +} +inline void ESMTrack::set_allocated_esmsensorid(std::string* esmsensorid) { + if (esmsensorid != nullptr) { + + } else { + + } + _impl_.esmsensorid_.SetAllocated(esmsensorid, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.esmsensorid_.IsDefault()) { + _impl_.esmsensorid_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:messages.track.ESMTrack.ESMSensorID) +} + +// .messages.track.Identifier EntityIdentifier = 2; +inline bool ESMTrack::_internal_has_entityidentifier() const { + return this != internal_default_instance() && _impl_.entityidentifier_ != nullptr; +} +inline bool ESMTrack::has_entityidentifier() const { + return _internal_has_entityidentifier(); +} +inline const ::messages::track::Identifier& ESMTrack::_internal_entityidentifier() const { + const ::messages::track::Identifier* p = _impl_.entityidentifier_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_Identifier_default_instance_); +} +inline const ::messages::track::Identifier& ESMTrack::entityidentifier() const { + // @@protoc_insertion_point(field_get:messages.track.ESMTrack.EntityIdentifier) + return _internal_entityidentifier(); +} +inline void ESMTrack::unsafe_arena_set_allocated_entityidentifier( + ::messages::track::Identifier* entityidentifier) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); + } + _impl_.entityidentifier_ = entityidentifier; + if (entityidentifier) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.ESMTrack.EntityIdentifier) +} +inline ::messages::track::Identifier* ESMTrack::release_entityidentifier() { + + ::messages::track::Identifier* temp = _impl_.entityidentifier_; + _impl_.entityidentifier_ = 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::track::Identifier* ESMTrack::unsafe_arena_release_entityidentifier() { + // @@protoc_insertion_point(field_release:messages.track.ESMTrack.EntityIdentifier) + + ::messages::track::Identifier* temp = _impl_.entityidentifier_; + _impl_.entityidentifier_ = nullptr; + return temp; +} +inline ::messages::track::Identifier* ESMTrack::_internal_mutable_entityidentifier() { + + if (_impl_.entityidentifier_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::Identifier>(GetArenaForAllocation()); + _impl_.entityidentifier_ = p; + } + return _impl_.entityidentifier_; +} +inline ::messages::track::Identifier* ESMTrack::mutable_entityidentifier() { + ::messages::track::Identifier* _msg = _internal_mutable_entityidentifier(); + // @@protoc_insertion_point(field_mutable:messages.track.ESMTrack.EntityIdentifier) + return _msg; +} +inline void ESMTrack::set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); + } + if (entityidentifier) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(entityidentifier)); + if (message_arena != submessage_arena) { + entityidentifier = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, entityidentifier, submessage_arena); + } + + } else { + + } + _impl_.entityidentifier_ = entityidentifier; + // @@protoc_insertion_point(field_set_allocated:messages.track.ESMTrack.EntityIdentifier) +} + +// .messages.track.ESMData ESMData = 3; +inline bool ESMTrack::_internal_has_esmdata() const { + return this != internal_default_instance() && _impl_.esmdata_ != nullptr; +} +inline bool ESMTrack::has_esmdata() const { + return _internal_has_esmdata(); +} +inline const ::messages::track::ESMData& ESMTrack::_internal_esmdata() const { + const ::messages::track::ESMData* p = _impl_.esmdata_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_ESMData_default_instance_); +} +inline const ::messages::track::ESMData& ESMTrack::esmdata() const { + // @@protoc_insertion_point(field_get:messages.track.ESMTrack.ESMData) + return _internal_esmdata(); +} +inline void ESMTrack::unsafe_arena_set_allocated_esmdata( + ::messages::track::ESMData* esmdata) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.esmdata_); + } + _impl_.esmdata_ = esmdata; + if (esmdata) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.ESMTrack.ESMData) +} +inline ::messages::track::ESMData* ESMTrack::release_esmdata() { + + ::messages::track::ESMData* temp = _impl_.esmdata_; + _impl_.esmdata_ = 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::track::ESMData* ESMTrack::unsafe_arena_release_esmdata() { + // @@protoc_insertion_point(field_release:messages.track.ESMTrack.ESMData) + + ::messages::track::ESMData* temp = _impl_.esmdata_; + _impl_.esmdata_ = nullptr; + return temp; +} +inline ::messages::track::ESMData* ESMTrack::_internal_mutable_esmdata() { + + if (_impl_.esmdata_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::ESMData>(GetArenaForAllocation()); + _impl_.esmdata_ = p; + } + return _impl_.esmdata_; +} +inline ::messages::track::ESMData* ESMTrack::mutable_esmdata() { + ::messages::track::ESMData* _msg = _internal_mutable_esmdata(); + // @@protoc_insertion_point(field_mutable:messages.track.ESMTrack.ESMData) + return _msg; +} +inline void ESMTrack::set_allocated_esmdata(::messages::track::ESMData* esmdata) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.esmdata_); + } + if (esmdata) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(esmdata)); + if (message_arena != submessage_arena) { + esmdata = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, esmdata, submessage_arena); + } + + } else { + + } + _impl_.esmdata_ = esmdata; + // @@protoc_insertion_point(field_set_allocated:messages.track.ESMTrack.ESMData) +} + +// double ContactBearing = 4; +inline void ESMTrack::clear_contactbearing() { + _impl_.contactbearing_ = 0; +} +inline double ESMTrack::_internal_contactbearing() const { + return _impl_.contactbearing_; +} +inline double ESMTrack::contactbearing() const { + // @@protoc_insertion_point(field_get:messages.track.ESMTrack.ContactBearing) + return _internal_contactbearing(); +} +inline void ESMTrack::_internal_set_contactbearing(double value) { + + _impl_.contactbearing_ = value; +} +inline void ESMTrack::set_contactbearing(double value) { + _internal_set_contactbearing(value); + // @@protoc_insertion_point(field_set:messages.track.ESMTrack.ContactBearing) +} + +// .google.protobuf.Timestamp timestamp = 5; +inline bool ESMTrack::_internal_has_timestamp() const { + return this != internal_default_instance() && _impl_.timestamp_ != nullptr; +} +inline bool ESMTrack::has_timestamp() const { + return _internal_has_timestamp(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& ESMTrack::_internal_timestamp() const { + const ::PROTOBUF_NAMESPACE_ID::Timestamp* p = _impl_.timestamp_; + return p != nullptr ? *p : reinterpret_cast( + ::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& ESMTrack::timestamp() const { + // @@protoc_insertion_point(field_get:messages.track.ESMTrack.timestamp) + return _internal_timestamp(); +} +inline void ESMTrack::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.track.ESMTrack.timestamp) +} +inline ::PROTOBUF_NAMESPACE_ID::Timestamp* ESMTrack::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* ESMTrack::unsafe_arena_release_timestamp() { + // @@protoc_insertion_point(field_release:messages.track.ESMTrack.timestamp) + + ::PROTOBUF_NAMESPACE_ID::Timestamp* temp = _impl_.timestamp_; + _impl_.timestamp_ = nullptr; + return temp; +} +inline ::PROTOBUF_NAMESPACE_ID::Timestamp* ESMTrack::_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* ESMTrack::mutable_timestamp() { + ::PROTOBUF_NAMESPACE_ID::Timestamp* _msg = _internal_mutable_timestamp(); + // @@protoc_insertion_point(field_mutable:messages.track.ESMTrack.timestamp) + return _msg; +} +inline void ESMTrack::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.track.ESMTrack.timestamp) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace track +} // namespace messages + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_ESMTrack_2eproto diff --git a/include/SimCore/Messages/Protos/ESMTrack.proto b/include/SimCore/Messages/Protos/ESMTrack.proto new file mode 100644 index 0000000..703261d --- /dev/null +++ b/include/SimCore/Messages/Protos/ESMTrack.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package messages.track; + +import "Identifier.proto"; +import "ESMData.proto"; +import "GeocentricPosition.proto"; + +import "google/protobuf/timestamp.proto"; + + +message ESMTrack { + + string ESMSensorID = 1; + messages.track.Identifier EntityIdentifier = 2; + messages.track.ESMData ESMData = 3; + double ContactBearing = 4; + + google.protobuf.Timestamp timestamp = 5; +} \ No newline at end of file diff --git a/include/SimCore/Messages/Protos/GroundTruthTrack.pb.cc b/include/SimCore/Messages/Protos/GroundTruthTrack.pb.cc new file mode 100644 index 0000000..0664ff4 --- /dev/null +++ b/include/SimCore/Messages/Protos/GroundTruthTrack.pb.cc @@ -0,0 +1,581 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GroundTruthTrack.proto + +#include "GroundTruthTrack.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace messages { +namespace track { +PROTOBUF_CONSTEXPR GroundTruthTrack::GroundTruthTrack( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.entityidentifier_)*/nullptr + , /*decltype(_impl_.geocentricposition_)*/nullptr + , /*decltype(_impl_.esmdata_)*/nullptr + , /*decltype(_impl_.timestamp_)*/nullptr + , /*decltype(_impl_.contactspeed_)*/0 + , /*decltype(_impl_.contactcourse_)*/0 + , /*decltype(_impl_.trackkind_)*/0u} {} +struct GroundTruthTrackDefaultTypeInternal { + PROTOBUF_CONSTEXPR GroundTruthTrackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GroundTruthTrackDefaultTypeInternal() {} + union { + GroundTruthTrack _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GroundTruthTrackDefaultTypeInternal _GroundTruthTrack_default_instance_; +} // namespace track +} // namespace messages +static ::_pb::Metadata file_level_metadata_GroundTruthTrack_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_GroundTruthTrack_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_GroundTruthTrack_2eproto = nullptr; + +const uint32_t TableStruct_GroundTruthTrack_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_.trackkind_), + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_.entityidentifier_), + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_.geocentricposition_), + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_.contactspeed_), + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_.contactcourse_), + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_.esmdata_), + PROTOBUF_FIELD_OFFSET(::messages::track::GroundTruthTrack, _impl_.timestamp_), + ~0u, + ~0u, + ~0u, + 1, + 2, + 0, + ~0u, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 13, -1, sizeof(::messages::track::GroundTruthTrack)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::messages::track::_GroundTruthTrack_default_instance_._instance, +}; + +const char descriptor_table_protodef_GroundTruthTrack_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\026GroundTruthTrack.proto\022\016messages.track" + "\032\020Identifier.proto\032\rESMData.proto\032\030Geoce" + "ntricPosition.proto\032\037google/protobuf/tim" + "estamp.proto\"\345\002\n\020GroundTruthTrack\022\021\n\tTra" + "ckKind\030\001 \001(\r\0224\n\020EntityIdentifier\030\002 \001(\0132\032" + ".messages.track.Identifier\022D\n\022Geocentric" + "Position\030\003 \001(\0132(.messages.track.EntityGe" + "ocentricPosition\022\031\n\014ContactSpeed\030\004 \001(\001H\000" + "\210\001\001\022\032\n\rContactCourse\030\005 \001(\001H\001\210\001\001\022-\n\007ESMDa" + "ta\030\006 \001(\0132\027.messages.track.ESMDataH\002\210\001\001\022-" + "\n\ttimestamp\030\007 \001(\0132\032.google.protobuf.Time" + "stampB\017\n\r_ContactSpeedB\020\n\016_ContactCourse" + "B\n\n\010_ESMDatab\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_GroundTruthTrack_2eproto_deps[4] = { + &::descriptor_table_ESMData_2eproto, + &::descriptor_table_GeocentricPosition_2eproto, + &::descriptor_table_Identifier_2eproto, + &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto, +}; +static ::_pbi::once_flag descriptor_table_GroundTruthTrack_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_GroundTruthTrack_2eproto = { + false, false, 500, descriptor_table_protodef_GroundTruthTrack_2eproto, + "GroundTruthTrack.proto", + &descriptor_table_GroundTruthTrack_2eproto_once, descriptor_table_GroundTruthTrack_2eproto_deps, 4, 1, + schemas, file_default_instances, TableStruct_GroundTruthTrack_2eproto::offsets, + file_level_metadata_GroundTruthTrack_2eproto, file_level_enum_descriptors_GroundTruthTrack_2eproto, + file_level_service_descriptors_GroundTruthTrack_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_GroundTruthTrack_2eproto_getter() { + return &descriptor_table_GroundTruthTrack_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_GroundTruthTrack_2eproto(&descriptor_table_GroundTruthTrack_2eproto); +namespace messages { +namespace track { + +// =================================================================== + +class GroundTruthTrack::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::messages::track::Identifier& entityidentifier(const GroundTruthTrack* msg); + static const ::messages::track::EntityGeocentricPosition& geocentricposition(const GroundTruthTrack* msg); + static void set_has_contactspeed(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static void set_has_contactcourse(HasBits* has_bits) { + (*has_bits)[0] |= 4u; + } + static const ::messages::track::ESMData& esmdata(const GroundTruthTrack* msg); + static void set_has_esmdata(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static const ::PROTOBUF_NAMESPACE_ID::Timestamp& timestamp(const GroundTruthTrack* msg); +}; + +const ::messages::track::Identifier& +GroundTruthTrack::_Internal::entityidentifier(const GroundTruthTrack* msg) { + return *msg->_impl_.entityidentifier_; +} +const ::messages::track::EntityGeocentricPosition& +GroundTruthTrack::_Internal::geocentricposition(const GroundTruthTrack* msg) { + return *msg->_impl_.geocentricposition_; +} +const ::messages::track::ESMData& +GroundTruthTrack::_Internal::esmdata(const GroundTruthTrack* msg) { + return *msg->_impl_.esmdata_; +} +const ::PROTOBUF_NAMESPACE_ID::Timestamp& +GroundTruthTrack::_Internal::timestamp(const GroundTruthTrack* msg) { + return *msg->_impl_.timestamp_; +} +void GroundTruthTrack::clear_entityidentifier() { + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; +} +void GroundTruthTrack::clear_geocentricposition() { + if (GetArenaForAllocation() == nullptr && _impl_.geocentricposition_ != nullptr) { + delete _impl_.geocentricposition_; + } + _impl_.geocentricposition_ = nullptr; +} +void GroundTruthTrack::clear_esmdata() { + if (_impl_.esmdata_ != nullptr) _impl_.esmdata_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +void GroundTruthTrack::clear_timestamp() { + if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { + delete _impl_.timestamp_; + } + _impl_.timestamp_ = nullptr; +} +GroundTruthTrack::GroundTruthTrack(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:messages.track.GroundTruthTrack) +} +GroundTruthTrack::GroundTruthTrack(const GroundTruthTrack& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GroundTruthTrack* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.geocentricposition_){nullptr} + , decltype(_impl_.esmdata_){nullptr} + , decltype(_impl_.timestamp_){nullptr} + , decltype(_impl_.contactspeed_){} + , decltype(_impl_.contactcourse_){} + , decltype(_impl_.trackkind_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_entityidentifier()) { + _this->_impl_.entityidentifier_ = new ::messages::track::Identifier(*from._impl_.entityidentifier_); + } + if (from._internal_has_geocentricposition()) { + _this->_impl_.geocentricposition_ = new ::messages::track::EntityGeocentricPosition(*from._impl_.geocentricposition_); + } + if (from._internal_has_esmdata()) { + _this->_impl_.esmdata_ = new ::messages::track::ESMData(*from._impl_.esmdata_); + } + if (from._internal_has_timestamp()) { + _this->_impl_.timestamp_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.timestamp_); + } + ::memcpy(&_impl_.contactspeed_, &from._impl_.contactspeed_, + static_cast(reinterpret_cast(&_impl_.trackkind_) - + reinterpret_cast(&_impl_.contactspeed_)) + sizeof(_impl_.trackkind_)); + // @@protoc_insertion_point(copy_constructor:messages.track.GroundTruthTrack) +} + +inline void GroundTruthTrack::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.geocentricposition_){nullptr} + , decltype(_impl_.esmdata_){nullptr} + , decltype(_impl_.timestamp_){nullptr} + , decltype(_impl_.contactspeed_){0} + , decltype(_impl_.contactcourse_){0} + , decltype(_impl_.trackkind_){0u} + }; +} + +GroundTruthTrack::~GroundTruthTrack() { + // @@protoc_insertion_point(destructor:messages.track.GroundTruthTrack) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GroundTruthTrack::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.entityidentifier_; + if (this != internal_default_instance()) delete _impl_.geocentricposition_; + if (this != internal_default_instance()) delete _impl_.esmdata_; + if (this != internal_default_instance()) delete _impl_.timestamp_; +} + +void GroundTruthTrack::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void GroundTruthTrack::Clear() { +// @@protoc_insertion_point(message_clear_start:messages.track.GroundTruthTrack) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.geocentricposition_ != nullptr) { + delete _impl_.geocentricposition_; + } + _impl_.geocentricposition_ = nullptr; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.esmdata_ != nullptr); + _impl_.esmdata_->Clear(); + } + if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { + delete _impl_.timestamp_; + } + _impl_.timestamp_ = nullptr; + if (cached_has_bits & 0x00000006u) { + ::memset(&_impl_.contactspeed_, 0, static_cast( + reinterpret_cast(&_impl_.contactcourse_) - + reinterpret_cast(&_impl_.contactspeed_)) + sizeof(_impl_.contactcourse_)); + } + _impl_.trackkind_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GroundTruthTrack::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint32 TrackKind = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.trackkind_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .messages.track.Identifier EntityIdentifier = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_entityidentifier(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_geocentricposition(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional double ContactSpeed = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 33)) { + _Internal::set_has_contactspeed(&has_bits); + _impl_.contactspeed_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // optional double ContactCourse = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 41)) { + _Internal::set_has_contactcourse(&has_bits); + _impl_.contactcourse_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // optional .messages.track.ESMData ESMData = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_esmdata(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .google.protobuf.Timestamp timestamp = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_timestamp(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* GroundTruthTrack::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:messages.track.GroundTruthTrack) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 TrackKind = 1; + if (this->_internal_trackkind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_trackkind(), target); + } + + // .messages.track.Identifier EntityIdentifier = 2; + if (this->_internal_has_entityidentifier()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::entityidentifier(this), + _Internal::entityidentifier(this).GetCachedSize(), target, stream); + } + + // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; + if (this->_internal_has_geocentricposition()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::geocentricposition(this), + _Internal::geocentricposition(this).GetCachedSize(), target, stream); + } + + // optional double ContactSpeed = 4; + if (_internal_has_contactspeed()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(4, this->_internal_contactspeed(), target); + } + + // optional double ContactCourse = 5; + if (_internal_has_contactcourse()) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(5, this->_internal_contactcourse(), target); + } + + // optional .messages.track.ESMData ESMData = 6; + if (_internal_has_esmdata()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::esmdata(this), + _Internal::esmdata(this).GetCachedSize(), target, stream); + } + + // .google.protobuf.Timestamp timestamp = 7; + if (this->_internal_has_timestamp()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::timestamp(this), + _Internal::timestamp(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:messages.track.GroundTruthTrack) + return target; +} + +size_t GroundTruthTrack::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:messages.track.GroundTruthTrack) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .messages.track.Identifier EntityIdentifier = 2; + if (this->_internal_has_entityidentifier()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.entityidentifier_); + } + + // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; + if (this->_internal_has_geocentricposition()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.geocentricposition_); + } + + // optional .messages.track.ESMData ESMData = 6; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.esmdata_); + } + + // .google.protobuf.Timestamp timestamp = 7; + if (this->_internal_has_timestamp()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.timestamp_); + } + + if (cached_has_bits & 0x00000006u) { + // optional double ContactSpeed = 4; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + 8; + } + + // optional double ContactCourse = 5; + if (cached_has_bits & 0x00000004u) { + total_size += 1 + 8; + } + + } + // uint32 TrackKind = 1; + if (this->_internal_trackkind() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_trackkind()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GroundTruthTrack::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GroundTruthTrack::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GroundTruthTrack::GetClassData() const { return &_class_data_; } + + +void GroundTruthTrack::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:messages.track.GroundTruthTrack) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_entityidentifier()) { + _this->_internal_mutable_entityidentifier()->::messages::track::Identifier::MergeFrom( + from._internal_entityidentifier()); + } + if (from._internal_has_geocentricposition()) { + _this->_internal_mutable_geocentricposition()->::messages::track::EntityGeocentricPosition::MergeFrom( + from._internal_geocentricposition()); + } + if (from._internal_has_esmdata()) { + _this->_internal_mutable_esmdata()->::messages::track::ESMData::MergeFrom( + from._internal_esmdata()); + } + if (from._internal_has_timestamp()) { + _this->_internal_mutable_timestamp()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom( + from._internal_timestamp()); + } + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000006u) { + if (cached_has_bits & 0x00000002u) { + _this->_impl_.contactspeed_ = from._impl_.contactspeed_; + } + if (cached_has_bits & 0x00000004u) { + _this->_impl_.contactcourse_ = from._impl_.contactcourse_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + } + if (from._internal_trackkind() != 0) { + _this->_internal_set_trackkind(from._internal_trackkind()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void GroundTruthTrack::CopyFrom(const GroundTruthTrack& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:messages.track.GroundTruthTrack) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GroundTruthTrack::IsInitialized() const { + return true; +} + +void GroundTruthTrack::InternalSwap(GroundTruthTrack* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(GroundTruthTrack, _impl_.trackkind_) + + sizeof(GroundTruthTrack::_impl_.trackkind_) + - PROTOBUF_FIELD_OFFSET(GroundTruthTrack, _impl_.entityidentifier_)>( + reinterpret_cast(&_impl_.entityidentifier_), + reinterpret_cast(&other->_impl_.entityidentifier_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GroundTruthTrack::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_GroundTruthTrack_2eproto_getter, &descriptor_table_GroundTruthTrack_2eproto_once, + file_level_metadata_GroundTruthTrack_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::messages::track::GroundTruthTrack* +Arena::CreateMaybeMessage< ::messages::track::GroundTruthTrack >(Arena* arena) { + return Arena::CreateMessageInternal< ::messages::track::GroundTruthTrack >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/include/SimCore/Messages/Protos/GroundTruthTrack.pb.h b/include/SimCore/Messages/Protos/GroundTruthTrack.pb.h new file mode 100644 index 0000000..f124bf5 --- /dev/null +++ b/include/SimCore/Messages/Protos/GroundTruthTrack.pb.h @@ -0,0 +1,764 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: GroundTruthTrack.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_GroundTruthTrack_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_GroundTruthTrack_2eproto + +#include +#include + +#include +#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 +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include "Identifier.pb.h" +#include "ESMData.pb.h" +#include "GeocentricPosition.pb.h" +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_GroundTruthTrack_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_GroundTruthTrack_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_GroundTruthTrack_2eproto; +namespace messages { +namespace track { +class GroundTruthTrack; +struct GroundTruthTrackDefaultTypeInternal; +extern GroundTruthTrackDefaultTypeInternal _GroundTruthTrack_default_instance_; +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> ::messages::track::GroundTruthTrack* Arena::CreateMaybeMessage<::messages::track::GroundTruthTrack>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace messages { +namespace track { + +// =================================================================== + +class GroundTruthTrack final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.track.GroundTruthTrack) */ { + public: + inline GroundTruthTrack() : GroundTruthTrack(nullptr) {} + ~GroundTruthTrack() override; + explicit PROTOBUF_CONSTEXPR GroundTruthTrack(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GroundTruthTrack(const GroundTruthTrack& from); + GroundTruthTrack(GroundTruthTrack&& from) noexcept + : GroundTruthTrack() { + *this = ::std::move(from); + } + + inline GroundTruthTrack& operator=(const GroundTruthTrack& from) { + CopyFrom(from); + return *this; + } + inline GroundTruthTrack& operator=(GroundTruthTrack&& 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 GroundTruthTrack& default_instance() { + return *internal_default_instance(); + } + static inline const GroundTruthTrack* internal_default_instance() { + return reinterpret_cast( + &_GroundTruthTrack_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(GroundTruthTrack& a, GroundTruthTrack& b) { + a.Swap(&b); + } + inline void Swap(GroundTruthTrack* 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(GroundTruthTrack* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GroundTruthTrack* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GroundTruthTrack& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GroundTruthTrack& from) { + GroundTruthTrack::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(GroundTruthTrack* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "messages.track.GroundTruthTrack"; + } + protected: + explicit GroundTruthTrack(::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 { + kEntityIdentifierFieldNumber = 2, + kGeocentricPositionFieldNumber = 3, + kESMDataFieldNumber = 6, + kTimestampFieldNumber = 7, + kContactSpeedFieldNumber = 4, + kContactCourseFieldNumber = 5, + kTrackKindFieldNumber = 1, + }; + // .messages.track.Identifier EntityIdentifier = 2; + bool has_entityidentifier() const; + private: + bool _internal_has_entityidentifier() const; + public: + void clear_entityidentifier(); + const ::messages::track::Identifier& entityidentifier() const; + PROTOBUF_NODISCARD ::messages::track::Identifier* release_entityidentifier(); + ::messages::track::Identifier* mutable_entityidentifier(); + void set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier); + private: + const ::messages::track::Identifier& _internal_entityidentifier() const; + ::messages::track::Identifier* _internal_mutable_entityidentifier(); + public: + void unsafe_arena_set_allocated_entityidentifier( + ::messages::track::Identifier* entityidentifier); + ::messages::track::Identifier* unsafe_arena_release_entityidentifier(); + + // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; + bool has_geocentricposition() const; + private: + bool _internal_has_geocentricposition() const; + public: + void clear_geocentricposition(); + const ::messages::track::EntityGeocentricPosition& geocentricposition() const; + PROTOBUF_NODISCARD ::messages::track::EntityGeocentricPosition* release_geocentricposition(); + ::messages::track::EntityGeocentricPosition* mutable_geocentricposition(); + void set_allocated_geocentricposition(::messages::track::EntityGeocentricPosition* geocentricposition); + private: + const ::messages::track::EntityGeocentricPosition& _internal_geocentricposition() const; + ::messages::track::EntityGeocentricPosition* _internal_mutable_geocentricposition(); + public: + void unsafe_arena_set_allocated_geocentricposition( + ::messages::track::EntityGeocentricPosition* geocentricposition); + ::messages::track::EntityGeocentricPosition* unsafe_arena_release_geocentricposition(); + + // optional .messages.track.ESMData ESMData = 6; + bool has_esmdata() const; + private: + bool _internal_has_esmdata() const; + public: + void clear_esmdata(); + const ::messages::track::ESMData& esmdata() const; + PROTOBUF_NODISCARD ::messages::track::ESMData* release_esmdata(); + ::messages::track::ESMData* mutable_esmdata(); + void set_allocated_esmdata(::messages::track::ESMData* esmdata); + private: + const ::messages::track::ESMData& _internal_esmdata() const; + ::messages::track::ESMData* _internal_mutable_esmdata(); + public: + void unsafe_arena_set_allocated_esmdata( + ::messages::track::ESMData* esmdata); + ::messages::track::ESMData* unsafe_arena_release_esmdata(); + + // .google.protobuf.Timestamp timestamp = 7; + 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(); + + // optional double ContactSpeed = 4; + bool has_contactspeed() const; + private: + bool _internal_has_contactspeed() const; + public: + void clear_contactspeed(); + double contactspeed() const; + void set_contactspeed(double value); + private: + double _internal_contactspeed() const; + void _internal_set_contactspeed(double value); + public: + + // optional double ContactCourse = 5; + bool has_contactcourse() const; + private: + bool _internal_has_contactcourse() const; + public: + void clear_contactcourse(); + double contactcourse() const; + void set_contactcourse(double value); + private: + double _internal_contactcourse() const; + void _internal_set_contactcourse(double value); + public: + + // uint32 TrackKind = 1; + void clear_trackkind(); + uint32_t trackkind() const; + void set_trackkind(uint32_t value); + private: + uint32_t _internal_trackkind() const; + void _internal_set_trackkind(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:messages.track.GroundTruthTrack) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::messages::track::Identifier* entityidentifier_; + ::messages::track::EntityGeocentricPosition* geocentricposition_; + ::messages::track::ESMData* esmdata_; + ::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp_; + double contactspeed_; + double contactcourse_; + uint32_t trackkind_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_GroundTruthTrack_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// GroundTruthTrack + +// uint32 TrackKind = 1; +inline void GroundTruthTrack::clear_trackkind() { + _impl_.trackkind_ = 0u; +} +inline uint32_t GroundTruthTrack::_internal_trackkind() const { + return _impl_.trackkind_; +} +inline uint32_t GroundTruthTrack::trackkind() const { + // @@protoc_insertion_point(field_get:messages.track.GroundTruthTrack.TrackKind) + return _internal_trackkind(); +} +inline void GroundTruthTrack::_internal_set_trackkind(uint32_t value) { + + _impl_.trackkind_ = value; +} +inline void GroundTruthTrack::set_trackkind(uint32_t value) { + _internal_set_trackkind(value); + // @@protoc_insertion_point(field_set:messages.track.GroundTruthTrack.TrackKind) +} + +// .messages.track.Identifier EntityIdentifier = 2; +inline bool GroundTruthTrack::_internal_has_entityidentifier() const { + return this != internal_default_instance() && _impl_.entityidentifier_ != nullptr; +} +inline bool GroundTruthTrack::has_entityidentifier() const { + return _internal_has_entityidentifier(); +} +inline const ::messages::track::Identifier& GroundTruthTrack::_internal_entityidentifier() const { + const ::messages::track::Identifier* p = _impl_.entityidentifier_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_Identifier_default_instance_); +} +inline const ::messages::track::Identifier& GroundTruthTrack::entityidentifier() const { + // @@protoc_insertion_point(field_get:messages.track.GroundTruthTrack.EntityIdentifier) + return _internal_entityidentifier(); +} +inline void GroundTruthTrack::unsafe_arena_set_allocated_entityidentifier( + ::messages::track::Identifier* entityidentifier) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); + } + _impl_.entityidentifier_ = entityidentifier; + if (entityidentifier) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.GroundTruthTrack.EntityIdentifier) +} +inline ::messages::track::Identifier* GroundTruthTrack::release_entityidentifier() { + + ::messages::track::Identifier* temp = _impl_.entityidentifier_; + _impl_.entityidentifier_ = 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::track::Identifier* GroundTruthTrack::unsafe_arena_release_entityidentifier() { + // @@protoc_insertion_point(field_release:messages.track.GroundTruthTrack.EntityIdentifier) + + ::messages::track::Identifier* temp = _impl_.entityidentifier_; + _impl_.entityidentifier_ = nullptr; + return temp; +} +inline ::messages::track::Identifier* GroundTruthTrack::_internal_mutable_entityidentifier() { + + if (_impl_.entityidentifier_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::Identifier>(GetArenaForAllocation()); + _impl_.entityidentifier_ = p; + } + return _impl_.entityidentifier_; +} +inline ::messages::track::Identifier* GroundTruthTrack::mutable_entityidentifier() { + ::messages::track::Identifier* _msg = _internal_mutable_entityidentifier(); + // @@protoc_insertion_point(field_mutable:messages.track.GroundTruthTrack.EntityIdentifier) + return _msg; +} +inline void GroundTruthTrack::set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); + } + if (entityidentifier) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(entityidentifier)); + if (message_arena != submessage_arena) { + entityidentifier = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, entityidentifier, submessage_arena); + } + + } else { + + } + _impl_.entityidentifier_ = entityidentifier; + // @@protoc_insertion_point(field_set_allocated:messages.track.GroundTruthTrack.EntityIdentifier) +} + +// .messages.track.EntityGeocentricPosition GeocentricPosition = 3; +inline bool GroundTruthTrack::_internal_has_geocentricposition() const { + return this != internal_default_instance() && _impl_.geocentricposition_ != nullptr; +} +inline bool GroundTruthTrack::has_geocentricposition() const { + return _internal_has_geocentricposition(); +} +inline const ::messages::track::EntityGeocentricPosition& GroundTruthTrack::_internal_geocentricposition() const { + const ::messages::track::EntityGeocentricPosition* p = _impl_.geocentricposition_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_EntityGeocentricPosition_default_instance_); +} +inline const ::messages::track::EntityGeocentricPosition& GroundTruthTrack::geocentricposition() const { + // @@protoc_insertion_point(field_get:messages.track.GroundTruthTrack.GeocentricPosition) + return _internal_geocentricposition(); +} +inline void GroundTruthTrack::unsafe_arena_set_allocated_geocentricposition( + ::messages::track::EntityGeocentricPosition* geocentricposition) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.geocentricposition_); + } + _impl_.geocentricposition_ = geocentricposition; + if (geocentricposition) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.GroundTruthTrack.GeocentricPosition) +} +inline ::messages::track::EntityGeocentricPosition* GroundTruthTrack::release_geocentricposition() { + + ::messages::track::EntityGeocentricPosition* temp = _impl_.geocentricposition_; + _impl_.geocentricposition_ = 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::track::EntityGeocentricPosition* GroundTruthTrack::unsafe_arena_release_geocentricposition() { + // @@protoc_insertion_point(field_release:messages.track.GroundTruthTrack.GeocentricPosition) + + ::messages::track::EntityGeocentricPosition* temp = _impl_.geocentricposition_; + _impl_.geocentricposition_ = nullptr; + return temp; +} +inline ::messages::track::EntityGeocentricPosition* GroundTruthTrack::_internal_mutable_geocentricposition() { + + if (_impl_.geocentricposition_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::EntityGeocentricPosition>(GetArenaForAllocation()); + _impl_.geocentricposition_ = p; + } + return _impl_.geocentricposition_; +} +inline ::messages::track::EntityGeocentricPosition* GroundTruthTrack::mutable_geocentricposition() { + ::messages::track::EntityGeocentricPosition* _msg = _internal_mutable_geocentricposition(); + // @@protoc_insertion_point(field_mutable:messages.track.GroundTruthTrack.GeocentricPosition) + return _msg; +} +inline void GroundTruthTrack::set_allocated_geocentricposition(::messages::track::EntityGeocentricPosition* geocentricposition) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.geocentricposition_); + } + if (geocentricposition) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(geocentricposition)); + if (message_arena != submessage_arena) { + geocentricposition = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, geocentricposition, submessage_arena); + } + + } else { + + } + _impl_.geocentricposition_ = geocentricposition; + // @@protoc_insertion_point(field_set_allocated:messages.track.GroundTruthTrack.GeocentricPosition) +} + +// optional double ContactSpeed = 4; +inline bool GroundTruthTrack::_internal_has_contactspeed() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + return value; +} +inline bool GroundTruthTrack::has_contactspeed() const { + return _internal_has_contactspeed(); +} +inline void GroundTruthTrack::clear_contactspeed() { + _impl_.contactspeed_ = 0; + _impl_._has_bits_[0] &= ~0x00000002u; +} +inline double GroundTruthTrack::_internal_contactspeed() const { + return _impl_.contactspeed_; +} +inline double GroundTruthTrack::contactspeed() const { + // @@protoc_insertion_point(field_get:messages.track.GroundTruthTrack.ContactSpeed) + return _internal_contactspeed(); +} +inline void GroundTruthTrack::_internal_set_contactspeed(double value) { + _impl_._has_bits_[0] |= 0x00000002u; + _impl_.contactspeed_ = value; +} +inline void GroundTruthTrack::set_contactspeed(double value) { + _internal_set_contactspeed(value); + // @@protoc_insertion_point(field_set:messages.track.GroundTruthTrack.ContactSpeed) +} + +// optional double ContactCourse = 5; +inline bool GroundTruthTrack::_internal_has_contactcourse() const { + bool value = (_impl_._has_bits_[0] & 0x00000004u) != 0; + return value; +} +inline bool GroundTruthTrack::has_contactcourse() const { + return _internal_has_contactcourse(); +} +inline void GroundTruthTrack::clear_contactcourse() { + _impl_.contactcourse_ = 0; + _impl_._has_bits_[0] &= ~0x00000004u; +} +inline double GroundTruthTrack::_internal_contactcourse() const { + return _impl_.contactcourse_; +} +inline double GroundTruthTrack::contactcourse() const { + // @@protoc_insertion_point(field_get:messages.track.GroundTruthTrack.ContactCourse) + return _internal_contactcourse(); +} +inline void GroundTruthTrack::_internal_set_contactcourse(double value) { + _impl_._has_bits_[0] |= 0x00000004u; + _impl_.contactcourse_ = value; +} +inline void GroundTruthTrack::set_contactcourse(double value) { + _internal_set_contactcourse(value); + // @@protoc_insertion_point(field_set:messages.track.GroundTruthTrack.ContactCourse) +} + +// optional .messages.track.ESMData ESMData = 6; +inline bool GroundTruthTrack::_internal_has_esmdata() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.esmdata_ != nullptr); + return value; +} +inline bool GroundTruthTrack::has_esmdata() const { + return _internal_has_esmdata(); +} +inline const ::messages::track::ESMData& GroundTruthTrack::_internal_esmdata() const { + const ::messages::track::ESMData* p = _impl_.esmdata_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_ESMData_default_instance_); +} +inline const ::messages::track::ESMData& GroundTruthTrack::esmdata() const { + // @@protoc_insertion_point(field_get:messages.track.GroundTruthTrack.ESMData) + return _internal_esmdata(); +} +inline void GroundTruthTrack::unsafe_arena_set_allocated_esmdata( + ::messages::track::ESMData* esmdata) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.esmdata_); + } + _impl_.esmdata_ = esmdata; + if (esmdata) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.GroundTruthTrack.ESMData) +} +inline ::messages::track::ESMData* GroundTruthTrack::release_esmdata() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::messages::track::ESMData* temp = _impl_.esmdata_; + _impl_.esmdata_ = 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::track::ESMData* GroundTruthTrack::unsafe_arena_release_esmdata() { + // @@protoc_insertion_point(field_release:messages.track.GroundTruthTrack.ESMData) + _impl_._has_bits_[0] &= ~0x00000001u; + ::messages::track::ESMData* temp = _impl_.esmdata_; + _impl_.esmdata_ = nullptr; + return temp; +} +inline ::messages::track::ESMData* GroundTruthTrack::_internal_mutable_esmdata() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.esmdata_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::ESMData>(GetArenaForAllocation()); + _impl_.esmdata_ = p; + } + return _impl_.esmdata_; +} +inline ::messages::track::ESMData* GroundTruthTrack::mutable_esmdata() { + ::messages::track::ESMData* _msg = _internal_mutable_esmdata(); + // @@protoc_insertion_point(field_mutable:messages.track.GroundTruthTrack.ESMData) + return _msg; +} +inline void GroundTruthTrack::set_allocated_esmdata(::messages::track::ESMData* esmdata) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.esmdata_); + } + if (esmdata) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(esmdata)); + if (message_arena != submessage_arena) { + esmdata = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, esmdata, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.esmdata_ = esmdata; + // @@protoc_insertion_point(field_set_allocated:messages.track.GroundTruthTrack.ESMData) +} + +// .google.protobuf.Timestamp timestamp = 7; +inline bool GroundTruthTrack::_internal_has_timestamp() const { + return this != internal_default_instance() && _impl_.timestamp_ != nullptr; +} +inline bool GroundTruthTrack::has_timestamp() const { + return _internal_has_timestamp(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& GroundTruthTrack::_internal_timestamp() const { + const ::PROTOBUF_NAMESPACE_ID::Timestamp* p = _impl_.timestamp_; + return p != nullptr ? *p : reinterpret_cast( + ::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& GroundTruthTrack::timestamp() const { + // @@protoc_insertion_point(field_get:messages.track.GroundTruthTrack.timestamp) + return _internal_timestamp(); +} +inline void GroundTruthTrack::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.track.GroundTruthTrack.timestamp) +} +inline ::PROTOBUF_NAMESPACE_ID::Timestamp* GroundTruthTrack::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* GroundTruthTrack::unsafe_arena_release_timestamp() { + // @@protoc_insertion_point(field_release:messages.track.GroundTruthTrack.timestamp) + + ::PROTOBUF_NAMESPACE_ID::Timestamp* temp = _impl_.timestamp_; + _impl_.timestamp_ = nullptr; + return temp; +} +inline ::PROTOBUF_NAMESPACE_ID::Timestamp* GroundTruthTrack::_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* GroundTruthTrack::mutable_timestamp() { + ::PROTOBUF_NAMESPACE_ID::Timestamp* _msg = _internal_mutable_timestamp(); + // @@protoc_insertion_point(field_mutable:messages.track.GroundTruthTrack.timestamp) + return _msg; +} +inline void GroundTruthTrack::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.track.GroundTruthTrack.timestamp) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace track +} // namespace messages + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_GroundTruthTrack_2eproto diff --git a/include/SimCore/Messages/Protos/GroundTruthTrack.proto b/include/SimCore/Messages/Protos/GroundTruthTrack.proto new file mode 100644 index 0000000..6dee74f --- /dev/null +++ b/include/SimCore/Messages/Protos/GroundTruthTrack.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package messages.track; + +import "Identifier.proto"; +import "ESMData.proto"; +import "GeocentricPosition.proto"; +import "google/protobuf/timestamp.proto"; + + +message GroundTruthTrack +{ +uint32 TrackKind = 1; +messages.track.Identifier EntityIdentifier = 2; +messages.track.EntityGeocentricPosition GeocentricPosition = 3; +optional double ContactSpeed = 4; +optional double ContactCourse = 5; + +optional messages.track.ESMData ESMData = 6; + +google.protobuf.Timestamp timestamp = 7; + +} \ No newline at end of file diff --git a/include/SimCore/Messages/Protos/RadarTrack.pb.cc b/include/SimCore/Messages/Protos/RadarTrack.pb.cc index ffb0b78..daae8aa 100644 --- a/include/SimCore/Messages/Protos/RadarTrack.pb.cc +++ b/include/SimCore/Messages/Protos/RadarTrack.pb.cc @@ -25,9 +25,7 @@ namespace track { PROTOBUF_CONSTEXPR RadarTrack::RadarTrack( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.radarid_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.entityidentifier_)*/nullptr , /*decltype(_impl_.geocentricposition_)*/nullptr - , /*decltype(_impl_.timestamp_)*/nullptr , /*decltype(_impl_.contactspeed_)*/0 , /*decltype(_impl_.contactcourse_)*/0 , /*decltype(_impl_.contactbearing_)*/0 @@ -57,14 +55,12 @@ const uint32_t TableStruct_RadarTrack_2eproto::offsets[] PROTOBUF_SECTION_VARIAB ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.radarid_), - PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.entityidentifier_), PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.geocentricposition_), PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.contactspeed_), PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.contactcourse_), PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.contactbearing_), PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.contactrange_), PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.contactenvironemnt_), - PROTOBUF_FIELD_OFFSET(::messages::track::RadarTrack, _impl_.timestamp_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { { 0, -1, -1, sizeof(::messages::track::RadarTrack)}, @@ -75,18 +71,15 @@ static const ::_pb::Message* const file_default_instances[] = { }; const char descriptor_table_protodef_RadarTrack_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\020RadarTrack.proto\022\016messages.track\032\037goog" - "le/protobuf/timestamp.proto\032\030GeocentricP" - "osition.proto\032\020Identifier.proto\"\277\002\n\nRada" - "rTrack\022\017\n\007RadarID\030\001 \001(\t\0224\n\020EntityIdentif" - "ier\030\002 \001(\0132\032.messages.track.Identifier\022D\n" - "\022GeocentricPosition\030\003 \001(\0132(.messages.tra" - "ck.EntityGeocentricPosition\022\024\n\014ContactSp" - "eed\030\004 \001(\001\022\025\n\rContactCourse\030\005 \001(\001\022\026\n\016Cont" - "actBearing\030\006 \001(\001\022\024\n\014ContactRange\030\007 \001(\001\022\032" - "\n\022ContactEnvironemnt\030\010 \001(\r\022-\n\ttimestamp\030" - "\t \001(\0132\032.google.protobuf.Timestampb\006proto" - "3" + "\n\020RadarTrack.proto\022\016messages.track\032\030Geoc" + "entricPosition.proto\032\020Identifier.proto\032\037" + "google/protobuf/timestamp.proto\"\332\001\n\nRada" + "rTrack\022\017\n\007RadarID\030\001 \001(\t\022D\n\022GeocentricPos" + "ition\030\003 \001(\0132(.messages.track.EntityGeoce" + "ntricPosition\022\024\n\014ContactSpeed\030\004 \001(\001\022\025\n\rC" + "ontactCourse\030\005 \001(\001\022\026\n\016ContactBearing\030\006 \001" + "(\001\022\024\n\014ContactRange\030\007 \001(\001\022\032\n\022ContactEnvir" + "onemnt\030\010 \001(\rb\006proto3" ; static const ::_pbi::DescriptorTable* const descriptor_table_RadarTrack_2eproto_deps[3] = { &::descriptor_table_GeocentricPosition_2eproto, @@ -95,7 +88,7 @@ static const ::_pbi::DescriptorTable* const descriptor_table_RadarTrack_2eproto_ }; static ::_pbi::once_flag descriptor_table_RadarTrack_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_RadarTrack_2eproto = { - false, false, 441, descriptor_table_protodef_RadarTrack_2eproto, + false, false, 340, descriptor_table_protodef_RadarTrack_2eproto, "RadarTrack.proto", &descriptor_table_RadarTrack_2eproto_once, descriptor_table_RadarTrack_2eproto_deps, 3, 1, schemas, file_default_instances, TableStruct_RadarTrack_2eproto::offsets, @@ -115,41 +108,19 @@ namespace track { class RadarTrack::_Internal { public: - static const ::messages::track::Identifier& entityidentifier(const RadarTrack* msg); static const ::messages::track::EntityGeocentricPosition& geocentricposition(const RadarTrack* msg); - static const ::PROTOBUF_NAMESPACE_ID::Timestamp& timestamp(const RadarTrack* msg); }; -const ::messages::track::Identifier& -RadarTrack::_Internal::entityidentifier(const RadarTrack* msg) { - return *msg->_impl_.entityidentifier_; -} const ::messages::track::EntityGeocentricPosition& RadarTrack::_Internal::geocentricposition(const RadarTrack* msg) { return *msg->_impl_.geocentricposition_; } -const ::PROTOBUF_NAMESPACE_ID::Timestamp& -RadarTrack::_Internal::timestamp(const RadarTrack* msg) { - return *msg->_impl_.timestamp_; -} -void RadarTrack::clear_entityidentifier() { - if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { - delete _impl_.entityidentifier_; - } - _impl_.entityidentifier_ = nullptr; -} void RadarTrack::clear_geocentricposition() { if (GetArenaForAllocation() == nullptr && _impl_.geocentricposition_ != nullptr) { delete _impl_.geocentricposition_; } _impl_.geocentricposition_ = nullptr; } -void RadarTrack::clear_timestamp() { - if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { - delete _impl_.timestamp_; - } - _impl_.timestamp_ = nullptr; -} RadarTrack::RadarTrack(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { @@ -161,9 +132,7 @@ RadarTrack::RadarTrack(const RadarTrack& from) RadarTrack* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.radarid_){} - , decltype(_impl_.entityidentifier_){nullptr} , decltype(_impl_.geocentricposition_){nullptr} - , decltype(_impl_.timestamp_){nullptr} , decltype(_impl_.contactspeed_){} , decltype(_impl_.contactcourse_){} , decltype(_impl_.contactbearing_){} @@ -180,15 +149,9 @@ RadarTrack::RadarTrack(const RadarTrack& from) _this->_impl_.radarid_.Set(from._internal_radarid(), _this->GetArenaForAllocation()); } - if (from._internal_has_entityidentifier()) { - _this->_impl_.entityidentifier_ = new ::messages::track::Identifier(*from._impl_.entityidentifier_); - } if (from._internal_has_geocentricposition()) { _this->_impl_.geocentricposition_ = new ::messages::track::EntityGeocentricPosition(*from._impl_.geocentricposition_); } - if (from._internal_has_timestamp()) { - _this->_impl_.timestamp_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.timestamp_); - } ::memcpy(&_impl_.contactspeed_, &from._impl_.contactspeed_, static_cast(reinterpret_cast(&_impl_.contactenvironemnt_) - reinterpret_cast(&_impl_.contactspeed_)) + sizeof(_impl_.contactenvironemnt_)); @@ -201,9 +164,7 @@ inline void RadarTrack::SharedCtor( (void)is_message_owned; new (&_impl_) Impl_{ decltype(_impl_.radarid_){} - , decltype(_impl_.entityidentifier_){nullptr} , decltype(_impl_.geocentricposition_){nullptr} - , decltype(_impl_.timestamp_){nullptr} , decltype(_impl_.contactspeed_){0} , decltype(_impl_.contactcourse_){0} , decltype(_impl_.contactbearing_){0} @@ -229,9 +190,7 @@ RadarTrack::~RadarTrack() { inline void RadarTrack::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.radarid_.Destroy(); - if (this != internal_default_instance()) delete _impl_.entityidentifier_; if (this != internal_default_instance()) delete _impl_.geocentricposition_; - if (this != internal_default_instance()) delete _impl_.timestamp_; } void RadarTrack::SetCachedSize(int size) const { @@ -245,18 +204,10 @@ void RadarTrack::Clear() { (void) cached_has_bits; _impl_.radarid_.ClearToEmpty(); - if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { - delete _impl_.entityidentifier_; - } - _impl_.entityidentifier_ = nullptr; if (GetArenaForAllocation() == nullptr && _impl_.geocentricposition_ != nullptr) { delete _impl_.geocentricposition_; } _impl_.geocentricposition_ = nullptr; - if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { - delete _impl_.timestamp_; - } - _impl_.timestamp_ = nullptr; ::memset(&_impl_.contactspeed_, 0, static_cast( reinterpret_cast(&_impl_.contactenvironemnt_) - reinterpret_cast(&_impl_.contactspeed_)) + sizeof(_impl_.contactenvironemnt_)); @@ -279,14 +230,6 @@ const char* RadarTrack::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } else goto handle_unusual; continue; - // .messages.track.Identifier EntityIdentifier = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_entityidentifier(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { @@ -335,14 +278,6 @@ const char* RadarTrack::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct } else goto handle_unusual; continue; - // .google.protobuf.Timestamp timestamp = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { - ptr = ctx->ParseMessage(_internal_mutable_timestamp(), ptr); - CHK_(ptr); - } else - goto handle_unusual; - continue; default: goto handle_unusual; } // switch @@ -382,13 +317,6 @@ uint8_t* RadarTrack::_InternalSerialize( 1, this->_internal_radarid(), target); } - // .messages.track.Identifier EntityIdentifier = 2; - if (this->_internal_has_entityidentifier()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::entityidentifier(this), - _Internal::entityidentifier(this).GetCachedSize(), target, stream); - } - // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; if (this->_internal_has_geocentricposition()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: @@ -442,13 +370,6 @@ uint8_t* RadarTrack::_InternalSerialize( target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_contactenvironemnt(), target); } - // .google.protobuf.Timestamp timestamp = 9; - if (this->_internal_has_timestamp()) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(9, _Internal::timestamp(this), - _Internal::timestamp(this).GetCachedSize(), target, stream); - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -472,13 +393,6 @@ size_t RadarTrack::ByteSizeLong() const { this->_internal_radarid()); } - // .messages.track.Identifier EntityIdentifier = 2; - if (this->_internal_has_entityidentifier()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.entityidentifier_); - } - // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; if (this->_internal_has_geocentricposition()) { total_size += 1 + @@ -486,13 +400,6 @@ size_t RadarTrack::ByteSizeLong() const { *_impl_.geocentricposition_); } - // .google.protobuf.Timestamp timestamp = 9; - if (this->_internal_has_timestamp()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.timestamp_); - } - // double ContactSpeed = 4; static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_contactspeed = this->_internal_contactspeed(); @@ -555,18 +462,10 @@ void RadarTrack::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO if (!from._internal_radarid().empty()) { _this->_internal_set_radarid(from._internal_radarid()); } - if (from._internal_has_entityidentifier()) { - _this->_internal_mutable_entityidentifier()->::messages::track::Identifier::MergeFrom( - from._internal_entityidentifier()); - } if (from._internal_has_geocentricposition()) { _this->_internal_mutable_geocentricposition()->::messages::track::EntityGeocentricPosition::MergeFrom( from._internal_geocentricposition()); } - if (from._internal_has_timestamp()) { - _this->_internal_mutable_timestamp()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom( - from._internal_timestamp()); - } static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); double tmp_contactspeed = from._internal_contactspeed(); uint64_t raw_contactspeed; @@ -624,9 +523,9 @@ void RadarTrack::InternalSwap(RadarTrack* other) { ::PROTOBUF_NAMESPACE_ID::internal::memswap< PROTOBUF_FIELD_OFFSET(RadarTrack, _impl_.contactenvironemnt_) + sizeof(RadarTrack::_impl_.contactenvironemnt_) - - PROTOBUF_FIELD_OFFSET(RadarTrack, _impl_.entityidentifier_)>( - reinterpret_cast(&_impl_.entityidentifier_), - reinterpret_cast(&other->_impl_.entityidentifier_)); + - PROTOBUF_FIELD_OFFSET(RadarTrack, _impl_.geocentricposition_)>( + reinterpret_cast(&_impl_.geocentricposition_), + reinterpret_cast(&other->_impl_.geocentricposition_)); } ::PROTOBUF_NAMESPACE_ID::Metadata RadarTrack::GetMetadata() const { diff --git a/include/SimCore/Messages/Protos/RadarTrack.pb.h b/include/SimCore/Messages/Protos/RadarTrack.pb.h index 1b725c2..5f0cd0b 100644 --- a/include/SimCore/Messages/Protos/RadarTrack.pb.h +++ b/include/SimCore/Messages/Protos/RadarTrack.pb.h @@ -30,9 +30,9 @@ #include // IWYU pragma: export #include // IWYU pragma: export #include -#include #include "GeocentricPosition.pb.h" #include "Identifier.pb.h" +#include // @@protoc_insertion_point(includes) #include #define PROTOBUF_INTERNAL_EXPORT_RadarTrack_2eproto @@ -184,9 +184,7 @@ class RadarTrack final : enum : int { kRadarIDFieldNumber = 1, - kEntityIdentifierFieldNumber = 2, kGeocentricPositionFieldNumber = 3, - kTimestampFieldNumber = 9, kContactSpeedFieldNumber = 4, kContactCourseFieldNumber = 5, kContactBearingFieldNumber = 6, @@ -207,24 +205,6 @@ class RadarTrack final : std::string* _internal_mutable_radarid(); public: - // .messages.track.Identifier EntityIdentifier = 2; - bool has_entityidentifier() const; - private: - bool _internal_has_entityidentifier() const; - public: - void clear_entityidentifier(); - const ::messages::track::Identifier& entityidentifier() const; - PROTOBUF_NODISCARD ::messages::track::Identifier* release_entityidentifier(); - ::messages::track::Identifier* mutable_entityidentifier(); - void set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier); - private: - const ::messages::track::Identifier& _internal_entityidentifier() const; - ::messages::track::Identifier* _internal_mutable_entityidentifier(); - public: - void unsafe_arena_set_allocated_entityidentifier( - ::messages::track::Identifier* entityidentifier); - ::messages::track::Identifier* unsafe_arena_release_entityidentifier(); - // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; bool has_geocentricposition() const; private: @@ -243,24 +223,6 @@ class RadarTrack final : ::messages::track::EntityGeocentricPosition* geocentricposition); ::messages::track::EntityGeocentricPosition* unsafe_arena_release_geocentricposition(); - // .google.protobuf.Timestamp timestamp = 9; - 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(); - // double ContactSpeed = 4; void clear_contactspeed(); double contactspeed() const; @@ -315,9 +277,7 @@ class RadarTrack final : typedef void DestructorSkippable_; struct Impl_ { ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr radarid_; - ::messages::track::Identifier* entityidentifier_; ::messages::track::EntityGeocentricPosition* geocentricposition_; - ::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp_; double contactspeed_; double contactcourse_; double contactbearing_; @@ -389,91 +349,6 @@ inline void RadarTrack::set_allocated_radarid(std::string* radarid) { // @@protoc_insertion_point(field_set_allocated:messages.track.RadarTrack.RadarID) } -// .messages.track.Identifier EntityIdentifier = 2; -inline bool RadarTrack::_internal_has_entityidentifier() const { - return this != internal_default_instance() && _impl_.entityidentifier_ != nullptr; -} -inline bool RadarTrack::has_entityidentifier() const { - return _internal_has_entityidentifier(); -} -inline const ::messages::track::Identifier& RadarTrack::_internal_entityidentifier() const { - const ::messages::track::Identifier* p = _impl_.entityidentifier_; - return p != nullptr ? *p : reinterpret_cast( - ::messages::track::_Identifier_default_instance_); -} -inline const ::messages::track::Identifier& RadarTrack::entityidentifier() const { - // @@protoc_insertion_point(field_get:messages.track.RadarTrack.EntityIdentifier) - return _internal_entityidentifier(); -} -inline void RadarTrack::unsafe_arena_set_allocated_entityidentifier( - ::messages::track::Identifier* entityidentifier) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); - } - _impl_.entityidentifier_ = entityidentifier; - if (entityidentifier) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.RadarTrack.EntityIdentifier) -} -inline ::messages::track::Identifier* RadarTrack::release_entityidentifier() { - - ::messages::track::Identifier* temp = _impl_.entityidentifier_; - _impl_.entityidentifier_ = 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::track::Identifier* RadarTrack::unsafe_arena_release_entityidentifier() { - // @@protoc_insertion_point(field_release:messages.track.RadarTrack.EntityIdentifier) - - ::messages::track::Identifier* temp = _impl_.entityidentifier_; - _impl_.entityidentifier_ = nullptr; - return temp; -} -inline ::messages::track::Identifier* RadarTrack::_internal_mutable_entityidentifier() { - - if (_impl_.entityidentifier_ == nullptr) { - auto* p = CreateMaybeMessage<::messages::track::Identifier>(GetArenaForAllocation()); - _impl_.entityidentifier_ = p; - } - return _impl_.entityidentifier_; -} -inline ::messages::track::Identifier* RadarTrack::mutable_entityidentifier() { - ::messages::track::Identifier* _msg = _internal_mutable_entityidentifier(); - // @@protoc_insertion_point(field_mutable:messages.track.RadarTrack.EntityIdentifier) - return _msg; -} -inline void RadarTrack::set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - if (message_arena == nullptr) { - delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); - } - if (entityidentifier) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( - reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(entityidentifier)); - if (message_arena != submessage_arena) { - entityidentifier = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, entityidentifier, submessage_arena); - } - - } else { - - } - _impl_.entityidentifier_ = entityidentifier; - // @@protoc_insertion_point(field_set_allocated:messages.track.RadarTrack.EntityIdentifier) -} - // .messages.track.EntityGeocentricPosition GeocentricPosition = 3; inline bool RadarTrack::_internal_has_geocentricposition() const { return this != internal_default_instance() && _impl_.geocentricposition_ != nullptr; @@ -659,91 +534,6 @@ inline void RadarTrack::set_contactenvironemnt(uint32_t value) { // @@protoc_insertion_point(field_set:messages.track.RadarTrack.ContactEnvironemnt) } -// .google.protobuf.Timestamp timestamp = 9; -inline bool RadarTrack::_internal_has_timestamp() const { - return this != internal_default_instance() && _impl_.timestamp_ != nullptr; -} -inline bool RadarTrack::has_timestamp() const { - return _internal_has_timestamp(); -} -inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& RadarTrack::_internal_timestamp() const { - const ::PROTOBUF_NAMESPACE_ID::Timestamp* p = _impl_.timestamp_; - return p != nullptr ? *p : reinterpret_cast( - ::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); -} -inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& RadarTrack::timestamp() const { - // @@protoc_insertion_point(field_get:messages.track.RadarTrack.timestamp) - return _internal_timestamp(); -} -inline void RadarTrack::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.track.RadarTrack.timestamp) -} -inline ::PROTOBUF_NAMESPACE_ID::Timestamp* RadarTrack::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* RadarTrack::unsafe_arena_release_timestamp() { - // @@protoc_insertion_point(field_release:messages.track.RadarTrack.timestamp) - - ::PROTOBUF_NAMESPACE_ID::Timestamp* temp = _impl_.timestamp_; - _impl_.timestamp_ = nullptr; - return temp; -} -inline ::PROTOBUF_NAMESPACE_ID::Timestamp* RadarTrack::_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* RadarTrack::mutable_timestamp() { - ::PROTOBUF_NAMESPACE_ID::Timestamp* _msg = _internal_mutable_timestamp(); - // @@protoc_insertion_point(field_mutable:messages.track.RadarTrack.timestamp) - return _msg; -} -inline void RadarTrack::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.track.RadarTrack.timestamp) -} - #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/include/SimCore/Messages/Protos/RadarTrack.proto b/include/SimCore/Messages/Protos/RadarTrack.proto index 4fbc3a2..08dfb0c 100644 --- a/include/SimCore/Messages/Protos/RadarTrack.proto +++ b/include/SimCore/Messages/Protos/RadarTrack.proto @@ -1,23 +1,22 @@ syntax = "proto3"; package messages.track; -import "google/protobuf/timestamp.proto"; import "GeocentricPosition.proto"; import "Identifier.proto"; -// [END declaration] +import "google/protobuf/timestamp.proto"; message RadarTrack { string RadarID = 1; - messages.track.Identifier EntityIdentifier = 2; + // messages.track.Identifier EntityIdentifier = 2; messages.track.EntityGeocentricPosition GeocentricPosition = 3; double ContactSpeed = 4; double ContactCourse = 5; double ContactBearing = 6; double ContactRange = 7; uint32 ContactEnvironemnt = 8; + // google.protobuf.Timestamp timestamp = 9; - google.protobuf.Timestamp timestamp = 9; - + } \ No newline at end of file diff --git a/include/SimCore/Messages/Protos/SensorTrack.pb.cc b/include/SimCore/Messages/Protos/SensorTrack.pb.cc new file mode 100644 index 0000000..233841a --- /dev/null +++ b/include/SimCore/Messages/Protos/SensorTrack.pb.cc @@ -0,0 +1,620 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SensorTrack.proto + +#include "SensorTrack.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace messages { +namespace track { +PROTOBUF_CONSTEXPR SensorTrack::SensorTrack( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_._has_bits_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_.sensorid_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.entityidentifier_)*/nullptr + , /*decltype(_impl_.radartrack_)*/nullptr + , /*decltype(_impl_.esmtrack_)*/nullptr + , /*decltype(_impl_.timestamp_)*/nullptr + , /*decltype(_impl_.duration_)*/nullptr + , /*decltype(_impl_.trackkind_)*/0u} {} +struct SensorTrackDefaultTypeInternal { + PROTOBUF_CONSTEXPR SensorTrackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~SensorTrackDefaultTypeInternal() {} + union { + SensorTrack _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SensorTrackDefaultTypeInternal _SensorTrack_default_instance_; +} // namespace track +} // namespace messages +static ::_pb::Metadata file_level_metadata_SensorTrack_2eproto[1]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_SensorTrack_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_SensorTrack_2eproto = nullptr; + +const uint32_t TableStruct_SensorTrack_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_.entityidentifier_), + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_.sensorid_), + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_.trackkind_), + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_.radartrack_), + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_.esmtrack_), + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_.timestamp_), + PROTOBUF_FIELD_OFFSET(::messages::track::SensorTrack, _impl_.duration_), + ~0u, + ~0u, + ~0u, + 0, + 1, + ~0u, + ~0u, +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, 13, -1, sizeof(::messages::track::SensorTrack)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::messages::track::_SensorTrack_default_instance_._instance, +}; + +const char descriptor_table_protodef_SensorTrack_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\021SensorTrack.proto\022\016messages.track\032\037goo" + "gle/protobuf/timestamp.proto\032\036google/pro" + "tobuf/duration.proto\032\020Identifier.proto\032\020" + "RadarTrack.proto\032\016ESMTrack.proto\"\306\002\n\013Sen" + "sorTrack\0224\n\020EntityIdentifier\030\001 \001(\0132\032.mes" + "sages.track.Identifier\022\020\n\010SensorID\030\002 \001(\t" + "\022\021\n\tTrackKind\030\003 \001(\r\0223\n\nRadarTrack\030\004 \001(\0132" + "\032.messages.track.RadarTrackH\000\210\001\001\022/\n\010ESMT" + "rack\030\005 \001(\0132\030.messages.track.ESMTrackH\001\210\001" + "\001\022-\n\ttimestamp\030\006 \001(\0132\032.google.protobuf.T" + "imestamp\022+\n\010duration\030\007 \001(\0132\031.google.prot" + "obuf.DurationB\r\n\013_RadarTrackB\013\n\t_ESMTrac" + "kb\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_SensorTrack_2eproto_deps[5] = { + &::descriptor_table_ESMTrack_2eproto, + &::descriptor_table_Identifier_2eproto, + &::descriptor_table_RadarTrack_2eproto, + &::descriptor_table_google_2fprotobuf_2fduration_2eproto, + &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto, +}; +static ::_pbi::once_flag descriptor_table_SensorTrack_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_SensorTrack_2eproto = { + false, false, 489, descriptor_table_protodef_SensorTrack_2eproto, + "SensorTrack.proto", + &descriptor_table_SensorTrack_2eproto_once, descriptor_table_SensorTrack_2eproto_deps, 5, 1, + schemas, file_default_instances, TableStruct_SensorTrack_2eproto::offsets, + file_level_metadata_SensorTrack_2eproto, file_level_enum_descriptors_SensorTrack_2eproto, + file_level_service_descriptors_SensorTrack_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_SensorTrack_2eproto_getter() { + return &descriptor_table_SensorTrack_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_SensorTrack_2eproto(&descriptor_table_SensorTrack_2eproto); +namespace messages { +namespace track { + +// =================================================================== + +class SensorTrack::_Internal { + public: + using HasBits = decltype(std::declval()._impl_._has_bits_); + static const ::messages::track::Identifier& entityidentifier(const SensorTrack* msg); + static const ::messages::track::RadarTrack& radartrack(const SensorTrack* msg); + static void set_has_radartrack(HasBits* has_bits) { + (*has_bits)[0] |= 1u; + } + static const ::messages::track::ESMTrack& esmtrack(const SensorTrack* msg); + static void set_has_esmtrack(HasBits* has_bits) { + (*has_bits)[0] |= 2u; + } + static const ::PROTOBUF_NAMESPACE_ID::Timestamp& timestamp(const SensorTrack* msg); + static const ::PROTOBUF_NAMESPACE_ID::Duration& duration(const SensorTrack* msg); +}; + +const ::messages::track::Identifier& +SensorTrack::_Internal::entityidentifier(const SensorTrack* msg) { + return *msg->_impl_.entityidentifier_; +} +const ::messages::track::RadarTrack& +SensorTrack::_Internal::radartrack(const SensorTrack* msg) { + return *msg->_impl_.radartrack_; +} +const ::messages::track::ESMTrack& +SensorTrack::_Internal::esmtrack(const SensorTrack* msg) { + return *msg->_impl_.esmtrack_; +} +const ::PROTOBUF_NAMESPACE_ID::Timestamp& +SensorTrack::_Internal::timestamp(const SensorTrack* msg) { + return *msg->_impl_.timestamp_; +} +const ::PROTOBUF_NAMESPACE_ID::Duration& +SensorTrack::_Internal::duration(const SensorTrack* msg) { + return *msg->_impl_.duration_; +} +void SensorTrack::clear_entityidentifier() { + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; +} +void SensorTrack::clear_radartrack() { + if (_impl_.radartrack_ != nullptr) _impl_.radartrack_->Clear(); + _impl_._has_bits_[0] &= ~0x00000001u; +} +void SensorTrack::clear_esmtrack() { + if (_impl_.esmtrack_ != nullptr) _impl_.esmtrack_->Clear(); + _impl_._has_bits_[0] &= ~0x00000002u; +} +void SensorTrack::clear_timestamp() { + if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { + delete _impl_.timestamp_; + } + _impl_.timestamp_ = nullptr; +} +void SensorTrack::clear_duration() { + if (GetArenaForAllocation() == nullptr && _impl_.duration_ != nullptr) { + delete _impl_.duration_; + } + _impl_.duration_ = nullptr; +} +SensorTrack::SensorTrack(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:messages.track.SensorTrack) +} +SensorTrack::SensorTrack(const SensorTrack& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + SensorTrack* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){from._impl_._has_bits_} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.sensorid_){} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.radartrack_){nullptr} + , decltype(_impl_.esmtrack_){nullptr} + , decltype(_impl_.timestamp_){nullptr} + , decltype(_impl_.duration_){nullptr} + , decltype(_impl_.trackkind_){}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.sensorid_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sensorid_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_sensorid().empty()) { + _this->_impl_.sensorid_.Set(from._internal_sensorid(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_entityidentifier()) { + _this->_impl_.entityidentifier_ = new ::messages::track::Identifier(*from._impl_.entityidentifier_); + } + if (from._internal_has_radartrack()) { + _this->_impl_.radartrack_ = new ::messages::track::RadarTrack(*from._impl_.radartrack_); + } + if (from._internal_has_esmtrack()) { + _this->_impl_.esmtrack_ = new ::messages::track::ESMTrack(*from._impl_.esmtrack_); + } + if (from._internal_has_timestamp()) { + _this->_impl_.timestamp_ = new ::PROTOBUF_NAMESPACE_ID::Timestamp(*from._impl_.timestamp_); + } + if (from._internal_has_duration()) { + _this->_impl_.duration_ = new ::PROTOBUF_NAMESPACE_ID::Duration(*from._impl_.duration_); + } + _this->_impl_.trackkind_ = from._impl_.trackkind_; + // @@protoc_insertion_point(copy_constructor:messages.track.SensorTrack) +} + +inline void SensorTrack::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_._has_bits_){} + , /*decltype(_impl_._cached_size_)*/{} + , decltype(_impl_.sensorid_){} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.radartrack_){nullptr} + , decltype(_impl_.esmtrack_){nullptr} + , decltype(_impl_.timestamp_){nullptr} + , decltype(_impl_.duration_){nullptr} + , decltype(_impl_.trackkind_){0u} + }; + _impl_.sensorid_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.sensorid_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +SensorTrack::~SensorTrack() { + // @@protoc_insertion_point(destructor:messages.track.SensorTrack) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void SensorTrack::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.sensorid_.Destroy(); + if (this != internal_default_instance()) delete _impl_.entityidentifier_; + if (this != internal_default_instance()) delete _impl_.radartrack_; + if (this != internal_default_instance()) delete _impl_.esmtrack_; + if (this != internal_default_instance()) delete _impl_.timestamp_; + if (this != internal_default_instance()) delete _impl_.duration_; +} + +void SensorTrack::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void SensorTrack::Clear() { +// @@protoc_insertion_point(message_clear_start:messages.track.SensorTrack) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.sensorid_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + GOOGLE_DCHECK(_impl_.radartrack_ != nullptr); + _impl_.radartrack_->Clear(); + } + if (cached_has_bits & 0x00000002u) { + GOOGLE_DCHECK(_impl_.esmtrack_ != nullptr); + _impl_.esmtrack_->Clear(); + } + } + if (GetArenaForAllocation() == nullptr && _impl_.timestamp_ != nullptr) { + delete _impl_.timestamp_; + } + _impl_.timestamp_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.duration_ != nullptr) { + delete _impl_.duration_; + } + _impl_.duration_ = nullptr; + _impl_.trackkind_ = 0u; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SensorTrack::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + _Internal::HasBits has_bits{}; + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .messages.track.Identifier EntityIdentifier = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_entityidentifier(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string SensorID = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_sensorid(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "messages.track.SensorTrack.SensorID")); + } else + goto handle_unusual; + continue; + // uint32 TrackKind = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.trackkind_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .messages.track.RadarTrack RadarTrack = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_radartrack(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // optional .messages.track.ESMTrack ESMTrack = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_esmtrack(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .google.protobuf.Timestamp timestamp = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_timestamp(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .google.protobuf.Duration duration = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_duration(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + _impl_._has_bits_.Or(has_bits); + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* SensorTrack::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:messages.track.SensorTrack) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .messages.track.Identifier EntityIdentifier = 1; + if (this->_internal_has_entityidentifier()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::entityidentifier(this), + _Internal::entityidentifier(this).GetCachedSize(), target, stream); + } + + // string SensorID = 2; + if (!this->_internal_sensorid().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_sensorid().data(), static_cast(this->_internal_sensorid().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "messages.track.SensorTrack.SensorID"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_sensorid(), target); + } + + // uint32 TrackKind = 3; + if (this->_internal_trackkind() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_trackkind(), target); + } + + // optional .messages.track.RadarTrack RadarTrack = 4; + if (_internal_has_radartrack()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::radartrack(this), + _Internal::radartrack(this).GetCachedSize(), target, stream); + } + + // optional .messages.track.ESMTrack ESMTrack = 5; + if (_internal_has_esmtrack()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::esmtrack(this), + _Internal::esmtrack(this).GetCachedSize(), target, stream); + } + + // .google.protobuf.Timestamp timestamp = 6; + if (this->_internal_has_timestamp()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(6, _Internal::timestamp(this), + _Internal::timestamp(this).GetCachedSize(), target, stream); + } + + // .google.protobuf.Duration duration = 7; + if (this->_internal_has_duration()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::duration(this), + _Internal::duration(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:messages.track.SensorTrack) + return target; +} + +size_t SensorTrack::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:messages.track.SensorTrack) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string SensorID = 2; + if (!this->_internal_sensorid().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_sensorid()); + } + + // .messages.track.Identifier EntityIdentifier = 1; + if (this->_internal_has_entityidentifier()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.entityidentifier_); + } + + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + // optional .messages.track.RadarTrack RadarTrack = 4; + if (cached_has_bits & 0x00000001u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.radartrack_); + } + + // optional .messages.track.ESMTrack ESMTrack = 5; + if (cached_has_bits & 0x00000002u) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.esmtrack_); + } + + } + // .google.protobuf.Timestamp timestamp = 6; + if (this->_internal_has_timestamp()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.timestamp_); + } + + // .google.protobuf.Duration duration = 7; + if (this->_internal_has_duration()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.duration_); + } + + // uint32 TrackKind = 3; + if (this->_internal_trackkind() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_trackkind()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SensorTrack::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + SensorTrack::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SensorTrack::GetClassData() const { return &_class_data_; } + + +void SensorTrack::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:messages.track.SensorTrack) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_sensorid().empty()) { + _this->_internal_set_sensorid(from._internal_sensorid()); + } + if (from._internal_has_entityidentifier()) { + _this->_internal_mutable_entityidentifier()->::messages::track::Identifier::MergeFrom( + from._internal_entityidentifier()); + } + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000003u) { + if (cached_has_bits & 0x00000001u) { + _this->_internal_mutable_radartrack()->::messages::track::RadarTrack::MergeFrom( + from._internal_radartrack()); + } + if (cached_has_bits & 0x00000002u) { + _this->_internal_mutable_esmtrack()->::messages::track::ESMTrack::MergeFrom( + from._internal_esmtrack()); + } + } + if (from._internal_has_timestamp()) { + _this->_internal_mutable_timestamp()->::PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom( + from._internal_timestamp()); + } + if (from._internal_has_duration()) { + _this->_internal_mutable_duration()->::PROTOBUF_NAMESPACE_ID::Duration::MergeFrom( + from._internal_duration()); + } + if (from._internal_trackkind() != 0) { + _this->_internal_set_trackkind(from._internal_trackkind()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void SensorTrack::CopyFrom(const SensorTrack& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:messages.track.SensorTrack) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SensorTrack::IsInitialized() const { + return true; +} + +void SensorTrack::InternalSwap(SensorTrack* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.sensorid_, lhs_arena, + &other->_impl_.sensorid_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SensorTrack, _impl_.trackkind_) + + sizeof(SensorTrack::_impl_.trackkind_) + - PROTOBUF_FIELD_OFFSET(SensorTrack, _impl_.entityidentifier_)>( + reinterpret_cast(&_impl_.entityidentifier_), + reinterpret_cast(&other->_impl_.entityidentifier_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SensorTrack::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SensorTrack_2eproto_getter, &descriptor_table_SensorTrack_2eproto_once, + file_level_metadata_SensorTrack_2eproto[0]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::messages::track::SensorTrack* +Arena::CreateMaybeMessage< ::messages::track::SensorTrack >(Arena* arena) { + return Arena::CreateMessageInternal< ::messages::track::SensorTrack >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/include/SimCore/Messages/Protos/SensorTrack.pb.h b/include/SimCore/Messages/Protos/SensorTrack.pb.h new file mode 100644 index 0000000..7f7e22d --- /dev/null +++ b/include/SimCore/Messages/Protos/SensorTrack.pb.h @@ -0,0 +1,852 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SensorTrack.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_SensorTrack_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_SensorTrack_2eproto + +#include +#include + +#include +#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 +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "Identifier.pb.h" +#include "RadarTrack.pb.h" +#include "ESMTrack.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_SensorTrack_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_SensorTrack_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_SensorTrack_2eproto; +namespace messages { +namespace track { +class SensorTrack; +struct SensorTrackDefaultTypeInternal; +extern SensorTrackDefaultTypeInternal _SensorTrack_default_instance_; +} // namespace track +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> ::messages::track::SensorTrack* Arena::CreateMaybeMessage<::messages::track::SensorTrack>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace messages { +namespace track { + +// =================================================================== + +class SensorTrack final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.track.SensorTrack) */ { + public: + inline SensorTrack() : SensorTrack(nullptr) {} + ~SensorTrack() override; + explicit PROTOBUF_CONSTEXPR SensorTrack(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + SensorTrack(const SensorTrack& from); + SensorTrack(SensorTrack&& from) noexcept + : SensorTrack() { + *this = ::std::move(from); + } + + inline SensorTrack& operator=(const SensorTrack& from) { + CopyFrom(from); + return *this; + } + inline SensorTrack& operator=(SensorTrack&& 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 SensorTrack& default_instance() { + return *internal_default_instance(); + } + static inline const SensorTrack* internal_default_instance() { + return reinterpret_cast( + &_SensorTrack_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(SensorTrack& a, SensorTrack& b) { + a.Swap(&b); + } + inline void Swap(SensorTrack* 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(SensorTrack* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SensorTrack* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const SensorTrack& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const SensorTrack& from) { + SensorTrack::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(SensorTrack* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "messages.track.SensorTrack"; + } + protected: + explicit SensorTrack(::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 { + kSensorIDFieldNumber = 2, + kEntityIdentifierFieldNumber = 1, + kRadarTrackFieldNumber = 4, + kESMTrackFieldNumber = 5, + kTimestampFieldNumber = 6, + kDurationFieldNumber = 7, + kTrackKindFieldNumber = 3, + }; + // string SensorID = 2; + void clear_sensorid(); + const std::string& sensorid() const; + template + void set_sensorid(ArgT0&& arg0, ArgT... args); + std::string* mutable_sensorid(); + PROTOBUF_NODISCARD std::string* release_sensorid(); + void set_allocated_sensorid(std::string* sensorid); + private: + const std::string& _internal_sensorid() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_sensorid(const std::string& value); + std::string* _internal_mutable_sensorid(); + public: + + // .messages.track.Identifier EntityIdentifier = 1; + bool has_entityidentifier() const; + private: + bool _internal_has_entityidentifier() const; + public: + void clear_entityidentifier(); + const ::messages::track::Identifier& entityidentifier() const; + PROTOBUF_NODISCARD ::messages::track::Identifier* release_entityidentifier(); + ::messages::track::Identifier* mutable_entityidentifier(); + void set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier); + private: + const ::messages::track::Identifier& _internal_entityidentifier() const; + ::messages::track::Identifier* _internal_mutable_entityidentifier(); + public: + void unsafe_arena_set_allocated_entityidentifier( + ::messages::track::Identifier* entityidentifier); + ::messages::track::Identifier* unsafe_arena_release_entityidentifier(); + + // optional .messages.track.RadarTrack RadarTrack = 4; + bool has_radartrack() const; + private: + bool _internal_has_radartrack() const; + public: + void clear_radartrack(); + const ::messages::track::RadarTrack& radartrack() const; + PROTOBUF_NODISCARD ::messages::track::RadarTrack* release_radartrack(); + ::messages::track::RadarTrack* mutable_radartrack(); + void set_allocated_radartrack(::messages::track::RadarTrack* radartrack); + private: + const ::messages::track::RadarTrack& _internal_radartrack() const; + ::messages::track::RadarTrack* _internal_mutable_radartrack(); + public: + void unsafe_arena_set_allocated_radartrack( + ::messages::track::RadarTrack* radartrack); + ::messages::track::RadarTrack* unsafe_arena_release_radartrack(); + + // optional .messages.track.ESMTrack ESMTrack = 5; + bool has_esmtrack() const; + private: + bool _internal_has_esmtrack() const; + public: + void clear_esmtrack(); + const ::messages::track::ESMTrack& esmtrack() const; + PROTOBUF_NODISCARD ::messages::track::ESMTrack* release_esmtrack(); + ::messages::track::ESMTrack* mutable_esmtrack(); + void set_allocated_esmtrack(::messages::track::ESMTrack* esmtrack); + private: + const ::messages::track::ESMTrack& _internal_esmtrack() const; + ::messages::track::ESMTrack* _internal_mutable_esmtrack(); + public: + void unsafe_arena_set_allocated_esmtrack( + ::messages::track::ESMTrack* esmtrack); + ::messages::track::ESMTrack* unsafe_arena_release_esmtrack(); + + // .google.protobuf.Timestamp timestamp = 6; + 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(); + + // .google.protobuf.Duration duration = 7; + bool has_duration() const; + private: + bool _internal_has_duration() const; + public: + void clear_duration(); + const ::PROTOBUF_NAMESPACE_ID::Duration& duration() const; + PROTOBUF_NODISCARD ::PROTOBUF_NAMESPACE_ID::Duration* release_duration(); + ::PROTOBUF_NAMESPACE_ID::Duration* mutable_duration(); + void set_allocated_duration(::PROTOBUF_NAMESPACE_ID::Duration* duration); + private: + const ::PROTOBUF_NAMESPACE_ID::Duration& _internal_duration() const; + ::PROTOBUF_NAMESPACE_ID::Duration* _internal_mutable_duration(); + public: + void unsafe_arena_set_allocated_duration( + ::PROTOBUF_NAMESPACE_ID::Duration* duration); + ::PROTOBUF_NAMESPACE_ID::Duration* unsafe_arena_release_duration(); + + // uint32 TrackKind = 3; + void clear_trackkind(); + uint32_t trackkind() const; + void set_trackkind(uint32_t value); + private: + uint32_t _internal_trackkind() const; + void _internal_set_trackkind(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:messages.track.SensorTrack) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr sensorid_; + ::messages::track::Identifier* entityidentifier_; + ::messages::track::RadarTrack* radartrack_; + ::messages::track::ESMTrack* esmtrack_; + ::PROTOBUF_NAMESPACE_ID::Timestamp* timestamp_; + ::PROTOBUF_NAMESPACE_ID::Duration* duration_; + uint32_t trackkind_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SensorTrack_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// SensorTrack + +// .messages.track.Identifier EntityIdentifier = 1; +inline bool SensorTrack::_internal_has_entityidentifier() const { + return this != internal_default_instance() && _impl_.entityidentifier_ != nullptr; +} +inline bool SensorTrack::has_entityidentifier() const { + return _internal_has_entityidentifier(); +} +inline const ::messages::track::Identifier& SensorTrack::_internal_entityidentifier() const { + const ::messages::track::Identifier* p = _impl_.entityidentifier_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_Identifier_default_instance_); +} +inline const ::messages::track::Identifier& SensorTrack::entityidentifier() const { + // @@protoc_insertion_point(field_get:messages.track.SensorTrack.EntityIdentifier) + return _internal_entityidentifier(); +} +inline void SensorTrack::unsafe_arena_set_allocated_entityidentifier( + ::messages::track::Identifier* entityidentifier) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); + } + _impl_.entityidentifier_ = entityidentifier; + if (entityidentifier) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.SensorTrack.EntityIdentifier) +} +inline ::messages::track::Identifier* SensorTrack::release_entityidentifier() { + + ::messages::track::Identifier* temp = _impl_.entityidentifier_; + _impl_.entityidentifier_ = 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::track::Identifier* SensorTrack::unsafe_arena_release_entityidentifier() { + // @@protoc_insertion_point(field_release:messages.track.SensorTrack.EntityIdentifier) + + ::messages::track::Identifier* temp = _impl_.entityidentifier_; + _impl_.entityidentifier_ = nullptr; + return temp; +} +inline ::messages::track::Identifier* SensorTrack::_internal_mutable_entityidentifier() { + + if (_impl_.entityidentifier_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::Identifier>(GetArenaForAllocation()); + _impl_.entityidentifier_ = p; + } + return _impl_.entityidentifier_; +} +inline ::messages::track::Identifier* SensorTrack::mutable_entityidentifier() { + ::messages::track::Identifier* _msg = _internal_mutable_entityidentifier(); + // @@protoc_insertion_point(field_mutable:messages.track.SensorTrack.EntityIdentifier) + return _msg; +} +inline void SensorTrack::set_allocated_entityidentifier(::messages::track::Identifier* entityidentifier) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.entityidentifier_); + } + if (entityidentifier) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(entityidentifier)); + if (message_arena != submessage_arena) { + entityidentifier = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, entityidentifier, submessage_arena); + } + + } else { + + } + _impl_.entityidentifier_ = entityidentifier; + // @@protoc_insertion_point(field_set_allocated:messages.track.SensorTrack.EntityIdentifier) +} + +// string SensorID = 2; +inline void SensorTrack::clear_sensorid() { + _impl_.sensorid_.ClearToEmpty(); +} +inline const std::string& SensorTrack::sensorid() const { + // @@protoc_insertion_point(field_get:messages.track.SensorTrack.SensorID) + return _internal_sensorid(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SensorTrack::set_sensorid(ArgT0&& arg0, ArgT... args) { + + _impl_.sensorid_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:messages.track.SensorTrack.SensorID) +} +inline std::string* SensorTrack::mutable_sensorid() { + std::string* _s = _internal_mutable_sensorid(); + // @@protoc_insertion_point(field_mutable:messages.track.SensorTrack.SensorID) + return _s; +} +inline const std::string& SensorTrack::_internal_sensorid() const { + return _impl_.sensorid_.Get(); +} +inline void SensorTrack::_internal_set_sensorid(const std::string& value) { + + _impl_.sensorid_.Set(value, GetArenaForAllocation()); +} +inline std::string* SensorTrack::_internal_mutable_sensorid() { + + return _impl_.sensorid_.Mutable(GetArenaForAllocation()); +} +inline std::string* SensorTrack::release_sensorid() { + // @@protoc_insertion_point(field_release:messages.track.SensorTrack.SensorID) + return _impl_.sensorid_.Release(); +} +inline void SensorTrack::set_allocated_sensorid(std::string* sensorid) { + if (sensorid != nullptr) { + + } else { + + } + _impl_.sensorid_.SetAllocated(sensorid, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.sensorid_.IsDefault()) { + _impl_.sensorid_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:messages.track.SensorTrack.SensorID) +} + +// uint32 TrackKind = 3; +inline void SensorTrack::clear_trackkind() { + _impl_.trackkind_ = 0u; +} +inline uint32_t SensorTrack::_internal_trackkind() const { + return _impl_.trackkind_; +} +inline uint32_t SensorTrack::trackkind() const { + // @@protoc_insertion_point(field_get:messages.track.SensorTrack.TrackKind) + return _internal_trackkind(); +} +inline void SensorTrack::_internal_set_trackkind(uint32_t value) { + + _impl_.trackkind_ = value; +} +inline void SensorTrack::set_trackkind(uint32_t value) { + _internal_set_trackkind(value); + // @@protoc_insertion_point(field_set:messages.track.SensorTrack.TrackKind) +} + +// optional .messages.track.RadarTrack RadarTrack = 4; +inline bool SensorTrack::_internal_has_radartrack() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + PROTOBUF_ASSUME(!value || _impl_.radartrack_ != nullptr); + return value; +} +inline bool SensorTrack::has_radartrack() const { + return _internal_has_radartrack(); +} +inline const ::messages::track::RadarTrack& SensorTrack::_internal_radartrack() const { + const ::messages::track::RadarTrack* p = _impl_.radartrack_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_RadarTrack_default_instance_); +} +inline const ::messages::track::RadarTrack& SensorTrack::radartrack() const { + // @@protoc_insertion_point(field_get:messages.track.SensorTrack.RadarTrack) + return _internal_radartrack(); +} +inline void SensorTrack::unsafe_arena_set_allocated_radartrack( + ::messages::track::RadarTrack* radartrack) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.radartrack_); + } + _impl_.radartrack_ = radartrack; + if (radartrack) { + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.SensorTrack.RadarTrack) +} +inline ::messages::track::RadarTrack* SensorTrack::release_radartrack() { + _impl_._has_bits_[0] &= ~0x00000001u; + ::messages::track::RadarTrack* temp = _impl_.radartrack_; + _impl_.radartrack_ = 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::track::RadarTrack* SensorTrack::unsafe_arena_release_radartrack() { + // @@protoc_insertion_point(field_release:messages.track.SensorTrack.RadarTrack) + _impl_._has_bits_[0] &= ~0x00000001u; + ::messages::track::RadarTrack* temp = _impl_.radartrack_; + _impl_.radartrack_ = nullptr; + return temp; +} +inline ::messages::track::RadarTrack* SensorTrack::_internal_mutable_radartrack() { + _impl_._has_bits_[0] |= 0x00000001u; + if (_impl_.radartrack_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::RadarTrack>(GetArenaForAllocation()); + _impl_.radartrack_ = p; + } + return _impl_.radartrack_; +} +inline ::messages::track::RadarTrack* SensorTrack::mutable_radartrack() { + ::messages::track::RadarTrack* _msg = _internal_mutable_radartrack(); + // @@protoc_insertion_point(field_mutable:messages.track.SensorTrack.RadarTrack) + return _msg; +} +inline void SensorTrack::set_allocated_radartrack(::messages::track::RadarTrack* radartrack) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.radartrack_); + } + if (radartrack) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(radartrack)); + if (message_arena != submessage_arena) { + radartrack = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, radartrack, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000001u; + } else { + _impl_._has_bits_[0] &= ~0x00000001u; + } + _impl_.radartrack_ = radartrack; + // @@protoc_insertion_point(field_set_allocated:messages.track.SensorTrack.RadarTrack) +} + +// optional .messages.track.ESMTrack ESMTrack = 5; +inline bool SensorTrack::_internal_has_esmtrack() const { + bool value = (_impl_._has_bits_[0] & 0x00000002u) != 0; + PROTOBUF_ASSUME(!value || _impl_.esmtrack_ != nullptr); + return value; +} +inline bool SensorTrack::has_esmtrack() const { + return _internal_has_esmtrack(); +} +inline const ::messages::track::ESMTrack& SensorTrack::_internal_esmtrack() const { + const ::messages::track::ESMTrack* p = _impl_.esmtrack_; + return p != nullptr ? *p : reinterpret_cast( + ::messages::track::_ESMTrack_default_instance_); +} +inline const ::messages::track::ESMTrack& SensorTrack::esmtrack() const { + // @@protoc_insertion_point(field_get:messages.track.SensorTrack.ESMTrack) + return _internal_esmtrack(); +} +inline void SensorTrack::unsafe_arena_set_allocated_esmtrack( + ::messages::track::ESMTrack* esmtrack) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.esmtrack_); + } + _impl_.esmtrack_ = esmtrack; + if (esmtrack) { + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.SensorTrack.ESMTrack) +} +inline ::messages::track::ESMTrack* SensorTrack::release_esmtrack() { + _impl_._has_bits_[0] &= ~0x00000002u; + ::messages::track::ESMTrack* temp = _impl_.esmtrack_; + _impl_.esmtrack_ = 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::track::ESMTrack* SensorTrack::unsafe_arena_release_esmtrack() { + // @@protoc_insertion_point(field_release:messages.track.SensorTrack.ESMTrack) + _impl_._has_bits_[0] &= ~0x00000002u; + ::messages::track::ESMTrack* temp = _impl_.esmtrack_; + _impl_.esmtrack_ = nullptr; + return temp; +} +inline ::messages::track::ESMTrack* SensorTrack::_internal_mutable_esmtrack() { + _impl_._has_bits_[0] |= 0x00000002u; + if (_impl_.esmtrack_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::ESMTrack>(GetArenaForAllocation()); + _impl_.esmtrack_ = p; + } + return _impl_.esmtrack_; +} +inline ::messages::track::ESMTrack* SensorTrack::mutable_esmtrack() { + ::messages::track::ESMTrack* _msg = _internal_mutable_esmtrack(); + // @@protoc_insertion_point(field_mutable:messages.track.SensorTrack.ESMTrack) + return _msg; +} +inline void SensorTrack::set_allocated_esmtrack(::messages::track::ESMTrack* esmtrack) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.esmtrack_); + } + if (esmtrack) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(esmtrack)); + if (message_arena != submessage_arena) { + esmtrack = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, esmtrack, submessage_arena); + } + _impl_._has_bits_[0] |= 0x00000002u; + } else { + _impl_._has_bits_[0] &= ~0x00000002u; + } + _impl_.esmtrack_ = esmtrack; + // @@protoc_insertion_point(field_set_allocated:messages.track.SensorTrack.ESMTrack) +} + +// .google.protobuf.Timestamp timestamp = 6; +inline bool SensorTrack::_internal_has_timestamp() const { + return this != internal_default_instance() && _impl_.timestamp_ != nullptr; +} +inline bool SensorTrack::has_timestamp() const { + return _internal_has_timestamp(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& SensorTrack::_internal_timestamp() const { + const ::PROTOBUF_NAMESPACE_ID::Timestamp* p = _impl_.timestamp_; + return p != nullptr ? *p : reinterpret_cast( + ::PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const ::PROTOBUF_NAMESPACE_ID::Timestamp& SensorTrack::timestamp() const { + // @@protoc_insertion_point(field_get:messages.track.SensorTrack.timestamp) + return _internal_timestamp(); +} +inline void SensorTrack::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.track.SensorTrack.timestamp) +} +inline ::PROTOBUF_NAMESPACE_ID::Timestamp* SensorTrack::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* SensorTrack::unsafe_arena_release_timestamp() { + // @@protoc_insertion_point(field_release:messages.track.SensorTrack.timestamp) + + ::PROTOBUF_NAMESPACE_ID::Timestamp* temp = _impl_.timestamp_; + _impl_.timestamp_ = nullptr; + return temp; +} +inline ::PROTOBUF_NAMESPACE_ID::Timestamp* SensorTrack::_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* SensorTrack::mutable_timestamp() { + ::PROTOBUF_NAMESPACE_ID::Timestamp* _msg = _internal_mutable_timestamp(); + // @@protoc_insertion_point(field_mutable:messages.track.SensorTrack.timestamp) + return _msg; +} +inline void SensorTrack::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.track.SensorTrack.timestamp) +} + +// .google.protobuf.Duration duration = 7; +inline bool SensorTrack::_internal_has_duration() const { + return this != internal_default_instance() && _impl_.duration_ != nullptr; +} +inline bool SensorTrack::has_duration() const { + return _internal_has_duration(); +} +inline const ::PROTOBUF_NAMESPACE_ID::Duration& SensorTrack::_internal_duration() const { + const ::PROTOBUF_NAMESPACE_ID::Duration* p = _impl_.duration_; + return p != nullptr ? *p : reinterpret_cast( + ::PROTOBUF_NAMESPACE_ID::_Duration_default_instance_); +} +inline const ::PROTOBUF_NAMESPACE_ID::Duration& SensorTrack::duration() const { + // @@protoc_insertion_point(field_get:messages.track.SensorTrack.duration) + return _internal_duration(); +} +inline void SensorTrack::unsafe_arena_set_allocated_duration( + ::PROTOBUF_NAMESPACE_ID::Duration* duration) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.duration_); + } + _impl_.duration_ = duration; + if (duration) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:messages.track.SensorTrack.duration) +} +inline ::PROTOBUF_NAMESPACE_ID::Duration* SensorTrack::release_duration() { + + ::PROTOBUF_NAMESPACE_ID::Duration* temp = _impl_.duration_; + _impl_.duration_ = 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::Duration* SensorTrack::unsafe_arena_release_duration() { + // @@protoc_insertion_point(field_release:messages.track.SensorTrack.duration) + + ::PROTOBUF_NAMESPACE_ID::Duration* temp = _impl_.duration_; + _impl_.duration_ = nullptr; + return temp; +} +inline ::PROTOBUF_NAMESPACE_ID::Duration* SensorTrack::_internal_mutable_duration() { + + if (_impl_.duration_ == nullptr) { + auto* p = CreateMaybeMessage<::PROTOBUF_NAMESPACE_ID::Duration>(GetArenaForAllocation()); + _impl_.duration_ = p; + } + return _impl_.duration_; +} +inline ::PROTOBUF_NAMESPACE_ID::Duration* SensorTrack::mutable_duration() { + ::PROTOBUF_NAMESPACE_ID::Duration* _msg = _internal_mutable_duration(); + // @@protoc_insertion_point(field_mutable:messages.track.SensorTrack.duration) + return _msg; +} +inline void SensorTrack::set_allocated_duration(::PROTOBUF_NAMESPACE_ID::Duration* duration) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.duration_); + } + if (duration) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena( + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(duration)); + if (message_arena != submessage_arena) { + duration = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, duration, submessage_arena); + } + + } else { + + } + _impl_.duration_ = duration; + // @@protoc_insertion_point(field_set_allocated:messages.track.SensorTrack.duration) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) + +} // namespace track +} // namespace messages + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_SensorTrack_2eproto diff --git a/include/SimCore/Messages/Protos/SensorTrack.proto b/include/SimCore/Messages/Protos/SensorTrack.proto new file mode 100644 index 0000000..2fef85a --- /dev/null +++ b/include/SimCore/Messages/Protos/SensorTrack.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package messages.track; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "Identifier.proto"; + +import "RadarTrack.proto"; +import "ESMTrack.proto"; + + +// [END declaration] + + +message SensorTrack { + + messages.track.Identifier EntityIdentifier = 1; + + string SensorID = 2; + uint32 TrackKind = 3 ; + optional messages.track.RadarTrack RadarTrack = 4; + optional messages.track.ESMTrack ESMTrack = 5; + + google.protobuf.Timestamp timestamp = 6; + google.protobuf.Duration duration = 7; +} \ No newline at end of file diff --git a/include/SimCore/Messages/RadarTrack.hpp b/include/SimCore/Messages/RadarTrack.hpp index c4d19e9..cb7ac1a 100644 --- a/include/SimCore/Messages/RadarTrack.hpp +++ b/include/SimCore/Messages/RadarTrack.hpp @@ -6,7 +6,9 @@ #include "google/protobuf/any.pb.h" #include #include -#include + +#include + #include @@ -18,11 +20,10 @@ namespace SimCore { -class RadarTrack : public WHISPER::Message { +class RadarTrack : public Track { private: - /// message object from google protobuf - messages::track::RadarTrack radarTrackMessage_; + /// position of the track Position position_; @@ -30,39 +31,32 @@ private: double speed_ = 0; /// course of the track double course_ = 0; - /// indicates if track is from an external source /// bearing double bearing_; ///range in meters double range_; //environment (AIR,SURFACE,SUBSURFACE,SPACE) - SimCore::ContactEnvironment environemnt_; + SimCore::EntityKind environemnt_; - /// function that packs all information to a protobuf message - void packToMessage(); - - /// ID of the object - SimCore::Identifier ID_; public: - /** - * @brief a cuntructor that builds the object from a received message - * @param std::string the received thring from the line - */ - RadarTrack(std::string receivedMessage); + /** * @brief constructor for building a track which is also the trackmessage to * send - * @param uint32_t deviceID the id of the sending device * @param WHISPER::SourceType sourcetype of the sending device * @param SimCore::Identifier object identifier * * @return */ - RadarTrack(std::uint32_t deviceID, WHISPER::SourceType src,SimCore::Identifier id); + RadarTrack(WHISPER::SourceType src,SimCore::Identifier id); + + + virtual WHISPER::Message buildMessage(SimCore::Identifier parentID) override; + /** * @brief set the position of the track @@ -116,14 +110,16 @@ public: double getRange(); /// set course - void setEnvironment(SimCore::ContactEnvironment); + void setEnvironment(SimCore::EntityKind); /// returns course - SimCore::ContactEnvironment getEnvironment(); + SimCore::EntityKind getEnvironment(); /// set external indicator void setExternal(bool val); - SimCore::Identifier getIdentifier(); + static RadarTrack unpack(WHISPER::Message msg); + + }; } // namespace SimCore \ No newline at end of file diff --git a/include/SimCore/Messages/SensorTrack.hpp b/include/SimCore/Messages/SensorTrack.hpp new file mode 100644 index 0000000..fba01ae --- /dev/null +++ b/include/SimCore/Messages/SensorTrack.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include "SimCore/Identifier.hpp" +#include "SimCore/Messages/Protos/SensorTrack.pb.h" +#include "SimCore/SimCore.hpp" +#include "WHISPER/Messages/Message.hpp" +#include + +#include + + +namespace SimCore +{ + + class SensorTrack : public WHISPER::Message + { + private: + + /// ID of the object + SimCore::Identifier ID_; + + + + protected: + + + void setID(SimCore::Identifier id); + + + /// message object from google protobuf + messages::track::SensorTrack sensorTrackMessage_; + + public: + SensorTrack(); + SensorTrack(WHISPER::Message receivedMessageObj); + + SensorTrack(WHISPER::SourceType src,SimCore::Identifier id,SimCore::TrackKind trackkind); + + SimCore::TrackKind trackKind_ = UNKNOWN_TRACK; + + SimCore::Identifier getID(); + + + }; + + +} \ No newline at end of file diff --git a/include/SimCore/Messages/Track.hpp b/include/SimCore/Messages/Track.hpp index e21767f..6c36d03 100644 --- a/include/SimCore/Messages/Track.hpp +++ b/include/SimCore/Messages/Track.hpp @@ -2,6 +2,7 @@ #include "SimCore/Identifier.hpp" +#include "SimCore/SimCore.hpp" #include "google/protobuf/any.pb.h" #include #include @@ -21,38 +22,21 @@ namespace SimCore { - class Track : public WHISPER::Message + class Track { - private: - /// message object from google protobuf - messages::track::Track trackMessage_; - - /// position of the track - Position position_; - /// speed the track - double speed_ = 0; - /// course of the track - double course_ = 0; - /// indicates if track is from an external source - bool external_ = false; - - /// function that packs all information to a protobuf message - void packToMessage(); - + private: /// ID of the object - SimCore::Identifier ID_; + const SimCore::Identifier ID_; + const SimCore::TrackKind TrackKind_ = UNKNOWN_TRACK; + + + const WHISPER::SourceType SourceType_; + public: - Track(){}; - /** - * @brief a cuntructor that builds the object from a received message - * @param std::string the received thring from the line - */ - Track(std::string receivedMessage); - /** * @brief constructor for building a track which is also the trackmessage to send * @param WHISPER::SourceType sourcetype of the sending device @@ -60,65 +44,21 @@ namespace SimCore { * * @return */ - Track( WHISPER::SourceType src,SimCore::Identifier id); + Track( WHISPER::SourceType src,SimCore::Identifier id, SimCore::TrackKind trackkind); - /** - * @brief constructor for building a track which is also the trackmessage to send - * @param WHISPER::SourceType sourcetype of the sending device - * @param SimCore::Identifier object identifier - * @param WHISPER::MsgType other message type than RawTrack - * - * @return - */ - Track( WHISPER::SourceType src,SimCore::Identifier id, WHISPER::MsgType type); + + + const SimCore::Identifier getIdentifier(); + + const SimCore::TrackKind getTrackkind(); + + const WHISPER::SourceType getSourceType(); - /** - * @brief set the position of the track - * @param Position object of the position class - * - */ - void setPosition(Position pos); + protected: - /** - * @brief set the position of the track - * @param 3x double set the x,y,z coordinates direkt which causes that an object of position class is created - */ - void setPosition(double x,double y,double z); - - /** - * @brief returns the position - * @return object of position class - * - */ - Position getPostion(); - - /// sets speed - void setSpeed(double speed); - - /// set speed in knots - void setSpeedinKnots(double knots); - - /// return sspeed - double getSpeed(); - - /// returns speed as knots - double getSpeedinKnots(); - - /// set course - void setCourse(double course); - - ///returns course - double getCourse(); + virtual WHISPER::Message buildMessage(SimCore::Identifier parentID) = 0; - /// set external indicator - void setExternal(bool val); - - /// return true if is external - bool isExternal(); - - SimCore::Identifier getIdentifier(); - diff --git a/include/SimCore/SimCore.hpp b/include/SimCore/SimCore.hpp index 1aad50a..0981046 100644 --- a/include/SimCore/SimCore.hpp +++ b/include/SimCore/SimCore.hpp @@ -28,12 +28,13 @@ INTERNAL = false }; -enum ContactEnvironment : std::uint8_t{ +enum EntityKind : std::uint8_t{ UNKNOWN = 0, SURFACE = 1, SUBSURFACE = 2, AIR = 3, - SPACE = 4 + LAND = 4, + SPACE = 5 }; @@ -44,5 +45,27 @@ enum SensorKinds : std::uint32_t { VISUAL }; +enum EffectorKind : std::uint32_t { + VLS = 1, + GUN, + TORPEDO, + +}; + +enum TrackKind : std::uint8_t { + UNKNOWN_TRACK, + GROUND_TRUTH_TRACK, + OWN_TRACK, + RADAR_TRACK, + VISUAL_TRACK, + ESM_TRACK + +}; + + + + + + } \ No newline at end of file diff --git a/include/SimCore/Templates/Entity.hpp b/include/SimCore/Templates/Entity.hpp new file mode 100644 index 0000000..699fb9c --- /dev/null +++ b/include/SimCore/Templates/Entity.hpp @@ -0,0 +1,116 @@ +#pragma once + + + +#include "SimCore/Messages/GroundThruthTrack.hpp" +#include "SimCore/Messages/Track.hpp" +#include "SimCore/SafeMap.hpp" +#include "SimCore/SimCore.hpp" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace SimCore { + + struct SensorData + { + std::string SensorName; + bool isActive; + SimCore::Identifier SensorID; + std::shared_ptr SensorSender; + }; + + struct EffectorData + { + std::string EffectorName; + bool isActive; + SimCore::Identifier EffectorID; + std::shared_ptr EffectorSender; + }; + + + + class Entity { + public: + Entity(const SimCore::Identifier OwnID, + std::string EnttityName, + WHISPER::SourceType OwnType, + SimCore::Identifier ParentID, + SimCore::EntityKind EntityKind, + std::uint32_t GroundTruthPort, + std::uint32_t CommandPort, + std::string CommandIPAddress); + // ~Entity(); + void start(); + void stop(); + + + protected: + + std::shared_ptr> incommingCommandMessages = nullptr; + std::shared_ptr> outgoingCommandMessages = nullptr; + + virtual void specificPhysicsCalculations(std::chrono::milliseconds::rep duration) = 0; + virtual void specificReloadCharacteristicts() = 0; + + std::shared_ptr ownShipPosition_ = nullptr; + + private: + + std::string EntityName_; + + + + + SimCore::GroundTruthTrack ownTrack_; + SimCore::Identifier ParentID_; + SimCore::EntityKind EntityKind_; + std::uint32_t GroundTruthPort_; + std::uint32_t CommandPort_; + std::string CommandIPAddress_; + + + std::vector threads; + + + std::atomic stopCommandWorker = false; + std::atomic stopSensorWorker = false; + std::atomic stopTrackWorker = false; + std::atomic stopPhysicsWorker = false; + + + std::atomic physicsIsRunning = false; + + + void CommandWorker(); + void SensorWorker(); + void TrackWorker(); + void physicsWorker(); + + + void startSensor(); + + + + std::shared_ptr GroundTruthUDPSender_ = nullptr; + + std::shared_ptr> SensorStore_; + + std::shared_ptr>> Trackstore_; + + + }; +} \ No newline at end of file diff --git a/include/SimCore/Sensor.hpp b/include/SimCore/Templates/Sensor.hpp similarity index 93% rename from include/SimCore/Sensor.hpp rename to include/SimCore/Templates/Sensor.hpp index e215426..05dbb1a 100644 --- a/include/SimCore/Sensor.hpp +++ b/include/SimCore/Templates/Sensor.hpp @@ -2,6 +2,7 @@ +#include "SimCore/Messages/GroundThruthTrack.hpp" #include "SimCore/Messages/Track.hpp" #include #include @@ -24,7 +25,7 @@ namespace SimCore { void stop(); protected: - std::shared_ptr> incommingTrackMessages = nullptr; + std::shared_ptr> incommingTrackMessages = nullptr; std::shared_ptr> incommingGroundThruthMessages = nullptr; diff --git a/include/SimCore/TrackFactory.hpp b/include/SimCore/TrackFactory.hpp new file mode 100644 index 0000000..f1c774d --- /dev/null +++ b/include/SimCore/TrackFactory.hpp @@ -0,0 +1,18 @@ +#pragma once + + + +#include + +namespace SimCore +{ + class TrackFactory + { + TrackFactory(); + ~TrackFactory(); + + public: + void work( WHISPER::Message msg); + }; + +} diff --git a/libs/whisper-com b/libs/whisper-com index 3474cbd..0222903 160000 --- a/libs/whisper-com +++ b/libs/whisper-com @@ -1 +1 @@ -Subproject commit 3474cbd5cb92d0c38e3187e309e347971161d073 +Subproject commit 0222903f464107bbbe6da62e3c72edeb5e708631 diff --git a/src/SimCore/Entity.cpp b/src/SimCore/Entity.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/src/SimCore/Identifier.cpp b/src/SimCore/Identifier.cpp index 1a43c4c..6c7eee4 100644 --- a/src/SimCore/Identifier.cpp +++ b/src/SimCore/Identifier.cpp @@ -39,12 +39,12 @@ return std::to_string(parent_) + StringDelimiter + std::to_string(number_) + Str } -std::uint32_t Identifier::getNumber() +std::uint32_t Identifier::getNumber() const { return number_; } -std::uint32_t Identifier::getParentNumber() +std::uint32_t Identifier::getParentNumber() const { return parent_; } @@ -60,7 +60,7 @@ bool Identifier::isValid() } -bool Identifier::isExternal() +bool Identifier::isExternal() const { if (external_ == true) { return true; diff --git a/src/SimCore/Messages/ESMTrack.cpp b/src/SimCore/Messages/ESMTrack.cpp new file mode 100644 index 0000000..c7cdc17 --- /dev/null +++ b/src/SimCore/Messages/ESMTrack.cpp @@ -0,0 +1,24 @@ +#include + + +namespace SimCore +{ + + ESMTrack::ESMTrack(WHISPER::SourceType src,SimCore::Identifier id): + Track(src,id,SimCore::TrackKind::RADAR_TRACK) + + { + + } + + WHISPER::Message ESMTrack::buildMessage(SimCore::Identifier parentID) + { + + + + } + + + + +} \ No newline at end of file diff --git a/src/SimCore/Messages/GroundThruthTrack.cpp b/src/SimCore/Messages/GroundThruthTrack.cpp new file mode 100644 index 0000000..884c8c1 --- /dev/null +++ b/src/SimCore/Messages/GroundThruthTrack.cpp @@ -0,0 +1,113 @@ +#include +#include +#include +#include +#include +#include +#include + + + + +namespace SimCore +{ + GroundTruthTrack::GroundTruthTrack(WHISPER::SourceType src,SimCore::Identifier id,SimCore::TrackKind kind):Track(src, id, kind) + { + + } + + WHISPER::Message GroundTruthTrack::buildMessage(SimCore::Identifier parentID) + { + WHISPER::Message msg(parentID.getParentNumber(), parentID.getNumber(),WHISPER::MsgTopics::TRACK , WHISPER::MsgType::GROUND_TRUTH_TRACK, WHISPER::SourceType::GATEWAY); + + + messages::track::GroundTruthTrack groundTruthTrack; + + groundTruthTrack.mutable_geocentricposition()->set_x(position_.getGeocentricPos()(SimCore::X)); + groundTruthTrack.mutable_geocentricposition()->set_y(position_.getGeocentricPos()(SimCore::Y)); + groundTruthTrack.mutable_geocentricposition()->set_z(position_.getGeocentricPos()(SimCore::Z)); + + groundTruthTrack.set_contactspeed(speed_); + groundTruthTrack.set_contactcourse(course_); + + + + groundTruthTrack.mutable_entityidentifier()->set_number(this->getIdentifier().getNumber()); + groundTruthTrack.mutable_entityidentifier()->set_external((uint32_t)this->getIdentifier().isExternal()); + groundTruthTrack.mutable_entityidentifier()->set_parent(this->getIdentifier().getParentNumber()); + + + groundTruthTrack.mutable_timestamp()->set_seconds(time(NULL)); + + auto any = std::make_shared(); + + any->PackFrom(groundTruthTrack); + msg.addPayLoad(any); + + return msg; + } + + void GroundTruthTrack::setPosition(Position pos) { + position_ = pos; + } + + void GroundTruthTrack::setPosition(double x, double y, double z) { + Position pos(x, y, z); + position_ = pos; + } + + Position GroundTruthTrack::getPostion() { return position_; } + + void GroundTruthTrack::setSpeed(double speed) { + speed_ = speed; + } + void GroundTruthTrack::setCourse(double course) { + course_ = course; + } + + void GroundTruthTrack::setSpeedinKnots(double knots) { + speed_ = knots / SimCore::MsKt; + } + + void GroundTruthTrack::setEnvironment(SimCore::EntityKind env ) + { + environemnt_ = env; + } + + double GroundTruthTrack::getSpeed() { return speed_; } + double GroundTruthTrack::getSpeedinKnots() { return speed_ * SimCore::MsKt; } + double GroundTruthTrack::getCourse() { return course_; } + SimCore::EntityKind GroundTruthTrack::getEnvironment(){ return environemnt_; } + + + + + GroundTruthTrack GroundTruthTrack::unpack(WHISPER::Message msg) + { + auto m = msg.getProtoMessage(); + + auto trackMsg = messages::track::GroundTruthTrack(); + if(m.payload().Is()) + { + m.payload().UnpackTo(&trackMsg); + } + SimCore::Identifier id(trackMsg.mutable_entityidentifier()->parent(),trackMsg.mutable_entityidentifier()->number(),trackMsg.mutable_entityidentifier()->external()); + GroundTruthTrack track((WHISPER::SourceType)m.sourcetype(), id,(SimCore::TrackKind)trackMsg.trackkind()); + if (trackMsg.has_geocentricposition()) + { + track.setPosition(trackMsg.mutable_geocentricposition()->x(), trackMsg.mutable_geocentricposition()->y(), trackMsg.mutable_geocentricposition()->z()); + } + if (trackMsg.has_contactcourse()) + { + track.setCourse(trackMsg.contactcourse()); + } + if (trackMsg.has_contactspeed()) + { + track.setSpeed(trackMsg.contactspeed()); + } + + + return track; + } + +} \ No newline at end of file diff --git a/src/SimCore/Messages/RadarTrack.cpp b/src/SimCore/Messages/RadarTrack.cpp index df45192..cde3772 100644 --- a/src/SimCore/Messages/RadarTrack.cpp +++ b/src/SimCore/Messages/RadarTrack.cpp @@ -1,10 +1,14 @@ -#include "SimCore/Identifier.hpp" -#include "SimCore/Messages/Protos/RadarTrack.pb.h" -#include "SimCore/Position.hpp" -#include "SimCore/SimCore.hpp" -#include "WHISPER/Messages/Message.hpp" -#include "google/protobuf/message.h" -#include "google/protobuf/timestamp.pb.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -14,133 +18,120 @@ namespace SimCore { -RadarTrack::RadarTrack(std::string receivedMessage) { - msg = messages::header::Message(); - try { - msg.ParseFromString(receivedMessage); - topic_ = msg.topic(); - sourceType_ = msg.sourcetype(); - msgType_ = msg.msgtype(); - auto trackMessage = messages::track::RadarTrack(); - if (msg.payload_size() == 1) { - if (msg.payload().begin()->Is()) { - msg.payload().begin()->UnpackTo(&trackMessage); - } - } - // messages::track::Identifier ID = trackMessage.entityidentifier(); - - ID_ = SimCore::Identifier(trackMessage.mutable_entityidentifier()->parent(), - trackMessage.mutable_entityidentifier()->number(), - (SimCore::ObjectSource)trackMessage.mutable_entityidentifier() - ->external()); - - speed_ = trackMessage.contactspeed(); - course_ = trackMessage.contactcourse(); - bearing_ = trackMessage.contactbearing(); - range_ = trackMessage.contactrange(); - - messages::track::EntityGeocentricPosition pos_temp = - trackMessage.geocentricposition(); - position_.setGeocentricPos(pos_temp.x(), pos_temp.y(), pos_temp.z()); - - } catch (const std::exception &e) { - LOG_S(ERROR) << e.what(); - } -} - -RadarTrack::RadarTrack(std::uint32_t deviceID, WHISPER::SourceType src, - SimCore::Identifier id) - : Message(id.getParentNumber(),id.getNumber(), WHISPER::MsgTopics::TRACK, WHISPER::RAW_TRACK, src), - ID_(id) { - - packToMessage(); -} - -void RadarTrack::packToMessage() { - - radarTrackMessage_.mutable_entityidentifier()->set_number(ID_.getNumber()); - radarTrackMessage_.mutable_entityidentifier()->set_external((uint32_t)ID_.isExternal()); - - radarTrackMessage_.mutable_geocentricposition()->set_x( - position_.getGeocentricPos()(SimCore::X)); - radarTrackMessage_.mutable_geocentricposition()->set_y( - position_.getGeocentricPos()(SimCore::Y)); - radarTrackMessage_.mutable_geocentricposition()->set_z( - position_.getGeocentricPos()(SimCore::Z)); - - radarTrackMessage_.mutable_entityidentifier()->set_number(ID_.getNumber()); +RadarTrack::RadarTrack( WHISPER::SourceType src,SimCore::Identifier id) + : Track(src,id,SimCore::TrackKind::RADAR_TRACK) + { - radarTrackMessage_.set_contactspeed(speed_); - radarTrackMessage_.set_contactcourse(course_); - radarTrackMessage_.set_contactbearing(bearing_); - radarTrackMessage_.set_contactrange(range_); - radarTrackMessage_.set_contactenvironemnt((uint32_t)environemnt_); + } - radarTrackMessage_.mutable_timestamp()->set_seconds(time(NULL)); +WHISPER::Message RadarTrack::buildMessage(SimCore::Identifier parentID) +{ + WHISPER::Message msg(parentID.getParentNumber(), parentID.getNumber(),WHISPER::MsgTopics::TRACK , WHISPER::MsgType::RADAR_TRACK, WHISPER::SourceType::SENSOR); - auto payloadMessage = std::make_shared(); + messages::track::RadarTrack radarTrack; - payloadMessage->PackFrom(radarTrackMessage_); - addPayLoad(payloadMessage); + radarTrack.mutable_geocentricposition()->set_x(position_.getGeocentricPos()(SimCore::X)); + radarTrack.mutable_geocentricposition()->set_y(position_.getGeocentricPos()(SimCore::Y)); + radarTrack.mutable_geocentricposition()->set_z(position_.getGeocentricPos()(SimCore::Z)); + + radarTrack.set_contactspeed(speed_); + radarTrack.set_contactcourse(course_); + radarTrack.set_contactbearing(bearing_); + radarTrack.set_contactrange(range_); + radarTrack.set_contactenvironemnt((uint32_t)environemnt_); + + messages::track::SensorTrack SensorTrack; + + SensorTrack.mutable_entityidentifier()->set_number(this->getIdentifier().getNumber()); + SensorTrack.mutable_entityidentifier()->set_external((uint32_t)this->getIdentifier().isExternal()); + SensorTrack.mutable_entityidentifier()->set_parent(this->getIdentifier().getParentNumber()); + + SensorTrack.mutable_radartrack()->CopyFrom(radarTrack); + SensorTrack.mutable_timestamp()->set_seconds(time(NULL)); + + auto any = std::make_shared(); + + any->PackFrom(SensorTrack); + msg.addPayLoad(any); + +return msg; } void RadarTrack::setPosition(Position pos) { position_ = pos; - packToMessage(); } void RadarTrack::setPosition(double x, double y, double z) { Position pos(x, y, z); position_ = pos; - packToMessage(); } Position RadarTrack::getPostion() { return position_; } void RadarTrack::setSpeed(double speed) { speed_ = speed; - packToMessage(); } void RadarTrack::setCourse(double course) { course_ = course; - packToMessage(); } void RadarTrack::setSpeedinKnots(double knots) { speed_ = knots / SimCore::MsKt; - packToMessage(); } void RadarTrack::setBearing(double bearing) { bearing_ = bearing; - packToMessage(); } void RadarTrack::setRange(double range) { range_ = range; - packToMessage(); } -void RadarTrack::setEnvironment(SimCore::ContactEnvironment env ) +void RadarTrack::setEnvironment(SimCore::EntityKind env ) { environemnt_ = env; - packToMessage(); } + + double RadarTrack::getSpeed() { return speed_; } double RadarTrack::getSpeedinKnots() { return speed_ * SimCore::MsKt; } double RadarTrack::getCourse() { return course_; } double RadarTrack::getBearing() { return bearing_; } double RadarTrack::getRange() { return range_; } -SimCore::ContactEnvironment RadarTrack::getEnvironment(){ return environemnt_; } +SimCore::EntityKind RadarTrack::getEnvironment(){ return environemnt_; } +RadarTrack RadarTrack::unpack(WHISPER::Message msg) +{ + auto m = msg.getProtoMessage(); + + auto SensortrackMsg = messages::track::SensorTrack(); + if(m.payload().Is()) + { + m.payload().UnpackTo(&SensortrackMsg); + } + SimCore::Identifier id(SensortrackMsg.mutable_entityidentifier()->parent(),SensortrackMsg.mutable_entityidentifier()->number(),SensortrackMsg.mutable_entityidentifier()->external()); + RadarTrack track((WHISPER::SourceType)m.sourcetype(), id); + + if (SensortrackMsg.has_radartrack()) + { + auto radarTrack = SensortrackMsg.radartrack(); -SimCore::Identifier RadarTrack::getIdentifier() { - return ID_; + track.setPosition(radarTrack.mutable_geocentricposition()->x(), radarTrack.mutable_geocentricposition()->y(), radarTrack.mutable_geocentricposition()->z()); + track.setCourse(radarTrack.contactcourse()); + track.setSpeed(radarTrack.contactspeed()); + track.setBearing(radarTrack.contactbearing()); + track.setEnvironment((SimCore::EntityKind)radarTrack.contactenvironemnt()); + + + } + + + return track; } } // namespace SimCore \ No newline at end of file diff --git a/src/SimCore/Messages/SensorTrack.cpp b/src/SimCore/Messages/SensorTrack.cpp new file mode 100644 index 0000000..9b8abe7 --- /dev/null +++ b/src/SimCore/Messages/SensorTrack.cpp @@ -0,0 +1,63 @@ +#include "SimCore/Identifier.hpp" +#include "WHISPER/Messages/Message.hpp" +#include + + + + +namespace SimCore +{ + SensorTrack::SensorTrack(WHISPER::SourceType src,SimCore::Identifier id,SimCore::TrackKind trackkind):trackKind_(trackkind),ID_(id), + Message(id.getParentNumber(),id.getNumber(),WHISPER::MsgTopics::TRACK,WHISPER::SENSOR_TRACK,src) + { + + } + SensorTrack::SensorTrack() + {} + + SensorTrack::SensorTrack(WHISPER::Message receivedMessageObj) + { + if (receivedMessageObj.msgType_ == WHISPER::MsgType::SENSOR_TRACK) + { + + msg = messages::header::Message(); + msg.ParseFromString(receivedMessageObj.serialize()); + topic_ = msg.topic(); + sourceType_ = msg.sourcetype(); + msgType_ = msg.msgtype(); + + + if (msg.mutable_payload()->Is()) + { + auto SensorTrackMessage = messages::track::SensorTrack(); + msg.mutable_payload()->UnpackTo(&SensorTrackMessage); + if (SensorTrackMessage.has_radartrack()) + { + + + } + }else if (msg.mutable_payload()->Is()) + { + auto trackMessage = new messages::track::RadarTrack(); + msg.mutable_payload()->UnpackTo(trackMessage); + + } + + + } + } + + + + void SensorTrack::setID(SimCore::Identifier id) + { + ID_ = id; + } + + SimCore::Identifier SensorTrack::getID() + { + return ID_; + } + +} + diff --git a/src/SimCore/Messages/Track.cpp b/src/SimCore/Messages/Track.cpp index 1a96060..238f45e 100644 --- a/src/SimCore/Messages/Track.cpp +++ b/src/SimCore/Messages/Track.cpp @@ -15,156 +15,26 @@ namespace SimCore { - Track::Track(std::string receivedMessage) - { - msg = messages::header::Message(); - try { - msg.ParseFromString(receivedMessage); - topic_ = msg.topic(); - sourceType_ = msg.sourcetype(); - msgType_ = msg.msgtype(); - - auto trackMessage = messages::track::Track(); - if ( msg.payload_size() == 1) { - if (msg.payload().begin()->Is()) { - msg.payload().begin()->UnpackTo(&trackMessage); - } - } - - ID_ = SimCore::Identifier(trackMessage.mutable_entityidentifier()->parent(), - trackMessage.mutable_entityidentifier()->number(), - (SimCore::ObjectSource)trackMessage.mutable_entityidentifier()->external()); - external_ = trackMessage.mutable_entityidentifier()->external(); - speed_ = trackMessage.speed(); - course_ = trackMessage.course(); - - messages::track::EntityGeocentricPosition pos_temp = trackMessage.geocentricposition(); - position_.setGeocentricPos(pos_temp.x(), pos_temp.y(),pos_temp.z()); - - - } catch (const std::exception& e) { - LOG_S(ERROR)<set_number(ID_.getNumber()); - trackMessage_.mutable_entityidentifier()->set_external(ID_.isExternal()); - - - trackMessage_.mutable_geocentricposition()->set_x(position_.getGeocentricPos()(SimCore::X)); - trackMessage_.mutable_geocentricposition()->set_y(position_.getGeocentricPos()(SimCore::Y)); - trackMessage_.mutable_geocentricposition()->set_z(position_.getGeocentricPos()(SimCore::Z)); - - - trackMessage_.mutable_entityidentifier()->set_external(external_); - trackMessage_.mutable_entityidentifier()->set_number(ID_.getNumber()); - - // trackMessage_.set_trackno(trackNo_); - // trackMessage_.set_external(external_); - trackMessage_.set_speed(speed_); - trackMessage_.set_course(course_); - - trackMessage_.mutable_timestamp()->set_seconds(time(NULL)); - - - - auto payloadMessage = std::make_shared(); - - payloadMessage->PackFrom(trackMessage_); - addPayLoad(payloadMessage); - - - } - - void Track::setPosition(Position pos) - { - position_ = pos; - packToMessage(); - - } - void Track::setPosition(double x,double y,double z) - { - Position pos(x,y,z); - position_ = pos; - packToMessage(); + Track::Track( WHISPER::SourceType src,SimCore::Identifier id, SimCore::TrackKind trackkind):ID_(id),TrackKind_(trackkind),SourceType_(src) + { } - - - Position Track::getPostion() - { - return position_; - } - - - void Track::setSpeed(double speed) - { - speed_ = speed; - packToMessage(); - } - void Track::setCourse(double course) - { - course_ = course; - packToMessage(); - } - - double Track::getSpeedinKnots() - { - return speed_ * SimCore::MsKt; - } - void Track::setSpeedinKnots(double knots) - { - speed_ = knots / SimCore::MsKt; - packToMessage(); - } - - void Track::setExternal(bool val) - { - external_ = val; - packToMessage(); - } - - double Track::getSpeed() - { - return speed_; - } - double Track::getCourse() - { - return course_; - } - bool Track::isExternal() - { - return external_; - } - - SimCore::Identifier Track::getIdentifier() + const SimCore::Identifier Track::getIdentifier () { return ID_; } + const SimCore::TrackKind Track::getTrackkind() + { + return TrackKind_; + } + const WHISPER::SourceType Track::getSourceType() + { + return SourceType_; + } diff --git a/src/SimCore/Templates/Entity.cpp b/src/SimCore/Templates/Entity.cpp new file mode 100644 index 0000000..dce4b7a --- /dev/null +++ b/src/SimCore/Templates/Entity.cpp @@ -0,0 +1,182 @@ +#include "WHISPER/InternalUDPListener.hpp" +#include "WHISPER/InternalUDPSender.hpp" +#include "WHISPER/Messages/Message.hpp" +#include "WHISPER/Messages/stringData.hpp" +#include "WHISPER/threadSafeQueue.hpp" +#include +#include + +#include +#include +#include + + + +#define calculationPeriode 100 + +namespace SimCore +{ + + Entity::Entity(const SimCore::Identifier OwnID, + std::string EnttityName, + WHISPER::SourceType OwnType, + SimCore::Identifier ParentID, + SimCore::EntityKind EntityKind, + std::uint32_t GroundTruthPort, + std::uint32_t CommandPort, + std::string CommandIPAddress):EntityName_(EnttityName), + ownTrack_(OwnType, OwnID, SimCore::TrackKind::GROUND_TRUTH_TRACK), + ParentID_(ParentID), + EntityKind_(EntityKind), + GroundTruthPort_(GroundTruthPort), + CommandPort_(CommandPort), + CommandIPAddress_(CommandIPAddress) + + { + + } + + void Entity::start() + { + + stopCommandWorker = false; + stopSensorWorker = false; + stopTrackWorker = false; + stopPhysicsWorker = false; + + threads.emplace_back(std::thread(&Entity::CommandWorker,this)); + threads.emplace_back(std::thread(&Entity::SensorWorker,this)); + threads.emplace_back(std::thread(&Entity::TrackWorker,this)); + threads.emplace_back(std::thread(&Entity::physicsWorker,this)); + + + } + + void Entity::stop() + { + stopCommandWorker = true; + stopSensorWorker = true; + stopTrackWorker = true; + stopPhysicsWorker = true; + // for (auto &th :threads) + // { + // if (th.joinable()) { + // th.join(); + // } + + // } + + + for (std::vector::iterator it = threads.begin(); it != threads.end();) + { + if (it->joinable()) + { + it->join(); + it = threads.erase(it); + } + + } + + LOG_S(ERROR)<< threads.size(); + + + + + } + + void Entity::physicsWorker() + { + physicsIsRunning = true; + + while (!stopPhysicsWorker) { + auto start = std::chrono::steady_clock::now(); + + + std::this_thread::sleep_for(std::chrono::milliseconds(calculationPeriode)); + + + auto end = std::chrono::steady_clock::now(); + std::chrono::milliseconds::rep duration = std::chrono::duration_cast(end - start).count(); + specificPhysicsCalculations(duration); + } + + physicsIsRunning = false; + } + + + + void Entity::CommandWorker() + { + auto CommandUDPListener = std::make_shared(CommandPort_) ; + auto receiverQueue = std::make_shared>(); + CommandUDPListener->connect(receiverQueue); + + + auto CommandUDPSender = std::make_shared(CommandIPAddress_,CommandPort_); + + + while (!stopCommandWorker) + { + if (receiverQueue->size() > 0) { + + auto msg = WHISPER::Message(); + receiverQueue->get(msg); + + switch (msg.msgType_) { + + case WHISPER::MsgType::STRINGDATA :{ + WHISPER::StringData stringMsg = WHISPER::StringData(msg.serialize()); + std::string str = stringMsg.data_; + break; + } + + case WHISPER::MsgType::COMMAND: { + WHISPER::StringData string = WHISPER::StringData(msg.serialize()); + break; + } + } + + } + + + LOG_S(INFO)<<"hello from command worker"; + std::this_thread::sleep_for(std::chrono::milliseconds(900)); + + } + + + } + + void Entity::SensorWorker() + { + + + while (!stopSensorWorker) + { + LOG_S(INFO)<<"hello from sensor worker"; + std::this_thread::sleep_for(std::chrono::milliseconds(900)); + + } + + } + + void Entity::TrackWorker() + { + while (!stopTrackWorker) + { + LOG_S(INFO)<<"hello from track worker"; + std::this_thread::sleep_for(std::chrono::milliseconds(900)); + + } + + } + + void Entity::startSensor() + { + + LOG_S(ERROR)<< "starting new pods is not implemented yet"; + } + + + +} \ No newline at end of file diff --git a/src/SimCore/Sensor.cpp b/src/SimCore/Templates/Sensor.cpp similarity index 92% rename from src/SimCore/Sensor.cpp rename to src/SimCore/Templates/Sensor.cpp index 6e34225..ddf06b1 100644 --- a/src/SimCore/Sensor.cpp +++ b/src/SimCore/Templates/Sensor.cpp @@ -1,9 +1,10 @@ +#include "SimCore/Messages/GroundThruthTrack.hpp" #include "SimCore/Messages/Track.hpp" #include "SimCore/Position.hpp" #include "SimCore/SimCore.hpp" #include "SimCore/UtilFunctions.hpp" #include "WHISPER/Messages/Message.hpp" -#include +#include #include namespace SimCore { @@ -22,7 +23,7 @@ namespace SimCore { incommingParentMessages = std::make_shared>(); outgoingParentMessages = std::make_shared>(); - incommingTrackMessages = std::make_shared>(); + incommingTrackMessages = std::make_shared>(); GroundTruthUDPService_ = std::make_shared(OwnID.getParentNumber(),OwnID.getNumber(),WHISPER::SENSOR,GroundTruthPort_,SimCore::UtilFunctions::implode(ip,'.'),ownIP); @@ -119,9 +120,10 @@ namespace SimCore { if (incommingGroundThruthMessages->size() > 0) { WHISPER::Message msg; incommingGroundThruthMessages->get(msg); - if (msg.msgType_ == WHISPER::MsgType::RAW_TRACK) { - auto Track = SimCore::Track(msg.serialize()); - incommingTrackMessages->addElement(Track); + if (msg.msgType_ == WHISPER::MsgType::GROUND_TRUTH_TRACK) { + auto elem = GroundTruthTrack::unpack(msg); + // auto Track = SimCore::Track(msg.serialize()); + incommingTrackMessages->addElement(elem); } } @@ -152,7 +154,8 @@ namespace SimCore { std::uint32_t type = 0; if (msg.msgType_ == WHISPER::MsgType::OWN_TRACK) { - SimCore::Track OwnTrack(msg.serialize()); + auto OwnTrack = SimCore::GroundTruthTrack::unpack(msg); + // SimCore::Track OwnTrack(msg.serialize()); auto tmpPos = OwnTrack.getPostion().getGeocentricPos(); if (this->ownShipPosition_ == nullptr) { this->ownShipPosition_ = std::make_shared( diff --git a/tests/test_EntityClass.cpp b/tests/test_EntityClass.cpp new file mode 100644 index 0000000..3265110 --- /dev/null +++ b/tests/test_EntityClass.cpp @@ -0,0 +1,69 @@ + +#include "SimCore/Identifier.hpp" +#include "WHISPER/Messages/Message.hpp" +#include +#include +#include +#include +#define CATCH_CONFIG_MAIN +#include +#include + +// SimCore::Identifier OwnID, SimCore::Identifier ParentID, SimCore::SensorKinds SensorKind,std::uint32_t GroundTruthPort, std::uint32_t ParentPort,std::string ParentIPAddress +class Ship : public SimCore::Entity +{ + public: + Ship(SimCore::Identifier OwnID, + std::string EntityName, + WHISPER::SourceType ownType, + SimCore::Identifier ParentID, + SimCore::EntityKind EntityKind, + std::uint32_t GroundTruthPort, + std::uint32_t CommandPort, + std::string CommandIPAddress): + Entity( OwnID,EntityName,ownType, ParentID, EntityKind, GroundTruthPort, CommandPort, CommandIPAddress) + { + + } + + private: + + void specificPhysicsCalculations(std::chrono::milliseconds::rep duration) override + { + LOG_S(INFO)<<"calculating every " << duration << "milliseconds"; + }; + + void specificReloadCharacteristicts() override + { + LOG_S(INFO)<<"loading specifications"; + }; +}; + + + + +SCENARIO("Testing the SimCore Sensor") +{ + GIVEN("different Attributes for a Track in different forms") + { + SimCore::Identifier IDParent(0,1,false); + SimCore::Identifier ID1(0,2,false); + Ship Ship(ID1,"FGS Hamburg",WHISPER::SourceType::SHIP,IDParent,SimCore::EntityKind::SURFACE,8000,8001,"127.0.0.1"); + Ship.start(); + std::this_thread::sleep_for(std::chrono::milliseconds(5000)); + Ship.stop(); + WHEN("constructing Track Object with data") + { + + THEN("check if Track attributes are correct") + { + // REQUIRE(testOperator == true); + + + + + + } //THEN + } // WHEN + } // GIVEN +} //SCENARIO \ No newline at end of file diff --git a/tests/test_TrackClass.cpp b/tests/test_GroundTruthTrackClass.cpp similarity index 72% rename from tests/test_TrackClass.cpp rename to tests/test_GroundTruthTrackClass.cpp index 29f8e42..ca83e80 100644 --- a/tests/test_TrackClass.cpp +++ b/tests/test_GroundTruthTrackClass.cpp @@ -1,7 +1,9 @@ +#include "SimCore/Identifier.hpp" #include "SimCore/IdentifierMaker.hpp" -#include +#include #include #include +#include #include #define CATCH_CONFIG_MAIN #include @@ -29,7 +31,8 @@ SCENARIO("Testing the SimCore Track") std::shared_ptr msg = NULL; - std::shared_ptr trackPtr = NULL; + std::shared_ptr trackPtr = NULL; + SimCore::Identifier parentID(0,1,false); SimCore::IdentifierMaker IDMaker; auto ID = IDMaker.getNewIdentifier(1,SimCore::ObjectSource::EXTERNAL); @@ -39,24 +42,25 @@ SCENARIO("Testing the SimCore Track") WHEN("constructing Track Object with data") { SimCore::Position pos( GeocentPos1(SimCore::GeocentricPosition::X), GeocentPos1(SimCore::GeocentricPosition::Y), GeocentPos1(SimCore::GeocentricPosition::Z)); - SimCore::Track track(WHISPER::SourceType::SHIP,*ID.get()); + SimCore::GroundTruthTrack track(WHISPER::SourceType::SHIP,*ID.get(),SimCore::TrackKind::GROUND_TRUTH_TRACK); track.setCourse(course); track.setSpeed(speed); track.setPosition(GeocentPos1(SimCore::X),GeocentPos1(SimCore::Y),GeocentPos1(SimCore::Z)); if (track.getPostion() == pos) { - testOperator = true; + testOperator = true; } - serializedMSG = track.serialize(); + serializedMSG = track.buildMessage(parentID).serialize(); msg = std::make_shared(serializedMSG); - if (msg.get()->msgType_ == WHISPER::RAW_TRACK) { - trackPtr = std::make_shared(serializedMSG); + if (msg.get()->msgType_ == WHISPER::GROUND_TRUTH_TRACK) { + + trackPtr = std::make_shared(std::move(SimCore::GroundTruthTrack::unpack(*msg))); } - std::string trackstring = track.serialize(); + std::string trackstring = track.buildMessage(parentID).serialize(); - SimCore::Track trackDeserialized(trackstring); + SimCore::GroundTruthTrack trackDeserialized = SimCore::GroundTruthTrack::unpack(*msg); THEN("check if Track attributes are correct") @@ -67,7 +71,7 @@ SCENARIO("Testing the SimCore Track") REQUIRE(track.getSpeedinKnots() == knots); REQUIRE(track.getPostion().getGeocentricPos() == pos.getGeocentricPos()); - REQUIRE(msg.get()->msgType_ == WHISPER::RAW_TRACK); + REQUIRE(msg.get()->msgType_ == WHISPER::GROUND_TRUTH_TRACK); REQUIRE(trackPtr->getSpeed() == speed); REQUIRE(trackPtr->getPostion().getGeocentricPos() == GeocentPos1); REQUIRE(trackPtr->getIdentifier().getNumber() > 0); diff --git a/tests/test_RadarTrackClass.cpp b/tests/test_RadarTrackClass.cpp index a467795..ecc21e5 100644 --- a/tests/test_RadarTrackClass.cpp +++ b/tests/test_RadarTrackClass.cpp @@ -11,6 +11,7 @@ SCENARIO("Testing the SimCore Track") { GIVEN("different Attributes for a Track in different forms") { + SimCore::Identifier ParentID(0,1,false); Eigen::Vector3d GeocentPos1; GeocentPos1(SimCore::GeocentricPosition::X) = 3784014.333; GeocentPos1(SimCore::GeocentricPosition::Y) = 899869.779; @@ -23,41 +24,45 @@ SCENARIO("Testing the SimCore Track") { SimCore::IdentifierMaker IDMaker; std::shared_ptr ID = - IDMaker.getNewIdentifier(0,SimCore::ObjectSource::INTERNAL); + IDMaker.getNewIdentifier(ParentID.getNumber(),SimCore::ObjectSource::INTERNAL); LOG_S(INFO)<<"ID: " << ID->getNumber(); std::shared_ptr RadartrackPtr = - std::make_shared(1, WHISPER::SourceType::SENSOR, *ID.get()); + std::make_shared( WHISPER::SourceType::SENSOR, *ID.get()); RadartrackPtr->setPosition(pos); RadartrackPtr->setBearing(90); RadartrackPtr->setCourse(360); RadartrackPtr->setRange(1000); - RadartrackPtr->setEnvironment(SimCore::ContactEnvironment::SURFACE); + RadartrackPtr->setEnvironment(SimCore::EntityKind::SURFACE); bool isEqual = false; WHEN("constructing Track Object with data") { - std::string serializedMSG = RadartrackPtr->serialize(); - SimCore::RadarTrack radarTrack2(serializedMSG); + std::string serializedMSG = RadartrackPtr->buildMessage(ParentID).serialize(); - SimCore::Identifier ID1(radarTrack2.getIdentifier()); - auto tr0 = *RadartrackPtr.get(); - SimCore::Identifier ID2(tr0.getIdentifier()); + // SimCore::RadarTrack radarTrack2(serializedMSG); - LOG_S(INFO)<<"ID2 source: " << ID2.isExternal(); + // SimCore::Identifier ID1(radarTrack2.getID()); + + // auto tr0 = *RadartrackPtr.get(); + // SimCore::Identifier ID2(tr0.getID()); - if (ID1 == ID2) { - isEqual = true; - } + // LOG_S(INFO)<<"ID21 source: " << ID1.isExternal(); + + // LOG_S(INFO)<<"ID2 source: " << ID2.isExternal(); + + // if (ID1 == ID2) { + // isEqual = true; + // } THEN("check if Track attributes are correct") { - REQUIRE(RadartrackPtr->getIdentifier().getNumber() == 1); - REQUIRE(isEqual == true); - REQUIRE(radarTrack2.getIdentifier() == RadartrackPtr->getIdentifier()); - REQUIRE(radarTrack2.getIdentifier().getNumber() == RadartrackPtr->getIdentifier().getNumber()); - REQUIRE(radarTrack2.getPostion().getGeocentricPos() == RadartrackPtr->getPostion().getGeocentricPos()); + // REQUIRE(RadartrackPtr->getID().getNumber() == 1); + // REQUIRE(isEqual == true); + // REQUIRE(radarTrack2.getID() == RadartrackPtr->getID()); + // REQUIRE(radarTrack2.getID().getNumber() == RadartrackPtr->getID().getNumber()); + // REQUIRE(radarTrack2.getPostion().getGeocentricPos() == RadartrackPtr->getPostion().getGeocentricPos()); } // THEN } // WHEN diff --git a/tests/test_SensorClass.cpp b/tests/test_SensorClass.cpp index 83390eb..852b52f 100644 --- a/tests/test_SensorClass.cpp +++ b/tests/test_SensorClass.cpp @@ -5,7 +5,7 @@ #include #define CATCH_CONFIG_MAIN #include -#include +#include // SimCore::Identifier OwnID, SimCore::Identifier ParentID, SimCore::SensorKinds SensorKind,std::uint32_t GroundTruthPort, std::uint32_t ParentPort,std::string ParentIPAddress class Radar : public SimCore::Sensor diff --git a/tests/test_Trackstore.cpp b/tests/test_Trackstore.cpp new file mode 100644 index 0000000..9e07492 --- /dev/null +++ b/tests/test_Trackstore.cpp @@ -0,0 +1,78 @@ + +#include "SimCore/Identifier.hpp" +#include "SimCore/IdentifierMaker.hpp" +#include "SimCore/Messages/GroundThruthTrack.hpp" +#include "SimCore/Messages/SensorTrack.hpp" +#include "SimCore/Messages/Track.hpp" +#include "SimCore/SimCore.hpp" +#include "WHISPER/Messages/Message.hpp" +#include +#include +#include +#define CATCH_CONFIG_MAIN +#include +#include +#include + + + + + +SCENARIO("Testing the SimCore Track") +{ + GIVEN("different Attributes for a Track in different forms") + { + + std::vector> trackstore; + + SimCore::Identifier parentID(0,1,false); + + + SimCore::IdentifierMaker IDMaker; + auto ID1 = IDMaker.getNewIdentifier(1, SimCore::ObjectSource::INTERNAL); + auto ID2 = IDMaker.getNewIdentifier(1, SimCore::ObjectSource::INTERNAL); + + auto track = std::make_shared(WHISPER::SourceType::SENSOR,*ID1.get()); + track->setSpeed(100); + + trackstore.push_back(track); + + auto track2 = std::make_shared(WHISPER::SourceType::SENSOR,*ID2,SimCore::TrackKind::OWN_TRACK); + track2->setSpeed(50); + trackstore.push_back(track2); + + auto receivedTrack1 = trackstore[0]; + auto receivedTrack2 = trackstore[1]; + + + WHEN("constructing Track Object with data") + { + // auto rev = list.front(); + // LOG_S(INFO)<msgType_; + // // auto track2 = dynamic_pointer_cast(rev); + + + THEN("check if Track attributes are correct") + { + REQUIRE(trackstore.size() == 2); + + REQUIRE(receivedTrack1->getTrackkind() == SimCore::TrackKind::RADAR_TRACK); + + if (receivedTrack1->getTrackkind() == SimCore::TrackKind::RADAR_TRACK) { + auto radarTrackRecv1 = std::dynamic_pointer_cast(receivedTrack1); + REQUIRE(radarTrackRecv1->getSpeed() == 100); + + } + + REQUIRE(receivedTrack2->getTrackkind() == SimCore::TrackKind::OWN_TRACK); + // REQUIRE(track12->getSpeed() == 100); + + + + + + + } //THEN + } // WHEN + } // GIVEN +} //SCENARIO \ No newline at end of file