diff --git a/CMakeLists.txt b/CMakeLists.txt index 2137271..64e34a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,12 @@ add_library(SimCore STATIC include/SimCore/Messages/SensorTrack.hpp src/SimCore/Messages/SensorTrack.cpp - + + include/SimCore/Messages/SimTrack.hpp + src/SimCore/Messages/SimTrack.cpp + include/SimCore/Messages/Protos/SimTrack.pb.cc + + include/SimCore/Messages/Protos/Track.pb.cc include/SimCore/Messages/Protos/GeocentricPosition.pb.cc include/SimCore/Messages/Protos/Identifier.pb.cc @@ -62,6 +67,9 @@ add_library(SimCore STATIC include/SimCore/Messages/GroundThruthTrack.hpp src/SimCore/Messages/GroundThruthTrack.cpp + include/SimCore/data.hpp + + include/SimCore/Position.hpp src/SimCore/Position.cpp @@ -180,6 +188,13 @@ IF (${TEST_SIMCORE_LIBRARY}) add_executable(test_Trackstore tests/test_Trackstore.cpp) target_link_libraries(test_Trackstore Catch2::Catch2 SimCore loguru) catch_discover_tests(test_SensorClass) + + add_executable(test_DataClass tests/test_DataClass.cpp) + target_link_libraries(test_DataClass Catch2::Catch2 SimCore loguru) + catch_discover_tests(test_DataClass) + add_executable(test_TrackClass tests/test_TrackClass.cpp) + target_link_libraries(test_TrackClass Catch2::Catch2 SimCore loguru) + catch_discover_tests(test_TrackClass) ENDIF() diff --git a/include/SimCore/Messages/Protos/SimTrack.pb.cc b/include/SimCore/Messages/Protos/SimTrack.pb.cc new file mode 100644 index 0000000..42598e8 --- /dev/null +++ b/include/SimCore/Messages/Protos/SimTrack.pb.cc @@ -0,0 +1,956 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SimTrack.proto + +#include "SimTrack.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 SimTrack { +PROTOBUF_CONSTEXPR SimTrack::SimTrack( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.contactemissions_)*/{} + , /*decltype(_impl_.entityidentifier_)*/nullptr + , /*decltype(_impl_.geocentricposition_)*/nullptr + , /*decltype(_impl_.contactspeed_)*/0 + , /*decltype(_impl_.contactcourse_)*/0 + , /*decltype(_impl_.contactorigin_)*/0u + , /*decltype(_impl_.contactenvironemnt_)*/0u + , /*decltype(_impl_.contactbearing_)*/0 + , /*decltype(_impl_.contactrange_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct SimTrackDefaultTypeInternal { + PROTOBUF_CONSTEXPR SimTrackDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~SimTrackDefaultTypeInternal() {} + union { + SimTrack _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SimTrackDefaultTypeInternal _SimTrack_default_instance_; +PROTOBUF_CONSTEXPR Emission::Emission( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.frequency_)*/0u + , /*decltype(_impl_.frequencybandwith_)*/0u + , /*decltype(_impl_.pulsewidth_)*/0u + , /*decltype(_impl_.pulserepitition_)*/0u + , /*decltype(_impl_.radiatedpower_)*/0u + , /*decltype(_impl_.numberofbeams_)*/0u + , /*decltype(_impl_._cached_size_)*/{}} {} +struct EmissionDefaultTypeInternal { + PROTOBUF_CONSTEXPR EmissionDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~EmissionDefaultTypeInternal() {} + union { + Emission _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EmissionDefaultTypeInternal _Emission_default_instance_; +} // namespace SimTrack +} // namespace messages +static ::_pb::Metadata file_level_metadata_SimTrack_2eproto[2]; +static constexpr ::_pb::EnumDescriptor const** file_level_enum_descriptors_SimTrack_2eproto = nullptr; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_SimTrack_2eproto = nullptr; + +const uint32_t TableStruct_SimTrack_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.entityidentifier_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.contactorigin_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.geocentricposition_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.contactspeed_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.contactcourse_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.contactbearing_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.contactrange_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.contactenvironemnt_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::SimTrack, _impl_.contactemissions_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::Emission, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::Emission, _impl_.frequency_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::Emission, _impl_.frequencybandwith_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::Emission, _impl_.pulsewidth_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::Emission, _impl_.pulserepitition_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::Emission, _impl_.radiatedpower_), + PROTOBUF_FIELD_OFFSET(::messages::SimTrack::Emission, _impl_.numberofbeams_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::messages::SimTrack::SimTrack)}, + { 15, -1, -1, sizeof(::messages::SimTrack::Emission)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::messages::SimTrack::_SimTrack_default_instance_._instance, + &::messages::SimTrack::_Emission_default_instance_._instance, +}; + +const char descriptor_table_protodef_SimTrack_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\016SimTrack.proto\022\021messages.SimTrack\032\037goo" + "gle/protobuf/timestamp.proto\032\036google/pro" + "tobuf/duration.proto\032\020Identifier.proto\032\030" + "GeocentricPosition.proto\"\313\002\n\010SimTrack\0224\n" + "\020EntityIdentifier\030\001 \001(\0132\032.messages.track" + ".Identifier\022\025\n\rContactOrigin\030\002 \001(\r\022D\n\022Ge" + "ocentricPosition\030\003 \001(\0132(.messages.track." + "EntityGeocentricPosition\022\024\n\014ContactSpeed" + "\030\004 \001(\001\022\025\n\rContactCourse\030\005 \001(\001\022\026\n\016Contact" + "Bearing\030\006 \001(\001\022\024\n\014ContactRange\030\007 \001(\001\022\032\n\022C" + "ontactEnvironemnt\030\010 \001(\r\0225\n\020ContactEmissi" + "ons\030\t \003(\0132\033.messages.SimTrack.Emission\"\223" + "\001\n\010Emission\022\021\n\tfrequency\030\001 \001(\r\022\031\n\021freque" + "ncyBandWith\030\002 \001(\r\022\022\n\npulseWidth\030\003 \001(\r\022\027\n" + "\017pulseRepitition\030\004 \001(\r\022\025\n\rradiatedPower\030" + "\005 \001(\r\022\025\n\rnumberOfBeams\030\006 \001(\rb\006proto3" + ; +static const ::_pbi::DescriptorTable* const descriptor_table_SimTrack_2eproto_deps[4] = { + &::descriptor_table_GeocentricPosition_2eproto, + &::descriptor_table_Identifier_2eproto, + &::descriptor_table_google_2fprotobuf_2fduration_2eproto, + &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto, +}; +static ::_pbi::once_flag descriptor_table_SimTrack_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_SimTrack_2eproto = { + false, false, 636, descriptor_table_protodef_SimTrack_2eproto, + "SimTrack.proto", + &descriptor_table_SimTrack_2eproto_once, descriptor_table_SimTrack_2eproto_deps, 4, 2, + schemas, file_default_instances, TableStruct_SimTrack_2eproto::offsets, + file_level_metadata_SimTrack_2eproto, file_level_enum_descriptors_SimTrack_2eproto, + file_level_service_descriptors_SimTrack_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_SimTrack_2eproto_getter() { + return &descriptor_table_SimTrack_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_SimTrack_2eproto(&descriptor_table_SimTrack_2eproto); +namespace messages { +namespace SimTrack { + +// =================================================================== + +class SimTrack::_Internal { + public: + static const ::messages::track::Identifier& entityidentifier(const SimTrack* msg); + static const ::messages::track::EntityGeocentricPosition& geocentricposition(const SimTrack* msg); +}; + +const ::messages::track::Identifier& +SimTrack::_Internal::entityidentifier(const SimTrack* msg) { + return *msg->_impl_.entityidentifier_; +} +const ::messages::track::EntityGeocentricPosition& +SimTrack::_Internal::geocentricposition(const SimTrack* msg) { + return *msg->_impl_.geocentricposition_; +} +void SimTrack::clear_entityidentifier() { + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; +} +void SimTrack::clear_geocentricposition() { + if (GetArenaForAllocation() == nullptr && _impl_.geocentricposition_ != nullptr) { + delete _impl_.geocentricposition_; + } + _impl_.geocentricposition_ = nullptr; +} +SimTrack::SimTrack(::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.SimTrack.SimTrack) +} +SimTrack::SimTrack(const SimTrack& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + SimTrack* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.contactemissions_){from._impl_.contactemissions_} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.geocentricposition_){nullptr} + , decltype(_impl_.contactspeed_){} + , decltype(_impl_.contactcourse_){} + , decltype(_impl_.contactorigin_){} + , decltype(_impl_.contactenvironemnt_){} + , decltype(_impl_.contactbearing_){} + , decltype(_impl_.contactrange_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _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_); + } + ::memcpy(&_impl_.contactspeed_, &from._impl_.contactspeed_, + static_cast(reinterpret_cast(&_impl_.contactrange_) - + reinterpret_cast(&_impl_.contactspeed_)) + sizeof(_impl_.contactrange_)); + // @@protoc_insertion_point(copy_constructor:messages.SimTrack.SimTrack) +} + +inline void SimTrack::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.contactemissions_){arena} + , decltype(_impl_.entityidentifier_){nullptr} + , decltype(_impl_.geocentricposition_){nullptr} + , decltype(_impl_.contactspeed_){0} + , decltype(_impl_.contactcourse_){0} + , decltype(_impl_.contactorigin_){0u} + , decltype(_impl_.contactenvironemnt_){0u} + , decltype(_impl_.contactbearing_){0} + , decltype(_impl_.contactrange_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +SimTrack::~SimTrack() { + // @@protoc_insertion_point(destructor:messages.SimTrack.SimTrack) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void SimTrack::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.contactemissions_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.entityidentifier_; + if (this != internal_default_instance()) delete _impl_.geocentricposition_; +} + +void SimTrack::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void SimTrack::Clear() { +// @@protoc_insertion_point(message_clear_start:messages.SimTrack.SimTrack) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.contactemissions_.Clear(); + if (GetArenaForAllocation() == nullptr && _impl_.entityidentifier_ != nullptr) { + delete _impl_.entityidentifier_; + } + _impl_.entityidentifier_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.geocentricposition_ != nullptr) { + delete _impl_.geocentricposition_; + } + _impl_.geocentricposition_ = nullptr; + ::memset(&_impl_.contactspeed_, 0, static_cast( + reinterpret_cast(&_impl_.contactrange_) - + reinterpret_cast(&_impl_.contactspeed_)) + sizeof(_impl_.contactrange_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SimTrack::_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) { + // .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; + // uint32 ContactOrigin = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.contactorigin_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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; + // double ContactSpeed = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 33)) { + _impl_.contactspeed_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // double ContactCourse = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 41)) { + _impl_.contactcourse_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // double ContactBearing = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 49)) { + _impl_.contactbearing_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // double ContactRange = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 57)) { + _impl_.contactrange_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else + goto handle_unusual; + continue; + // uint32 ContactEnvironemnt = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { + _impl_.contactenvironemnt_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .messages.SimTrack.Emission ContactEmissions = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_contactemissions(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<74>(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* SimTrack::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:messages.SimTrack.SimTrack) + 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); + } + + // uint32 ContactOrigin = 2; + if (this->_internal_contactorigin() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_contactorigin(), target); + } + + // .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); + } + + // 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(); + uint64_t raw_contactspeed; + memcpy(&raw_contactspeed, &tmp_contactspeed, sizeof(tmp_contactspeed)); + if (raw_contactspeed != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(4, this->_internal_contactspeed(), target); + } + + // double ContactCourse = 5; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactcourse = this->_internal_contactcourse(); + uint64_t raw_contactcourse; + memcpy(&raw_contactcourse, &tmp_contactcourse, sizeof(tmp_contactcourse)); + if (raw_contactcourse != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(5, this->_internal_contactcourse(), target); + } + + // double ContactBearing = 6; + 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(6, this->_internal_contactbearing(), target); + } + + // double ContactRange = 7; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactrange = this->_internal_contactrange(); + uint64_t raw_contactrange; + memcpy(&raw_contactrange, &tmp_contactrange, sizeof(tmp_contactrange)); + if (raw_contactrange != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteDoubleToArray(7, this->_internal_contactrange(), target); + } + + // uint32 ContactEnvironemnt = 8; + if (this->_internal_contactenvironemnt() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_contactenvironemnt(), target); + } + + // repeated .messages.SimTrack.Emission ContactEmissions = 9; + for (unsigned i = 0, + n = static_cast(this->_internal_contactemissions_size()); i < n; i++) { + const auto& repfield = this->_internal_contactemissions(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(9, repfield, repfield.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.SimTrack.SimTrack) + return target; +} + +size_t SimTrack::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:messages.SimTrack.SimTrack) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .messages.SimTrack.Emission ContactEmissions = 9; + total_size += 1UL * this->_internal_contactemissions_size(); + for (const auto& msg : this->_impl_.contactemissions_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // .messages.track.Identifier EntityIdentifier = 1; + 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_); + } + + // 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(); + uint64_t raw_contactspeed; + memcpy(&raw_contactspeed, &tmp_contactspeed, sizeof(tmp_contactspeed)); + if (raw_contactspeed != 0) { + total_size += 1 + 8; + } + + // double ContactCourse = 5; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactcourse = this->_internal_contactcourse(); + uint64_t raw_contactcourse; + memcpy(&raw_contactcourse, &tmp_contactcourse, sizeof(tmp_contactcourse)); + if (raw_contactcourse != 0) { + total_size += 1 + 8; + } + + // uint32 ContactOrigin = 2; + if (this->_internal_contactorigin() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_contactorigin()); + } + + // uint32 ContactEnvironemnt = 8; + if (this->_internal_contactenvironemnt() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_contactenvironemnt()); + } + + // double ContactBearing = 6; + 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; + } + + // double ContactRange = 7; + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactrange = this->_internal_contactrange(); + uint64_t raw_contactrange; + memcpy(&raw_contactrange, &tmp_contactrange, sizeof(tmp_contactrange)); + if (raw_contactrange != 0) { + total_size += 1 + 8; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SimTrack::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + SimTrack::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SimTrack::GetClassData() const { return &_class_data_; } + + +void SimTrack::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.SimTrack.SimTrack) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.contactemissions_.MergeFrom(from._impl_.contactemissions_); + 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()); + } + 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; + memcpy(&raw_contactspeed, &tmp_contactspeed, sizeof(tmp_contactspeed)); + if (raw_contactspeed != 0) { + _this->_internal_set_contactspeed(from._internal_contactspeed()); + } + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactcourse = from._internal_contactcourse(); + uint64_t raw_contactcourse; + memcpy(&raw_contactcourse, &tmp_contactcourse, sizeof(tmp_contactcourse)); + if (raw_contactcourse != 0) { + _this->_internal_set_contactcourse(from._internal_contactcourse()); + } + if (from._internal_contactorigin() != 0) { + _this->_internal_set_contactorigin(from._internal_contactorigin()); + } + if (from._internal_contactenvironemnt() != 0) { + _this->_internal_set_contactenvironemnt(from._internal_contactenvironemnt()); + } + 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()); + } + static_assert(sizeof(uint64_t) == sizeof(double), "Code assumes uint64_t and double are the same size."); + double tmp_contactrange = from._internal_contactrange(); + uint64_t raw_contactrange; + memcpy(&raw_contactrange, &tmp_contactrange, sizeof(tmp_contactrange)); + if (raw_contactrange != 0) { + _this->_internal_set_contactrange(from._internal_contactrange()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void SimTrack::CopyFrom(const SimTrack& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:messages.SimTrack.SimTrack) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SimTrack::IsInitialized() const { + return true; +} + +void SimTrack::InternalSwap(SimTrack* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.contactemissions_.InternalSwap(&other->_impl_.contactemissions_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SimTrack, _impl_.contactrange_) + + sizeof(SimTrack::_impl_.contactrange_) + - PROTOBUF_FIELD_OFFSET(SimTrack, _impl_.entityidentifier_)>( + reinterpret_cast(&_impl_.entityidentifier_), + reinterpret_cast(&other->_impl_.entityidentifier_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SimTrack::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SimTrack_2eproto_getter, &descriptor_table_SimTrack_2eproto_once, + file_level_metadata_SimTrack_2eproto[0]); +} + +// =================================================================== + +class Emission::_Internal { + public: +}; + +Emission::Emission(::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.SimTrack.Emission) +} +Emission::Emission(const Emission& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Emission* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.frequency_){} + , decltype(_impl_.frequencybandwith_){} + , decltype(_impl_.pulsewidth_){} + , decltype(_impl_.pulserepitition_){} + , decltype(_impl_.radiatedpower_){} + , decltype(_impl_.numberofbeams_){} + , /*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_.numberofbeams_) - + reinterpret_cast(&_impl_.frequency_)) + sizeof(_impl_.numberofbeams_)); + // @@protoc_insertion_point(copy_constructor:messages.SimTrack.Emission) +} + +inline void Emission::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.frequency_){0u} + , decltype(_impl_.frequencybandwith_){0u} + , decltype(_impl_.pulsewidth_){0u} + , decltype(_impl_.pulserepitition_){0u} + , decltype(_impl_.radiatedpower_){0u} + , decltype(_impl_.numberofbeams_){0u} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Emission::~Emission() { + // @@protoc_insertion_point(destructor:messages.SimTrack.Emission) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Emission::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void Emission::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Emission::Clear() { +// @@protoc_insertion_point(message_clear_start:messages.SimTrack.Emission) + 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_.numberofbeams_) - + reinterpret_cast(&_impl_.frequency_)) + sizeof(_impl_.numberofbeams_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Emission::_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) { + // uint32 frequency = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint32 frequencyBandWith = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.frequencybandwith_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint32 pulseWidth = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.pulsewidth_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint32 pulseRepitition = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.pulserepitition_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint32 radiatedPower = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _impl_.radiatedpower_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint32 numberOfBeams = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _impl_.numberofbeams_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&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* Emission::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:messages.SimTrack.Emission) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 frequency = 1; + if (this->_internal_frequency() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_frequency(), target); + } + + // uint32 frequencyBandWith = 2; + if (this->_internal_frequencybandwith() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_frequencybandwith(), target); + } + + // uint32 pulseWidth = 3; + if (this->_internal_pulsewidth() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_pulsewidth(), target); + } + + // uint32 pulseRepitition = 4; + if (this->_internal_pulserepitition() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_pulserepitition(), target); + } + + // uint32 radiatedPower = 5; + if (this->_internal_radiatedpower() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_radiatedpower(), target); + } + + // uint32 numberOfBeams = 6; + if (this->_internal_numberofbeams() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_numberofbeams(), 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.SimTrack.Emission) + return target; +} + +size_t Emission::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:messages.SimTrack.Emission) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint32 frequency = 1; + if (this->_internal_frequency() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_frequency()); + } + + // uint32 frequencyBandWith = 2; + if (this->_internal_frequencybandwith() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_frequencybandwith()); + } + + // uint32 pulseWidth = 3; + if (this->_internal_pulsewidth() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_pulsewidth()); + } + + // uint32 pulseRepitition = 4; + if (this->_internal_pulserepitition() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_pulserepitition()); + } + + // uint32 radiatedPower = 5; + if (this->_internal_radiatedpower() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_radiatedpower()); + } + + // uint32 numberOfBeams = 6; + if (this->_internal_numberofbeams() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_numberofbeams()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Emission::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Emission::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Emission::GetClassData() const { return &_class_data_; } + + +void Emission::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.SimTrack.Emission) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_frequency() != 0) { + _this->_internal_set_frequency(from._internal_frequency()); + } + if (from._internal_frequencybandwith() != 0) { + _this->_internal_set_frequencybandwith(from._internal_frequencybandwith()); + } + if (from._internal_pulsewidth() != 0) { + _this->_internal_set_pulsewidth(from._internal_pulsewidth()); + } + if (from._internal_pulserepitition() != 0) { + _this->_internal_set_pulserepitition(from._internal_pulserepitition()); + } + if (from._internal_radiatedpower() != 0) { + _this->_internal_set_radiatedpower(from._internal_radiatedpower()); + } + if (from._internal_numberofbeams() != 0) { + _this->_internal_set_numberofbeams(from._internal_numberofbeams()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Emission::CopyFrom(const Emission& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:messages.SimTrack.Emission) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Emission::IsInitialized() const { + return true; +} + +void Emission::InternalSwap(Emission* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Emission, _impl_.numberofbeams_) + + sizeof(Emission::_impl_.numberofbeams_) + - PROTOBUF_FIELD_OFFSET(Emission, _impl_.frequency_)>( + reinterpret_cast(&_impl_.frequency_), + reinterpret_cast(&other->_impl_.frequency_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Emission::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_SimTrack_2eproto_getter, &descriptor_table_SimTrack_2eproto_once, + file_level_metadata_SimTrack_2eproto[1]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace SimTrack +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::messages::SimTrack::SimTrack* +Arena::CreateMaybeMessage< ::messages::SimTrack::SimTrack >(Arena* arena) { + return Arena::CreateMessageInternal< ::messages::SimTrack::SimTrack >(arena); +} +template<> PROTOBUF_NOINLINE ::messages::SimTrack::Emission* +Arena::CreateMaybeMessage< ::messages::SimTrack::Emission >(Arena* arena) { + return Arena::CreateMessageInternal< ::messages::SimTrack::Emission >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/include/SimCore/Messages/Protos/SimTrack.pb.h b/include/SimCore/Messages/Protos/SimTrack.pb.h new file mode 100644 index 0000000..1221e14 --- /dev/null +++ b/include/SimCore/Messages/Protos/SimTrack.pb.h @@ -0,0 +1,1013 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: SimTrack.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_SimTrack_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_SimTrack_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 "GeocentricPosition.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_SimTrack_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_SimTrack_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_SimTrack_2eproto; +namespace messages { +namespace SimTrack { +class Emission; +struct EmissionDefaultTypeInternal; +extern EmissionDefaultTypeInternal _Emission_default_instance_; +class SimTrack; +struct SimTrackDefaultTypeInternal; +extern SimTrackDefaultTypeInternal _SimTrack_default_instance_; +} // namespace SimTrack +} // namespace messages +PROTOBUF_NAMESPACE_OPEN +template<> ::messages::SimTrack::Emission* Arena::CreateMaybeMessage<::messages::SimTrack::Emission>(Arena*); +template<> ::messages::SimTrack::SimTrack* Arena::CreateMaybeMessage<::messages::SimTrack::SimTrack>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace messages { +namespace SimTrack { + +// =================================================================== + +class SimTrack final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.SimTrack.SimTrack) */ { + public: + inline SimTrack() : SimTrack(nullptr) {} + ~SimTrack() override; + explicit PROTOBUF_CONSTEXPR SimTrack(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + SimTrack(const SimTrack& from); + SimTrack(SimTrack&& from) noexcept + : SimTrack() { + *this = ::std::move(from); + } + + inline SimTrack& operator=(const SimTrack& from) { + CopyFrom(from); + return *this; + } + inline SimTrack& operator=(SimTrack&& 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 SimTrack& default_instance() { + return *internal_default_instance(); + } + static inline const SimTrack* internal_default_instance() { + return reinterpret_cast( + &_SimTrack_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(SimTrack& a, SimTrack& b) { + a.Swap(&b); + } + inline void Swap(SimTrack* 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(SimTrack* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SimTrack* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const SimTrack& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const SimTrack& from) { + SimTrack::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(SimTrack* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "messages.SimTrack.SimTrack"; + } + protected: + explicit SimTrack(::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 { + kContactEmissionsFieldNumber = 9, + kEntityIdentifierFieldNumber = 1, + kGeocentricPositionFieldNumber = 3, + kContactSpeedFieldNumber = 4, + kContactCourseFieldNumber = 5, + kContactOriginFieldNumber = 2, + kContactEnvironemntFieldNumber = 8, + kContactBearingFieldNumber = 6, + kContactRangeFieldNumber = 7, + }; + // repeated .messages.SimTrack.Emission ContactEmissions = 9; + int contactemissions_size() const; + private: + int _internal_contactemissions_size() const; + public: + void clear_contactemissions(); + ::messages::SimTrack::Emission* mutable_contactemissions(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::messages::SimTrack::Emission >* + mutable_contactemissions(); + private: + const ::messages::SimTrack::Emission& _internal_contactemissions(int index) const; + ::messages::SimTrack::Emission* _internal_add_contactemissions(); + public: + const ::messages::SimTrack::Emission& contactemissions(int index) const; + ::messages::SimTrack::Emission* add_contactemissions(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::messages::SimTrack::Emission >& + contactemissions() const; + + // .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(); + + // .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(); + + // double ContactSpeed = 4; + void clear_contactspeed(); + double contactspeed() const; + void set_contactspeed(double value); + private: + double _internal_contactspeed() const; + void _internal_set_contactspeed(double value); + public: + + // double ContactCourse = 5; + void clear_contactcourse(); + double contactcourse() const; + void set_contactcourse(double value); + private: + double _internal_contactcourse() const; + void _internal_set_contactcourse(double value); + public: + + // uint32 ContactOrigin = 2; + void clear_contactorigin(); + uint32_t contactorigin() const; + void set_contactorigin(uint32_t value); + private: + uint32_t _internal_contactorigin() const; + void _internal_set_contactorigin(uint32_t value); + public: + + // uint32 ContactEnvironemnt = 8; + void clear_contactenvironemnt(); + uint32_t contactenvironemnt() const; + void set_contactenvironemnt(uint32_t value); + private: + uint32_t _internal_contactenvironemnt() const; + void _internal_set_contactenvironemnt(uint32_t value); + public: + + // double ContactBearing = 6; + void clear_contactbearing(); + double contactbearing() const; + void set_contactbearing(double value); + private: + double _internal_contactbearing() const; + void _internal_set_contactbearing(double value); + public: + + // double ContactRange = 7; + void clear_contactrange(); + double contactrange() const; + void set_contactrange(double value); + private: + double _internal_contactrange() const; + void _internal_set_contactrange(double value); + public: + + // @@protoc_insertion_point(class_scope:messages.SimTrack.SimTrack) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::messages::SimTrack::Emission > contactemissions_; + ::messages::track::Identifier* entityidentifier_; + ::messages::track::EntityGeocentricPosition* geocentricposition_; + double contactspeed_; + double contactcourse_; + uint32_t contactorigin_; + uint32_t contactenvironemnt_; + double contactbearing_; + double contactrange_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SimTrack_2eproto; +}; +// ------------------------------------------------------------------- + +class Emission final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:messages.SimTrack.Emission) */ { + public: + inline Emission() : Emission(nullptr) {} + ~Emission() override; + explicit PROTOBUF_CONSTEXPR Emission(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Emission(const Emission& from); + Emission(Emission&& from) noexcept + : Emission() { + *this = ::std::move(from); + } + + inline Emission& operator=(const Emission& from) { + CopyFrom(from); + return *this; + } + inline Emission& operator=(Emission&& 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 Emission& default_instance() { + return *internal_default_instance(); + } + static inline const Emission* internal_default_instance() { + return reinterpret_cast( + &_Emission_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(Emission& a, Emission& b) { + a.Swap(&b); + } + inline void Swap(Emission* 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(Emission* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Emission* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Emission& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Emission& from) { + Emission::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(Emission* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "messages.SimTrack.Emission"; + } + protected: + explicit Emission(::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, + kFrequencyBandWithFieldNumber = 2, + kPulseWidthFieldNumber = 3, + kPulseRepititionFieldNumber = 4, + kRadiatedPowerFieldNumber = 5, + kNumberOfBeamsFieldNumber = 6, + }; + // uint32 frequency = 1; + void clear_frequency(); + uint32_t frequency() const; + void set_frequency(uint32_t value); + private: + uint32_t _internal_frequency() const; + void _internal_set_frequency(uint32_t value); + public: + + // uint32 frequencyBandWith = 2; + void clear_frequencybandwith(); + uint32_t frequencybandwith() const; + void set_frequencybandwith(uint32_t value); + private: + uint32_t _internal_frequencybandwith() const; + void _internal_set_frequencybandwith(uint32_t value); + public: + + // uint32 pulseWidth = 3; + void clear_pulsewidth(); + uint32_t pulsewidth() const; + void set_pulsewidth(uint32_t value); + private: + uint32_t _internal_pulsewidth() const; + void _internal_set_pulsewidth(uint32_t value); + public: + + // uint32 pulseRepitition = 4; + void clear_pulserepitition(); + uint32_t pulserepitition() const; + void set_pulserepitition(uint32_t value); + private: + uint32_t _internal_pulserepitition() const; + void _internal_set_pulserepitition(uint32_t value); + public: + + // uint32 radiatedPower = 5; + void clear_radiatedpower(); + uint32_t radiatedpower() const; + void set_radiatedpower(uint32_t value); + private: + uint32_t _internal_radiatedpower() const; + void _internal_set_radiatedpower(uint32_t value); + public: + + // uint32 numberOfBeams = 6; + void clear_numberofbeams(); + uint32_t numberofbeams() const; + void set_numberofbeams(uint32_t value); + private: + uint32_t _internal_numberofbeams() const; + void _internal_set_numberofbeams(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:messages.SimTrack.Emission) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + uint32_t frequency_; + uint32_t frequencybandwith_; + uint32_t pulsewidth_; + uint32_t pulserepitition_; + uint32_t radiatedpower_; + uint32_t numberofbeams_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_SimTrack_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// SimTrack + +// .messages.track.Identifier EntityIdentifier = 1; +inline bool SimTrack::_internal_has_entityidentifier() const { + return this != internal_default_instance() && _impl_.entityidentifier_ != nullptr; +} +inline bool SimTrack::has_entityidentifier() const { + return _internal_has_entityidentifier(); +} +inline const ::messages::track::Identifier& SimTrack::_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& SimTrack::entityidentifier() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.EntityIdentifier) + return _internal_entityidentifier(); +} +inline void SimTrack::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.SimTrack.SimTrack.EntityIdentifier) +} +inline ::messages::track::Identifier* SimTrack::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* SimTrack::unsafe_arena_release_entityidentifier() { + // @@protoc_insertion_point(field_release:messages.SimTrack.SimTrack.EntityIdentifier) + + ::messages::track::Identifier* temp = _impl_.entityidentifier_; + _impl_.entityidentifier_ = nullptr; + return temp; +} +inline ::messages::track::Identifier* SimTrack::_internal_mutable_entityidentifier() { + + if (_impl_.entityidentifier_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::Identifier>(GetArenaForAllocation()); + _impl_.entityidentifier_ = p; + } + return _impl_.entityidentifier_; +} +inline ::messages::track::Identifier* SimTrack::mutable_entityidentifier() { + ::messages::track::Identifier* _msg = _internal_mutable_entityidentifier(); + // @@protoc_insertion_point(field_mutable:messages.SimTrack.SimTrack.EntityIdentifier) + return _msg; +} +inline void SimTrack::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.SimTrack.SimTrack.EntityIdentifier) +} + +// uint32 ContactOrigin = 2; +inline void SimTrack::clear_contactorigin() { + _impl_.contactorigin_ = 0u; +} +inline uint32_t SimTrack::_internal_contactorigin() const { + return _impl_.contactorigin_; +} +inline uint32_t SimTrack::contactorigin() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.ContactOrigin) + return _internal_contactorigin(); +} +inline void SimTrack::_internal_set_contactorigin(uint32_t value) { + + _impl_.contactorigin_ = value; +} +inline void SimTrack::set_contactorigin(uint32_t value) { + _internal_set_contactorigin(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.SimTrack.ContactOrigin) +} + +// .messages.track.EntityGeocentricPosition GeocentricPosition = 3; +inline bool SimTrack::_internal_has_geocentricposition() const { + return this != internal_default_instance() && _impl_.geocentricposition_ != nullptr; +} +inline bool SimTrack::has_geocentricposition() const { + return _internal_has_geocentricposition(); +} +inline const ::messages::track::EntityGeocentricPosition& SimTrack::_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& SimTrack::geocentricposition() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.GeocentricPosition) + return _internal_geocentricposition(); +} +inline void SimTrack::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.SimTrack.SimTrack.GeocentricPosition) +} +inline ::messages::track::EntityGeocentricPosition* SimTrack::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* SimTrack::unsafe_arena_release_geocentricposition() { + // @@protoc_insertion_point(field_release:messages.SimTrack.SimTrack.GeocentricPosition) + + ::messages::track::EntityGeocentricPosition* temp = _impl_.geocentricposition_; + _impl_.geocentricposition_ = nullptr; + return temp; +} +inline ::messages::track::EntityGeocentricPosition* SimTrack::_internal_mutable_geocentricposition() { + + if (_impl_.geocentricposition_ == nullptr) { + auto* p = CreateMaybeMessage<::messages::track::EntityGeocentricPosition>(GetArenaForAllocation()); + _impl_.geocentricposition_ = p; + } + return _impl_.geocentricposition_; +} +inline ::messages::track::EntityGeocentricPosition* SimTrack::mutable_geocentricposition() { + ::messages::track::EntityGeocentricPosition* _msg = _internal_mutable_geocentricposition(); + // @@protoc_insertion_point(field_mutable:messages.SimTrack.SimTrack.GeocentricPosition) + return _msg; +} +inline void SimTrack::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.SimTrack.SimTrack.GeocentricPosition) +} + +// double ContactSpeed = 4; +inline void SimTrack::clear_contactspeed() { + _impl_.contactspeed_ = 0; +} +inline double SimTrack::_internal_contactspeed() const { + return _impl_.contactspeed_; +} +inline double SimTrack::contactspeed() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.ContactSpeed) + return _internal_contactspeed(); +} +inline void SimTrack::_internal_set_contactspeed(double value) { + + _impl_.contactspeed_ = value; +} +inline void SimTrack::set_contactspeed(double value) { + _internal_set_contactspeed(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.SimTrack.ContactSpeed) +} + +// double ContactCourse = 5; +inline void SimTrack::clear_contactcourse() { + _impl_.contactcourse_ = 0; +} +inline double SimTrack::_internal_contactcourse() const { + return _impl_.contactcourse_; +} +inline double SimTrack::contactcourse() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.ContactCourse) + return _internal_contactcourse(); +} +inline void SimTrack::_internal_set_contactcourse(double value) { + + _impl_.contactcourse_ = value; +} +inline void SimTrack::set_contactcourse(double value) { + _internal_set_contactcourse(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.SimTrack.ContactCourse) +} + +// double ContactBearing = 6; +inline void SimTrack::clear_contactbearing() { + _impl_.contactbearing_ = 0; +} +inline double SimTrack::_internal_contactbearing() const { + return _impl_.contactbearing_; +} +inline double SimTrack::contactbearing() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.ContactBearing) + return _internal_contactbearing(); +} +inline void SimTrack::_internal_set_contactbearing(double value) { + + _impl_.contactbearing_ = value; +} +inline void SimTrack::set_contactbearing(double value) { + _internal_set_contactbearing(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.SimTrack.ContactBearing) +} + +// double ContactRange = 7; +inline void SimTrack::clear_contactrange() { + _impl_.contactrange_ = 0; +} +inline double SimTrack::_internal_contactrange() const { + return _impl_.contactrange_; +} +inline double SimTrack::contactrange() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.ContactRange) + return _internal_contactrange(); +} +inline void SimTrack::_internal_set_contactrange(double value) { + + _impl_.contactrange_ = value; +} +inline void SimTrack::set_contactrange(double value) { + _internal_set_contactrange(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.SimTrack.ContactRange) +} + +// uint32 ContactEnvironemnt = 8; +inline void SimTrack::clear_contactenvironemnt() { + _impl_.contactenvironemnt_ = 0u; +} +inline uint32_t SimTrack::_internal_contactenvironemnt() const { + return _impl_.contactenvironemnt_; +} +inline uint32_t SimTrack::contactenvironemnt() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.ContactEnvironemnt) + return _internal_contactenvironemnt(); +} +inline void SimTrack::_internal_set_contactenvironemnt(uint32_t value) { + + _impl_.contactenvironemnt_ = value; +} +inline void SimTrack::set_contactenvironemnt(uint32_t value) { + _internal_set_contactenvironemnt(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.SimTrack.ContactEnvironemnt) +} + +// repeated .messages.SimTrack.Emission ContactEmissions = 9; +inline int SimTrack::_internal_contactemissions_size() const { + return _impl_.contactemissions_.size(); +} +inline int SimTrack::contactemissions_size() const { + return _internal_contactemissions_size(); +} +inline void SimTrack::clear_contactemissions() { + _impl_.contactemissions_.Clear(); +} +inline ::messages::SimTrack::Emission* SimTrack::mutable_contactemissions(int index) { + // @@protoc_insertion_point(field_mutable:messages.SimTrack.SimTrack.ContactEmissions) + return _impl_.contactemissions_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::messages::SimTrack::Emission >* +SimTrack::mutable_contactemissions() { + // @@protoc_insertion_point(field_mutable_list:messages.SimTrack.SimTrack.ContactEmissions) + return &_impl_.contactemissions_; +} +inline const ::messages::SimTrack::Emission& SimTrack::_internal_contactemissions(int index) const { + return _impl_.contactemissions_.Get(index); +} +inline const ::messages::SimTrack::Emission& SimTrack::contactemissions(int index) const { + // @@protoc_insertion_point(field_get:messages.SimTrack.SimTrack.ContactEmissions) + return _internal_contactemissions(index); +} +inline ::messages::SimTrack::Emission* SimTrack::_internal_add_contactemissions() { + return _impl_.contactemissions_.Add(); +} +inline ::messages::SimTrack::Emission* SimTrack::add_contactemissions() { + ::messages::SimTrack::Emission* _add = _internal_add_contactemissions(); + // @@protoc_insertion_point(field_add:messages.SimTrack.SimTrack.ContactEmissions) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::messages::SimTrack::Emission >& +SimTrack::contactemissions() const { + // @@protoc_insertion_point(field_list:messages.SimTrack.SimTrack.ContactEmissions) + return _impl_.contactemissions_; +} + +// ------------------------------------------------------------------- + +// Emission + +// uint32 frequency = 1; +inline void Emission::clear_frequency() { + _impl_.frequency_ = 0u; +} +inline uint32_t Emission::_internal_frequency() const { + return _impl_.frequency_; +} +inline uint32_t Emission::frequency() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.Emission.frequency) + return _internal_frequency(); +} +inline void Emission::_internal_set_frequency(uint32_t value) { + + _impl_.frequency_ = value; +} +inline void Emission::set_frequency(uint32_t value) { + _internal_set_frequency(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.Emission.frequency) +} + +// uint32 frequencyBandWith = 2; +inline void Emission::clear_frequencybandwith() { + _impl_.frequencybandwith_ = 0u; +} +inline uint32_t Emission::_internal_frequencybandwith() const { + return _impl_.frequencybandwith_; +} +inline uint32_t Emission::frequencybandwith() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.Emission.frequencyBandWith) + return _internal_frequencybandwith(); +} +inline void Emission::_internal_set_frequencybandwith(uint32_t value) { + + _impl_.frequencybandwith_ = value; +} +inline void Emission::set_frequencybandwith(uint32_t value) { + _internal_set_frequencybandwith(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.Emission.frequencyBandWith) +} + +// uint32 pulseWidth = 3; +inline void Emission::clear_pulsewidth() { + _impl_.pulsewidth_ = 0u; +} +inline uint32_t Emission::_internal_pulsewidth() const { + return _impl_.pulsewidth_; +} +inline uint32_t Emission::pulsewidth() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.Emission.pulseWidth) + return _internal_pulsewidth(); +} +inline void Emission::_internal_set_pulsewidth(uint32_t value) { + + _impl_.pulsewidth_ = value; +} +inline void Emission::set_pulsewidth(uint32_t value) { + _internal_set_pulsewidth(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.Emission.pulseWidth) +} + +// uint32 pulseRepitition = 4; +inline void Emission::clear_pulserepitition() { + _impl_.pulserepitition_ = 0u; +} +inline uint32_t Emission::_internal_pulserepitition() const { + return _impl_.pulserepitition_; +} +inline uint32_t Emission::pulserepitition() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.Emission.pulseRepitition) + return _internal_pulserepitition(); +} +inline void Emission::_internal_set_pulserepitition(uint32_t value) { + + _impl_.pulserepitition_ = value; +} +inline void Emission::set_pulserepitition(uint32_t value) { + _internal_set_pulserepitition(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.Emission.pulseRepitition) +} + +// uint32 radiatedPower = 5; +inline void Emission::clear_radiatedpower() { + _impl_.radiatedpower_ = 0u; +} +inline uint32_t Emission::_internal_radiatedpower() const { + return _impl_.radiatedpower_; +} +inline uint32_t Emission::radiatedpower() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.Emission.radiatedPower) + return _internal_radiatedpower(); +} +inline void Emission::_internal_set_radiatedpower(uint32_t value) { + + _impl_.radiatedpower_ = value; +} +inline void Emission::set_radiatedpower(uint32_t value) { + _internal_set_radiatedpower(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.Emission.radiatedPower) +} + +// uint32 numberOfBeams = 6; +inline void Emission::clear_numberofbeams() { + _impl_.numberofbeams_ = 0u; +} +inline uint32_t Emission::_internal_numberofbeams() const { + return _impl_.numberofbeams_; +} +inline uint32_t Emission::numberofbeams() const { + // @@protoc_insertion_point(field_get:messages.SimTrack.Emission.numberOfBeams) + return _internal_numberofbeams(); +} +inline void Emission::_internal_set_numberofbeams(uint32_t value) { + + _impl_.numberofbeams_ = value; +} +inline void Emission::set_numberofbeams(uint32_t value) { + _internal_set_numberofbeams(value); + // @@protoc_insertion_point(field_set:messages.SimTrack.Emission.numberOfBeams) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace SimTrack +} // namespace messages + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_SimTrack_2eproto diff --git a/include/SimCore/Messages/Protos/SimTrack.proto b/include/SimCore/Messages/Protos/SimTrack.proto new file mode 100644 index 0000000..31c53c6 --- /dev/null +++ b/include/SimCore/Messages/Protos/SimTrack.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package messages.SimTrack; + +import "google/protobuf/timestamp.proto"; +import "google/protobuf/duration.proto"; +import "Identifier.proto"; +import "GeocentricPosition.proto"; + + + +// [END declaration] + + +message SimTrack { + + messages.track.Identifier EntityIdentifier = 1; + uint32 ContactOrigin = 2; + messages.track.EntityGeocentricPosition GeocentricPosition = 3; + double ContactSpeed = 4; + double ContactCourse = 5; + double ContactBearing = 6; + double ContactRange = 7; + uint32 ContactEnvironemnt = 8; + + repeated Emission ContactEmissions = 9; + // google.protobuf.Timestamp timestamp = 9; +} + +message Emission +{ + uint32 frequency = 1; + uint32 frequencyBandWith = 2; + uint32 pulseWidth = 3; + uint32 pulseRepitition = 4; + uint32 radiatedPower = 5; + uint32 numberOfBeams = 6; + +} \ No newline at end of file diff --git a/include/SimCore/Messages/SimTrack.hpp b/include/SimCore/Messages/SimTrack.hpp new file mode 100644 index 0000000..2808bc9 --- /dev/null +++ b/include/SimCore/Messages/SimTrack.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include + +#include "SimCore/Messages/Protos/SimTrack.pb.h" +#include + +namespace SimCore +{ + class SimTrack + { + private: + const SimCore::Identifier ID_; + + SimCore::TrackKind TrackKind_ = UNKNOWN_TRACK; + + const WHISPER::SourceType SourceType_; + + const SimCore::ObjectSource ObjectSource_; + + public: + SimTrack(); + SimTrack(SimCore::Identifier id, SimCore::TrackKind trackkind, WHISPER::SourceType sourcetype, SimCore::ObjectSource); + + void addPosition(SimCore::Position pos); + SimCore::Position getPosition(); + + + + ~SimTrack(); + }; + + + + +} \ No newline at end of file diff --git a/include/SimCore/data.hpp b/include/SimCore/data.hpp new file mode 100644 index 0000000..b47ca75 --- /dev/null +++ b/include/SimCore/data.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include + +namespace SimCore +{ + template + class Data{ + + private: + + T data_; + + bool valid_; + + std::uint64_t writeTime_; + + public: + + Data():valid_(false),writeTime_(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()) + { + + } + + void setValue(T value) + { + data_ = value; + valid_ = true; + writeTime_ = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + } + + T getValue() + { + return data_; + } + + bool getValidity() + { + return valid_; + } + + std::uint64_t getWriteTime() + { + return writeTime_; + } + + + + + }; +} // namespace SimCore diff --git a/libs/whisper-com b/libs/whisper-com index 0222903..b94f852 160000 --- a/libs/whisper-com +++ b/libs/whisper-com @@ -1 +1 @@ -Subproject commit 0222903f464107bbbe6da62e3c72edeb5e708631 +Subproject commit b94f8521372fe571f58a6a7421e9ddff07473208 diff --git a/src/SimCore/Identifier.cpp b/src/SimCore/Identifier.cpp index 8cc6c0a..b077cdf 100644 --- a/src/SimCore/Identifier.cpp +++ b/src/SimCore/Identifier.cpp @@ -11,7 +11,7 @@ namespace SimCore { - Identifier::Identifier() + Identifier::Identifier():uuid_(xg::newGuid().str()) {} Identifier::Identifier(std::uint32_t parent,std::uint32_t number, std::string uuid,bool external):parent_(parent),number_(number),external_(external),uuid_(uuid) diff --git a/src/SimCore/Messages/SimTrack.cpp b/src/SimCore/Messages/SimTrack.cpp new file mode 100644 index 0000000..a90ee1f --- /dev/null +++ b/src/SimCore/Messages/SimTrack.cpp @@ -0,0 +1,21 @@ +#include + +namespace SimCore +{ + SimTrack::SimTrack() + :ID_(SimCore::Identifier()),TrackKind_(SimCore::TrackKind::UNKNOWN_TRACK),SourceType_(WHISPER::SourceType::GATEWAY),ObjectSource_(SimCore::ObjectSource::INTERNAL) + { + + } + + SimTrack::SimTrack(SimCore::Identifier id, SimCore::TrackKind trackkind, WHISPER::SourceType sourcetype, SimCore::ObjectSource objsrc) + :ID_(id),TrackKind_(trackkind),SourceType_(sourcetype),ObjectSource_(objsrc) + { + + } + + SimTrack::~SimTrack() + { + } + +} // namespace SimCore diff --git a/tests/test_DataClass.cpp b/tests/test_DataClass.cpp new file mode 100644 index 0000000..ac62262 --- /dev/null +++ b/tests/test_DataClass.cpp @@ -0,0 +1,37 @@ + +#define CATCH_CONFIG_MAIN +#include + +#include +#include + +#include + +// SimCore::Identifier OwnID, SimCore::Identifier ParentID, SimCore::SensorKinds SensorKind,std::uint32_t GroundTruthPort, std::uint32_t ParentPort,std::string ParentIPAddress + +SCENARIO("Testing the SimCore Sensor") +{ + GIVEN("different Attributes for a Track in different forms") + { + + + SimCore::Data Name; + Name.setValue("hello world"); + + WHEN("constructing Track Object with data") + { + + THEN("check if Track attributes are correct") + { + REQUIRE(Name.getValue() == "hello world"); + REQUIRE(Name.getValidity() == true); + REQUIRE(Name.getWriteTime() < std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + + + + + + } //THEN + } // WHEN + } // GIVEN +} //SCENARIO \ No newline at end of file diff --git a/tests/test_TrackClass.cpp b/tests/test_TrackClass.cpp new file mode 100644 index 0000000..b620354 --- /dev/null +++ b/tests/test_TrackClass.cpp @@ -0,0 +1,32 @@ + +#define CATCH_CONFIG_MAIN +#include + +#include + +#include + + +SCENARIO("Testing the SimCore Sensor") +{ + GIVEN("different Attributes for a Track in different forms") + { + + + + + WHEN("constructing Track Object with data") + { + + THEN("check if Track attributes are correct") + { + // REQUIRE(Name.getValue() == "hello world"); + + + + + + } //THEN + } // WHEN + } // GIVEN +} //SCENARIO \ No newline at end of file