From d35f053a49694144e432c62a3a220582f15e52da Mon Sep 17 00:00:00 2001 From: Compiler bot <noreply@clubelek.fr> Date: Wed, 21 Oct 2020 13:58:06 +0000 Subject: [PATCH] ci/Compilation of messages-schemas/da416ac9a5de700d2367b8576c760ae958c18785 --- OdomMessage.h | 349 ----------------------------------- StatusMessage.h | 354 ------------------------------------ ToFMessage.h | 152 ---------------- google/protobuf/timestamp.h | 152 ---------------- 4 files changed, 1007 deletions(-) delete mode 100644 OdomMessage.h delete mode 100644 StatusMessage.h delete mode 100644 ToFMessage.h delete mode 100644 google/protobuf/timestamp.h diff --git a/OdomMessage.h b/OdomMessage.h deleted file mode 100644 index 5430853..0000000 --- a/OdomMessage.h +++ /dev/null @@ -1,349 +0,0 @@ -/* - * Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved - * - * This file is part of Embedded Proto. - * - * Embedded Proto is open source software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation, version 3 of the license. - * - * Embedded Proto is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>. - * - * For commercial and closed source application please visit: - * <https://EmbeddedProto.com/license/>. - * - * Embedded AMS B.V. - * Info: - * info at EmbeddedProto dot com - * - * Postal adress: - * Johan Huizingalaan 763a - * 1066 VH, Amsterdam - * the Netherlands - */ - -// This file is generated. Please do not edit! -#ifndef _ODOMMESSAGE_H_ -#define _ODOMMESSAGE_H_ - -#include <cstdint> -#include <MessageInterface.h> -#include <WireFormatter.h> -#include <Fields.h> -#include <MessageSizeCalculator.h> -#include <ReadBufferSection.h> -#include <RepeatedField.h> - -namespace status_message -{ - -class Point2D final: public ::EmbeddedProto::MessageInterface -{ - public: - Point2D() : - x_(), - y_() - { - - }; - ~Point2D() override = default; - - enum class id - { - NOT_SET = 0, - X = 1, - Y = 2 - }; - - inline EmbeddedProto::floatfixed::FIELD_TYPE x() const { return x_.get(); } - inline void clear_x() { x_.set(0.0); } - inline void set_x(const EmbeddedProto::floatfixed::FIELD_TYPE& value) { x_.set(value); } - inline void set_x(const EmbeddedProto::floatfixed::FIELD_TYPE&& value) { x_.set(value); } - inline EmbeddedProto::floatfixed::FIELD_TYPE get_x() const { return x_.get(); } - - inline EmbeddedProto::floatfixed::FIELD_TYPE y() const { return y_.get(); } - inline void clear_y() { y_.set(0.0); } - inline void set_y(const EmbeddedProto::floatfixed::FIELD_TYPE& value) { y_.set(value); } - inline void set_y(const EmbeddedProto::floatfixed::FIELD_TYPE&& value) { y_.set(value); } - inline EmbeddedProto::floatfixed::FIELD_TYPE get_y() const { return y_.get(); } - - bool serialize(::EmbeddedProto::WriteBufferInterface& buffer) const final - { - bool result = true; - - if((0.0 != x_.get()) && result) - { - result = x_.serialize_with_id(static_cast<uint32_t>(id::X), buffer); - } - - if((0.0 != y_.get()) && result) - { - result = y_.serialize_with_id(static_cast<uint32_t>(id::Y), buffer); - } - - return result; - }; - - bool deserialize(::EmbeddedProto::ReadBufferInterface& buffer) final - { - bool result = true; - ::EmbeddedProto::WireFormatter::WireType wire_type; - uint32_t id_number = 0; - - while(result && ::EmbeddedProto::WireFormatter::DeserializeTag(buffer, wire_type, id_number)) - { - switch(id_number) - { - case static_cast<uint32_t>(id::X): - { - if(::EmbeddedProto::WireFormatter::WireType::FIXED32 == wire_type) - { - result = x_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::Y): - { - if(::EmbeddedProto::WireFormatter::WireType::FIXED32 == wire_type) - { - result = y_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - default: - break; - } - } - return result; - }; - - void clear() final - { - clear_x(); - clear_y(); - } - - private: - - EmbeddedProto::floatfixed x_; - EmbeddedProto::floatfixed y_; - -}; - -class OdomMessage final: public ::EmbeddedProto::MessageInterface -{ - public: - OdomMessage() : - sensor_id_(), - position_(), - angle_(), - linearSpeed_(), - angularSpeed_() - { - - }; - ~OdomMessage() override = default; - - enum class id - { - NOT_SET = 0, - SENSOR_ID = 1, - POSITION = 2, - ANGLE = 3, - LINEARSPEED = 4, - ANGULARSPEED = 5 - }; - - inline EmbeddedProto::int32::FIELD_TYPE sensor_id() const { return sensor_id_.get(); } - inline void clear_sensor_id() { sensor_id_.set(0); } - inline void set_sensor_id(const EmbeddedProto::int32::FIELD_TYPE& value) { sensor_id_.set(value); } - inline void set_sensor_id(const EmbeddedProto::int32::FIELD_TYPE&& value) { sensor_id_.set(value); } - inline EmbeddedProto::int32::FIELD_TYPE get_sensor_id() const { return sensor_id_.get(); } - - inline const status_message::Point2D& position() const { return position_; } - inline void clear_position() { position_.clear(); } - inline void set_position(const status_message::Point2D& value) { position_ = value; } - inline void set_position(const status_message::Point2D&& value) { position_ = value; } - inline status_message::Point2D& mutable_position() { return position_; } - inline const status_message::Point2D& get_position() const { return position_; } - - inline EmbeddedProto::floatfixed::FIELD_TYPE angle() const { return angle_.get(); } - inline void clear_angle() { angle_.set(0.0); } - inline void set_angle(const EmbeddedProto::floatfixed::FIELD_TYPE& value) { angle_.set(value); } - inline void set_angle(const EmbeddedProto::floatfixed::FIELD_TYPE&& value) { angle_.set(value); } - inline EmbeddedProto::floatfixed::FIELD_TYPE get_angle() const { return angle_.get(); } - - inline EmbeddedProto::floatfixed::FIELD_TYPE linearSpeed() const { return linearSpeed_.get(); } - inline void clear_linearSpeed() { linearSpeed_.set(0.0); } - inline void set_linearSpeed(const EmbeddedProto::floatfixed::FIELD_TYPE& value) { linearSpeed_.set(value); } - inline void set_linearSpeed(const EmbeddedProto::floatfixed::FIELD_TYPE&& value) { linearSpeed_.set(value); } - inline EmbeddedProto::floatfixed::FIELD_TYPE get_linearSpeed() const { return linearSpeed_.get(); } - - inline EmbeddedProto::floatfixed::FIELD_TYPE angularSpeed() const { return angularSpeed_.get(); } - inline void clear_angularSpeed() { angularSpeed_.set(0.0); } - inline void set_angularSpeed(const EmbeddedProto::floatfixed::FIELD_TYPE& value) { angularSpeed_.set(value); } - inline void set_angularSpeed(const EmbeddedProto::floatfixed::FIELD_TYPE&& value) { angularSpeed_.set(value); } - inline EmbeddedProto::floatfixed::FIELD_TYPE get_angularSpeed() const { return angularSpeed_.get(); } - - bool serialize(::EmbeddedProto::WriteBufferInterface& buffer) const final - { - bool result = true; - - if((0 != sensor_id_.get()) && result) - { - result = sensor_id_.serialize_with_id(static_cast<uint32_t>(id::SENSOR_ID), buffer); - } - - if(result) - { - result = position_.serialize_with_id(static_cast<uint32_t>(id::POSITION), buffer); - } - - - if((0.0 != angle_.get()) && result) - { - result = angle_.serialize_with_id(static_cast<uint32_t>(id::ANGLE), buffer); - } - - if((0.0 != linearSpeed_.get()) && result) - { - result = linearSpeed_.serialize_with_id(static_cast<uint32_t>(id::LINEARSPEED), buffer); - } - - if((0.0 != angularSpeed_.get()) && result) - { - result = angularSpeed_.serialize_with_id(static_cast<uint32_t>(id::ANGULARSPEED), buffer); - } - - return result; - }; - - bool deserialize(::EmbeddedProto::ReadBufferInterface& buffer) final - { - bool result = true; - ::EmbeddedProto::WireFormatter::WireType wire_type; - uint32_t id_number = 0; - - while(result && ::EmbeddedProto::WireFormatter::DeserializeTag(buffer, wire_type, id_number)) - { - switch(id_number) - { - case static_cast<uint32_t>(id::SENSOR_ID): - { - if(::EmbeddedProto::WireFormatter::WireType::VARINT == wire_type) - { - result = sensor_id_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::POSITION): - { - if(::EmbeddedProto::WireFormatter::WireType::LENGTH_DELIMITED == wire_type) - { - uint32_t size; - result = ::EmbeddedProto::WireFormatter::DeserializeVarint(buffer, size); - ::EmbeddedProto::ReadBufferSection bufferSection(buffer, size); - result = result && position_.deserialize(bufferSection); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::ANGLE): - { - if(::EmbeddedProto::WireFormatter::WireType::FIXED32 == wire_type) - { - result = angle_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::LINEARSPEED): - { - if(::EmbeddedProto::WireFormatter::WireType::FIXED32 == wire_type) - { - result = linearSpeed_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::ANGULARSPEED): - { - if(::EmbeddedProto::WireFormatter::WireType::FIXED32 == wire_type) - { - result = angularSpeed_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - default: - break; - } - } - return result; - }; - - void clear() final - { - clear_sensor_id(); - clear_position(); - clear_angle(); - clear_linearSpeed(); - clear_angularSpeed(); - } - - private: - - EmbeddedProto::int32 sensor_id_; - status_message::Point2D position_; - EmbeddedProto::floatfixed angle_; - EmbeddedProto::floatfixed linearSpeed_; - EmbeddedProto::floatfixed angularSpeed_; - -}; - -} // End of namespace status_message -#endif // _ODOMMESSAGE_H_ diff --git a/StatusMessage.h b/StatusMessage.h deleted file mode 100644 index ad7f44f..0000000 --- a/StatusMessage.h +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved - * - * This file is part of Embedded Proto. - * - * Embedded Proto is open source software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation, version 3 of the license. - * - * Embedded Proto is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>. - * - * For commercial and closed source application please visit: - * <https://EmbeddedProto.com/license/>. - * - * Embedded AMS B.V. - * Info: - * info at EmbeddedProto dot com - * - * Postal adress: - * Johan Huizingalaan 763a - * 1066 VH, Amsterdam - * the Netherlands - */ - -// This file is generated. Please do not edit! -#ifndef _STATUSMESSAGE_H_ -#define _STATUSMESSAGE_H_ - -#include <cstdint> -#include <MessageInterface.h> -#include <WireFormatter.h> -#include <Fields.h> -#include <MessageSizeCalculator.h> -#include <ReadBufferSection.h> -#include <RepeatedField.h> - -// Include external proto definitions -#include <google/protobuf/timestamp.h> -#include <ToFMessage.h> -#include <OdomMessage.h> - -namespace status_message -{ - -class StatusMessage final: public ::EmbeddedProto::MessageInterface -{ - public: - StatusMessage() : - id_(), - timestamp_(), - which_body_(id::NOT_SET) - { - - }; - ~StatusMessage() override = default; - - enum class id - { - NOT_SET = 0, - ID = 1, - TIMESTAMP = 2, - TOF = 3, - ODOM = 4 - }; - - inline EmbeddedProto::int32::FIELD_TYPE id() const { return id_.get(); } - inline void clear_id() { id_.set(0); } - inline void set_id(const EmbeddedProto::int32::FIELD_TYPE& value) { id_.set(value); } - inline void set_id(const EmbeddedProto::int32::FIELD_TYPE&& value) { id_.set(value); } - inline EmbeddedProto::int32::FIELD_TYPE get_id() const { return id_.get(); } - - inline const google::protobuf::Timestamp& timestamp() const { return timestamp_; } - inline void clear_timestamp() { timestamp_.clear(); } - inline void set_timestamp(const google::protobuf::Timestamp& value) { timestamp_ = value; } - inline void set_timestamp(const google::protobuf::Timestamp&& value) { timestamp_ = value; } - inline google::protobuf::Timestamp& mutable_timestamp() { return timestamp_; } - inline const google::protobuf::Timestamp& get_timestamp() const { return timestamp_; } - - id get_which_body() const { return which_body_; } - - inline const status_message::ToFMessage& tof() const { return body_.tof_; } - inline void clear_tof() - { - if(id::TOF == which_body_) - { - which_body_ = id::NOT_SET; - body_.tof_.~ToFMessage(); - } - } - inline void set_tof(const status_message::ToFMessage& value) - { - if(id::TOF != which_body_) - { - init_body(id::TOF); - } - body_.tof_ = value; - } - inline void set_tof(const status_message::ToFMessage&& value) - { - if(id::TOF != which_body_) - { - init_body(id::TOF); - } - body_.tof_ = value; - } - inline status_message::ToFMessage& mutable_tof() - { - if(id::TOF != which_body_) - { - init_body(id::TOF); - } - return body_.tof_; - } - inline const status_message::ToFMessage& get_tof() const { return body_.tof_; } - - inline const status_message::OdomMessage& odom() const { return body_.odom_; } - inline void clear_odom() - { - if(id::ODOM == which_body_) - { - which_body_ = id::NOT_SET; - body_.odom_.~OdomMessage(); - } - } - inline void set_odom(const status_message::OdomMessage& value) - { - if(id::ODOM != which_body_) - { - init_body(id::ODOM); - } - body_.odom_ = value; - } - inline void set_odom(const status_message::OdomMessage&& value) - { - if(id::ODOM != which_body_) - { - init_body(id::ODOM); - } - body_.odom_ = value; - } - inline status_message::OdomMessage& mutable_odom() - { - if(id::ODOM != which_body_) - { - init_body(id::ODOM); - } - return body_.odom_; - } - inline const status_message::OdomMessage& get_odom() const { return body_.odom_; } - - bool serialize(::EmbeddedProto::WriteBufferInterface& buffer) const final - { - bool result = true; - - if((0 != id_.get()) && result) - { - result = id_.serialize_with_id(static_cast<uint32_t>(id::ID), buffer); - } - - if(result) - { - result = timestamp_.serialize_with_id(static_cast<uint32_t>(id::TIMESTAMP), buffer); - } - - - switch(which_body_) - { - case id::TOF: - if(result) - { - result = body_.tof_.serialize_with_id(static_cast<uint32_t>(id::TOF), buffer); - } - - break; - - case id::ODOM: - if(result) - { - result = body_.odom_.serialize_with_id(static_cast<uint32_t>(id::ODOM), buffer); - } - - break; - - default: - break; - } - - return result; - }; - - bool deserialize(::EmbeddedProto::ReadBufferInterface& buffer) final - { - bool result = true; - ::EmbeddedProto::WireFormatter::WireType wire_type; - uint32_t id_number = 0; - - while(result && ::EmbeddedProto::WireFormatter::DeserializeTag(buffer, wire_type, id_number)) - { - switch(id_number) - { - case static_cast<uint32_t>(id::ID): - { - if(::EmbeddedProto::WireFormatter::WireType::VARINT == wire_type) - { - result = id_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::TIMESTAMP): - { - if(::EmbeddedProto::WireFormatter::WireType::LENGTH_DELIMITED == wire_type) - { - uint32_t size; - result = ::EmbeddedProto::WireFormatter::DeserializeVarint(buffer, size); - ::EmbeddedProto::ReadBufferSection bufferSection(buffer, size); - result = result && timestamp_.deserialize(bufferSection); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::TOF): - { - if(::EmbeddedProto::WireFormatter::WireType::LENGTH_DELIMITED == wire_type) - { - uint32_t size; - result = ::EmbeddedProto::WireFormatter::DeserializeVarint(buffer, size); - ::EmbeddedProto::ReadBufferSection bufferSection(buffer, size); - init_body(id::TOF); - result = result && body_.tof_.deserialize(bufferSection); - if(result) - { - which_body_ = id::TOF; - } - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::ODOM): - { - if(::EmbeddedProto::WireFormatter::WireType::LENGTH_DELIMITED == wire_type) - { - uint32_t size; - result = ::EmbeddedProto::WireFormatter::DeserializeVarint(buffer, size); - ::EmbeddedProto::ReadBufferSection bufferSection(buffer, size); - init_body(id::ODOM); - result = result && body_.odom_.deserialize(bufferSection); - if(result) - { - which_body_ = id::ODOM; - } - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - default: - break; - } - } - return result; - }; - - void clear() final - { - clear_id(); - clear_timestamp(); - clear_body(); - } - - private: - - EmbeddedProto::int32 id_; - google::protobuf::Timestamp timestamp_; - - id which_body_; - union body - { - body() {} - ~body() {} - status_message::ToFMessage tof_; - status_message::OdomMessage odom_; - }; - body body_; - - void init_body(const id field_id) - { - if(id::NOT_SET != which_body_) - { - // First delete the old object in the oneof. - clear_body(); - } - - // C++11 unions only support nontrivial members when you explicitly call the placement new statement. - switch(field_id) - { - case id::TOF: - new(&body_.tof_) status_message::ToFMessage; - which_body_ = id::TOF; - break; - case id::ODOM: - new(&body_.odom_) status_message::OdomMessage; - which_body_ = id::ODOM; - break; - default: - break; - } - } - - void clear_body() - { - switch(which_body_) - { - case id::TOF: - body_.tof_.~ToFMessage(); - break; - case id::ODOM: - body_.odom_.~OdomMessage(); - break; - default: - break; - } - which_body_ = id::NOT_SET; - } - -}; - -} // End of namespace status_message -#endif // _STATUSMESSAGE_H_ diff --git a/ToFMessage.h b/ToFMessage.h deleted file mode 100644 index 827f82e..0000000 --- a/ToFMessage.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved - * - * This file is part of Embedded Proto. - * - * Embedded Proto is open source software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation, version 3 of the license. - * - * Embedded Proto is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>. - * - * For commercial and closed source application please visit: - * <https://EmbeddedProto.com/license/>. - * - * Embedded AMS B.V. - * Info: - * info at EmbeddedProto dot com - * - * Postal adress: - * Johan Huizingalaan 763a - * 1066 VH, Amsterdam - * the Netherlands - */ - -// This file is generated. Please do not edit! -#ifndef _TOFMESSAGE_H_ -#define _TOFMESSAGE_H_ - -#include <cstdint> -#include <MessageInterface.h> -#include <WireFormatter.h> -#include <Fields.h> -#include <MessageSizeCalculator.h> -#include <ReadBufferSection.h> -#include <RepeatedField.h> - -namespace status_message -{ - -class ToFMessage final: public ::EmbeddedProto::MessageInterface -{ - public: - ToFMessage() : - sensor_id_(), - distance_() - { - - }; - ~ToFMessage() override = default; - - enum class id - { - NOT_SET = 0, - SENSOR_ID = 1, - DISTANCE = 2 - }; - - inline EmbeddedProto::int32::FIELD_TYPE sensor_id() const { return sensor_id_.get(); } - inline void clear_sensor_id() { sensor_id_.set(0); } - inline void set_sensor_id(const EmbeddedProto::int32::FIELD_TYPE& value) { sensor_id_.set(value); } - inline void set_sensor_id(const EmbeddedProto::int32::FIELD_TYPE&& value) { sensor_id_.set(value); } - inline EmbeddedProto::int32::FIELD_TYPE get_sensor_id() const { return sensor_id_.get(); } - - inline EmbeddedProto::floatfixed::FIELD_TYPE distance() const { return distance_.get(); } - inline void clear_distance() { distance_.set(0.0); } - inline void set_distance(const EmbeddedProto::floatfixed::FIELD_TYPE& value) { distance_.set(value); } - inline void set_distance(const EmbeddedProto::floatfixed::FIELD_TYPE&& value) { distance_.set(value); } - inline EmbeddedProto::floatfixed::FIELD_TYPE get_distance() const { return distance_.get(); } - - bool serialize(::EmbeddedProto::WriteBufferInterface& buffer) const final - { - bool result = true; - - if((0 != sensor_id_.get()) && result) - { - result = sensor_id_.serialize_with_id(static_cast<uint32_t>(id::SENSOR_ID), buffer); - } - - if((0.0 != distance_.get()) && result) - { - result = distance_.serialize_with_id(static_cast<uint32_t>(id::DISTANCE), buffer); - } - - return result; - }; - - bool deserialize(::EmbeddedProto::ReadBufferInterface& buffer) final - { - bool result = true; - ::EmbeddedProto::WireFormatter::WireType wire_type; - uint32_t id_number = 0; - - while(result && ::EmbeddedProto::WireFormatter::DeserializeTag(buffer, wire_type, id_number)) - { - switch(id_number) - { - case static_cast<uint32_t>(id::SENSOR_ID): - { - if(::EmbeddedProto::WireFormatter::WireType::VARINT == wire_type) - { - result = sensor_id_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::DISTANCE): - { - if(::EmbeddedProto::WireFormatter::WireType::FIXED32 == wire_type) - { - result = distance_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - default: - break; - } - } - return result; - }; - - void clear() final - { - clear_sensor_id(); - clear_distance(); - } - - private: - - EmbeddedProto::int32 sensor_id_; - EmbeddedProto::floatfixed distance_; - -}; - -} // End of namespace status_message -#endif // _TOFMESSAGE_H_ diff --git a/google/protobuf/timestamp.h b/google/protobuf/timestamp.h deleted file mode 100644 index e444ee9..0000000 --- a/google/protobuf/timestamp.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2020 Embedded AMS B.V. - All Rights Reserved - * - * This file is part of Embedded Proto. - * - * Embedded Proto is open source software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License as published - * by the Free Software Foundation, version 3 of the license. - * - * Embedded Proto is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Embedded Proto. If not, see <https://www.gnu.org/licenses/>. - * - * For commercial and closed source application please visit: - * <https://EmbeddedProto.com/license/>. - * - * Embedded AMS B.V. - * Info: - * info at EmbeddedProto dot com - * - * Postal adress: - * Johan Huizingalaan 763a - * 1066 VH, Amsterdam - * the Netherlands - */ - -// This file is generated. Please do not edit! -#ifndef _GOOGLE/PROTOBUF/TIMESTAMP_H_ -#define _GOOGLE/PROTOBUF/TIMESTAMP_H_ - -#include <cstdint> -#include <MessageInterface.h> -#include <WireFormatter.h> -#include <Fields.h> -#include <MessageSizeCalculator.h> -#include <ReadBufferSection.h> -#include <RepeatedField.h> - -namespace google::protobuf -{ - -class Timestamp final: public ::EmbeddedProto::MessageInterface -{ - public: - Timestamp() : - seconds_(), - nanos_() - { - - }; - ~Timestamp() override = default; - - enum class id - { - NOT_SET = 0, - SECONDS = 1, - NANOS = 2 - }; - - inline EmbeddedProto::int64::FIELD_TYPE seconds() const { return seconds_.get(); } - inline void clear_seconds() { seconds_.set(0); } - inline void set_seconds(const EmbeddedProto::int64::FIELD_TYPE& value) { seconds_.set(value); } - inline void set_seconds(const EmbeddedProto::int64::FIELD_TYPE&& value) { seconds_.set(value); } - inline EmbeddedProto::int64::FIELD_TYPE get_seconds() const { return seconds_.get(); } - - inline EmbeddedProto::int32::FIELD_TYPE nanos() const { return nanos_.get(); } - inline void clear_nanos() { nanos_.set(0); } - inline void set_nanos(const EmbeddedProto::int32::FIELD_TYPE& value) { nanos_.set(value); } - inline void set_nanos(const EmbeddedProto::int32::FIELD_TYPE&& value) { nanos_.set(value); } - inline EmbeddedProto::int32::FIELD_TYPE get_nanos() const { return nanos_.get(); } - - bool serialize(::EmbeddedProto::WriteBufferInterface& buffer) const final - { - bool result = true; - - if((0 != seconds_.get()) && result) - { - result = seconds_.serialize_with_id(static_cast<uint32_t>(id::SECONDS), buffer); - } - - if((0 != nanos_.get()) && result) - { - result = nanos_.serialize_with_id(static_cast<uint32_t>(id::NANOS), buffer); - } - - return result; - }; - - bool deserialize(::EmbeddedProto::ReadBufferInterface& buffer) final - { - bool result = true; - ::EmbeddedProto::WireFormatter::WireType wire_type; - uint32_t id_number = 0; - - while(result && ::EmbeddedProto::WireFormatter::DeserializeTag(buffer, wire_type, id_number)) - { - switch(id_number) - { - case static_cast<uint32_t>(id::SECONDS): - { - if(::EmbeddedProto::WireFormatter::WireType::VARINT == wire_type) - { - result = seconds_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - case static_cast<uint32_t>(id::NANOS): - { - if(::EmbeddedProto::WireFormatter::WireType::VARINT == wire_type) - { - result = nanos_.deserialize(buffer); - } - else - { - // TODO Error wire type does not match field. - result = false; - } - break; - } - - default: - break; - } - } - return result; - }; - - void clear() final - { - clear_seconds(); - clear_nanos(); - } - - private: - - EmbeddedProto::int64 seconds_; - EmbeddedProto::int32 nanos_; - -}; - -} // End of namespace google::protobuf -#endif // _GOOGLE/PROTOBUF/TIMESTAMP_H_ -- GitLab