ADD: added new SimTrack class to replace all other tracks
This commit is contained in:
@@ -45,7 +45,12 @@ add_library(SimCore STATIC
|
|||||||
|
|
||||||
include/SimCore/Messages/SensorTrack.hpp
|
include/SimCore/Messages/SensorTrack.hpp
|
||||||
src/SimCore/Messages/SensorTrack.cpp
|
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/Track.pb.cc
|
||||||
include/SimCore/Messages/Protos/GeocentricPosition.pb.cc
|
include/SimCore/Messages/Protos/GeocentricPosition.pb.cc
|
||||||
include/SimCore/Messages/Protos/Identifier.pb.cc
|
include/SimCore/Messages/Protos/Identifier.pb.cc
|
||||||
@@ -62,6 +67,9 @@ add_library(SimCore STATIC
|
|||||||
include/SimCore/Messages/GroundThruthTrack.hpp
|
include/SimCore/Messages/GroundThruthTrack.hpp
|
||||||
src/SimCore/Messages/GroundThruthTrack.cpp
|
src/SimCore/Messages/GroundThruthTrack.cpp
|
||||||
|
|
||||||
|
include/SimCore/data.hpp
|
||||||
|
|
||||||
|
|
||||||
include/SimCore/Position.hpp
|
include/SimCore/Position.hpp
|
||||||
src/SimCore/Position.cpp
|
src/SimCore/Position.cpp
|
||||||
|
|
||||||
@@ -180,6 +188,13 @@ IF (${TEST_SIMCORE_LIBRARY})
|
|||||||
add_executable(test_Trackstore tests/test_Trackstore.cpp)
|
add_executable(test_Trackstore tests/test_Trackstore.cpp)
|
||||||
target_link_libraries(test_Trackstore Catch2::Catch2 SimCore loguru)
|
target_link_libraries(test_Trackstore Catch2::Catch2 SimCore loguru)
|
||||||
catch_discover_tests(test_SensorClass)
|
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()
|
ENDIF()
|
||||||
|
|||||||
956
include/SimCore/Messages/Protos/SimTrack.pb.cc
Normal file
956
include/SimCore/Messages/Protos/SimTrack.pb.cc
Normal file
@@ -0,0 +1,956 @@
|
|||||||
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
|
// source: SimTrack.proto
|
||||||
|
|
||||||
|
#include "SimTrack.pb.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <google/protobuf/io/coded_stream.h>
|
||||||
|
#include <google/protobuf/extension_set.h>
|
||||||
|
#include <google/protobuf/wire_format_lite.h>
|
||||||
|
#include <google/protobuf/descriptor.h>
|
||||||
|
#include <google/protobuf/generated_message_reflection.h>
|
||||||
|
#include <google/protobuf/reflection_ops.h>
|
||||||
|
#include <google/protobuf/wire_format.h>
|
||||||
|
// @@protoc_insertion_point(includes)
|
||||||
|
#include <google/protobuf/port_def.inc>
|
||||||
|
|
||||||
|
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<size_t>(reinterpret_cast<char*>(&_impl_.contactrange_) -
|
||||||
|
reinterpret_cast<char*>(&_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<size_t>(
|
||||||
|
reinterpret_cast<char*>(&_impl_.contactrange_) -
|
||||||
|
reinterpret_cast<char*>(&_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<uint8_t>(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<uint8_t>(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<uint8_t>(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<uint8_t>(tag) == 33)) {
|
||||||
|
_impl_.contactspeed_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
|
||||||
|
ptr += sizeof(double);
|
||||||
|
} else
|
||||||
|
goto handle_unusual;
|
||||||
|
continue;
|
||||||
|
// double ContactCourse = 5;
|
||||||
|
case 5:
|
||||||
|
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 41)) {
|
||||||
|
_impl_.contactcourse_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
|
||||||
|
ptr += sizeof(double);
|
||||||
|
} else
|
||||||
|
goto handle_unusual;
|
||||||
|
continue;
|
||||||
|
// double ContactBearing = 6;
|
||||||
|
case 6:
|
||||||
|
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 49)) {
|
||||||
|
_impl_.contactbearing_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
|
||||||
|
ptr += sizeof(double);
|
||||||
|
} else
|
||||||
|
goto handle_unusual;
|
||||||
|
continue;
|
||||||
|
// double ContactRange = 7;
|
||||||
|
case 7:
|
||||||
|
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 57)) {
|
||||||
|
_impl_.contactrange_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr);
|
||||||
|
ptr += sizeof(double);
|
||||||
|
} else
|
||||||
|
goto handle_unusual;
|
||||||
|
continue;
|
||||||
|
// uint32 ContactEnvironemnt = 8;
|
||||||
|
case 8:
|
||||||
|
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(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<uint8_t>(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<unsigned>(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<SimTrack*>(&to_msg);
|
||||||
|
auto& from = static_cast<const SimTrack&>(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<char*>(&_impl_.entityidentifier_),
|
||||||
|
reinterpret_cast<char*>(&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<size_t>(reinterpret_cast<char*>(&_impl_.numberofbeams_) -
|
||||||
|
reinterpret_cast<char*>(&_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<size_t>(
|
||||||
|
reinterpret_cast<char*>(&_impl_.numberofbeams_) -
|
||||||
|
reinterpret_cast<char*>(&_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<uint8_t>(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<uint8_t>(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<uint8_t>(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<uint8_t>(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<uint8_t>(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<uint8_t>(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<Emission*>(&to_msg);
|
||||||
|
auto& from = static_cast<const Emission&>(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<char*>(&_impl_.frequency_),
|
||||||
|
reinterpret_cast<char*>(&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 <google/protobuf/port_undef.inc>
|
||||||
1013
include/SimCore/Messages/Protos/SimTrack.pb.h
Normal file
1013
include/SimCore/Messages/Protos/SimTrack.pb.h
Normal file
File diff suppressed because it is too large
Load Diff
38
include/SimCore/Messages/Protos/SimTrack.proto
Normal file
38
include/SimCore/Messages/Protos/SimTrack.proto
Normal file
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
36
include/SimCore/Messages/SimTrack.hpp
Normal file
36
include/SimCore/Messages/SimTrack.hpp
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <WHISPER/whisper.hpp>
|
||||||
|
|
||||||
|
#include "SimCore/Messages/Protos/SimTrack.pb.h"
|
||||||
|
#include <SimCore/Identifier.hpp>
|
||||||
|
|
||||||
|
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();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
51
include/SimCore/data.hpp
Normal file
51
include/SimCore/data.hpp
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
namespace SimCore
|
||||||
|
{
|
||||||
|
template <typename T>
|
||||||
|
class Data{
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
T data_;
|
||||||
|
|
||||||
|
bool valid_;
|
||||||
|
|
||||||
|
std::uint64_t writeTime_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
Data():valid_(false),writeTime_(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void setValue(T value)
|
||||||
|
{
|
||||||
|
data_ = value;
|
||||||
|
valid_ = true;
|
||||||
|
writeTime_ = std::chrono::duration_cast<std::chrono::milliseconds>(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
|
||||||
Submodule libs/whisper-com updated: 0222903f46...b94f852137
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace SimCore {
|
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)
|
Identifier::Identifier(std::uint32_t parent,std::uint32_t number, std::string uuid,bool external):parent_(parent),number_(number),external_(external),uuid_(uuid)
|
||||||
|
|||||||
21
src/SimCore/Messages/SimTrack.cpp
Normal file
21
src/SimCore/Messages/SimTrack.cpp
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#include <SimCore/Messages/SimTrack.hpp>
|
||||||
|
|
||||||
|
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
|
||||||
37
tests/test_DataClass.cpp
Normal file
37
tests/test_DataClass.cpp
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
#define CATCH_CONFIG_MAIN
|
||||||
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
|
#include <SimCore/data.hpp>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <SimCore/Position.hpp>
|
||||||
|
|
||||||
|
// 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<std::string> 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::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} //THEN
|
||||||
|
} // WHEN
|
||||||
|
} // GIVEN
|
||||||
|
} //SCENARIO
|
||||||
32
tests/test_TrackClass.cpp
Normal file
32
tests/test_TrackClass.cpp
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
#define CATCH_CONFIG_MAIN
|
||||||
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <SimCore/Messages/SimTrack.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
Reference in New Issue
Block a user