From 7fb467cc404fd7a4d04226910be75ece8484ab12 Mon Sep 17 00:00:00 2001 From: olbender Date: Sun, 8 Apr 2018 22:56:46 +0200 Subject: [PATCH] Update to cluon 0.0.65 --- CMakeLists.txt | 2 +- VERSION | 2 +- ...v0.0.63.hpp => cluon-complete-v0.0.65.hpp} | 43 ++++++++++--------- 3 files changed, 25 insertions(+), 22 deletions(-) rename src/{cluon-complete-v0.0.63.hpp => cluon-complete-v0.0.65.hpp} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b3ba147..9d84ffc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ project(opendlv-sim-ultrasonic-srf08) ################################################################################ # Defining the relevant versions of OpenDLV Standard Message Set and libcluon. set(OPENDLV_STANDARD_MESSAGE_SET opendlv-standard-message-set-v0.9.4.odvd) -set(CLUON_COMPLETE cluon-complete-v0.0.63.hpp) +set(CLUON_COMPLETE cluon-complete-v0.0.65.hpp) ################################################################################ # This project requires C++14 or newer. diff --git a/VERSION b/VERSION index bcab45a..81340c7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.3 +0.0.4 diff --git a/src/cluon-complete-v0.0.63.hpp b/src/cluon-complete-v0.0.65.hpp similarity index 99% rename from src/cluon-complete-v0.0.63.hpp rename to src/cluon-complete-v0.0.65.hpp index dd68ed4..5385849 100644 --- a/src/cluon-complete-v0.0.63.hpp +++ b/src/cluon-complete-v0.0.65.hpp @@ -1,6 +1,6 @@ // This is an auto-generated header-only single-file distribution of libcluon. -// Date: Wed, 04 Apr 2018 22:16:26 +0200 -// Version: 0.0.63 +// Date: Sun, 08 Apr 2018 11:45:30 +0200 +// Version: 0.0.65 // // // Implementation of N4562 std::experimental::any (merged into C++17) for C++11 compilers. @@ -6564,9 +6564,10 @@ class LIBCLUON_API EnvelopeConverter { * @param json representation according to the given message specification. * @param messageIdentifier The given JSON representation shall be interpreted * as the specified message. + * @param senderStamp to be used in the Envelope. * @return Proto-encoded Envelope including OD4-header or empty string. */ - std::string getProtoEncodedEnvelopeFromJSONWithoutTimeStamps(const std::string &json, int32_t messageIdentifier) noexcept; + std::string getProtoEncodedEnvelopeFromJSONWithoutTimeStamps(const std::string &json, int32_t messageIdentifier, uint32_t senderStamp) noexcept; private: std::vector m_listOfMetaMessages{}; @@ -7207,6 +7208,7 @@ class LIBCLUON_API LCMToGenericMessage { #include #include #include +#include #include #include #include @@ -7330,7 +7332,7 @@ class LIBCLUON_API OD4Session { } send(std::move(envelope)); - } catch (...) {} + } catch (...) {} // LCOV_EXCL_LINE } public: @@ -7341,7 +7343,7 @@ class LIBCLUON_API OD4Session { void sendInternal(std::string &&dataToSend) noexcept; private: - cluon::UDPReceiver m_receiver; + std::unique_ptr m_receiver; cluon::UDPSender m_sender; std::mutex m_senderMutex{}; @@ -9957,8 +9959,8 @@ inline std::map FromJSONVisitor::rea } } } while (!m.empty() && (oldInput != input)); - } catch (std::regex_error &) { - } catch (std::bad_cast &) {} + } catch (std::regex_error &) { // LCOV_EXCL_LINE + } catch (std::bad_cast &) {} // LCOV_EXCL_LINE return result; } @@ -11582,15 +11584,16 @@ inline void ToMsgPackVisitor::visit(uint32_t id, std::string &&typeName, std::st namespace cluon { inline OD4Session::OD4Session(uint16_t CID, std::function delegate) noexcept - : m_receiver{"225.0.0." + std::to_string(CID), - 12175, - [this](std::string &&data, std::string &&from, std::chrono::system_clock::time_point &&timepoint) { - this->callback(std::move(data), std::move(from), std::move(timepoint)); - }} + : m_receiver{nullptr} , m_sender{"225.0.0." + std::to_string(CID), 12175} - , m_delegate(delegate) + , m_delegate(std::move(delegate)) , m_mapOfDataTriggeredDelegatesMutex{} - , m_mapOfDataTriggeredDelegates{} {} + , m_mapOfDataTriggeredDelegates{} { + m_receiver = std::make_unique("225.0.0." + std::to_string(CID), 12175, + [this](std::string &&data, std::string &&from, std::chrono::system_clock::time_point &&timepoint) { + this->callback(std::move(data), std::move(from), std::move(timepoint)); + }); +} inline void OD4Session::timeTrigger(float freq, std::function delegate) noexcept { if (nullptr != delegate) { @@ -11640,8 +11643,7 @@ inline bool OD4Session::dataTrigger(int32_t messageIdentifier, std::functionisRunning(); } } // namespace cluon @@ -11944,7 +11945,7 @@ inline std::string EnvelopeConverter::getJSONFromEnvelope(cluon::data::Envelope return retVal; } -inline std::string EnvelopeConverter::getProtoEncodedEnvelopeFromJSONWithoutTimeStamps(const std::string &json, int32_t messageIdentifier) noexcept { +inline std::string EnvelopeConverter::getProtoEncodedEnvelopeFromJSONWithoutTimeStamps(const std::string &json, int32_t messageIdentifier, uint32_t senderStamp) noexcept { std::string retVal; if (0 < m_scopeOfMetaMessages.count(messageIdentifier)) { // Get specification for message to be created. @@ -11967,7 +11968,9 @@ inline std::string EnvelopeConverter::getProtoEncodedEnvelopeFromJSONWithoutTime gm.accept(protoEncoder); cluon::data::Envelope env; - env.dataType(messageIdentifier).serializedData(protoEncoder.encodedData()); + env.dataType(messageIdentifier) + .serializedData(protoEncoder.encodedData()) + .senderStamp(senderStamp); retVal = cluon::serializeEnvelope(std::move(env)); }