diff options
author | Dirk Huss <dirk_huss@mentor.com> | 2016-02-08 18:31:09 +0100 |
---|---|---|
committer | Dirk Huss <dirk_huss@mentor.com> | 2016-02-08 18:31:09 +0100 |
commit | 274ad1873235b333e1872ac98e7b382553fc7c8f (patch) | |
tree | 0d534911871506fc2714bb71eb3627dd4e2b27b4 | |
parent | 77d9cdaf6acee03a1e360e0e1a3cd0b01a95b407 (diff) | |
download | genivi-common-api-runtime-274ad1873235b333e1872ac98e7b382553fc7c8f.tar.gz |
CommonAPI 3.1.6
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | include/CommonAPI/Enumeration.hpp | 4 | ||||
-rw-r--r-- | include/CommonAPI/Event.hpp | 3 | ||||
-rw-r--r-- | include/CommonAPI/Struct.hpp | 1 | ||||
-rw-r--r-- | include/CommonAPI/Variant.hpp | 6 | ||||
-rw-r--r-- | src/CommonAPI/Logger.cpp | 18 |
7 files changed, 23 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 961674f..07daabd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ PROJECT(libcommonapi) # version of CommonAPI SET( LIBCOMMONAPI_MAJOR_VERSION 3 ) SET( LIBCOMMONAPI_MINOR_VERSION 1 ) -SET( LIBCOMMONAPI_PATCH_VERSION 5 ) +SET( LIBCOMMONAPI_PATCH_VERSION 6 ) message(STATUS "Project name: ${PROJECT_NAME}") @@ -1,3 +1,3 @@ -This is CommonAPI 3.1.5 +This is CommonAPI 3.1.6 Please refer to INSTALL for further information.
\ No newline at end of file diff --git a/include/CommonAPI/Enumeration.hpp b/include/CommonAPI/Enumeration.hpp index 15b4748..2f241e7 100644 --- a/include/CommonAPI/Enumeration.hpp +++ b/include/CommonAPI/Enumeration.hpp @@ -15,6 +15,8 @@ struct Enumeration { value_(_value) { } + virtual ~Enumeration() {} + inline Enumeration &operator=(const Base_ &_value) { value_ = _value; return (*this); @@ -48,6 +50,8 @@ struct Enumeration { return (value_ >= _other.value_); } + virtual bool validate() const = 0; + Base_ value_; }; diff --git a/include/CommonAPI/Event.hpp b/include/CommonAPI/Event.hpp index c1c816a..a31c677 100644 --- a/include/CommonAPI/Event.hpp +++ b/include/CommonAPI/Event.hpp @@ -109,8 +109,7 @@ typename Event<Arguments_...>::Subscription Event<Arguments_...>::subscribe(List subscription = nextSubscription_++; isFirstListener = (0 == pendingSubscriptions_.size()) && (pendingUnsubscriptions_.size() == subscriptions_.size()); listener = std::move(listener); - errorListener = std::move(errorListener); - listeners = std::make_tuple(listener, errorListener); + listeners = std::make_tuple(listener, std::move(errorListener)); pendingSubscriptions_[subscription] = std::move(listeners); subscriptionMutex_.unlock(); diff --git a/include/CommonAPI/Struct.hpp b/include/CommonAPI/Struct.hpp index 6dfb692..82b204c 100644 --- a/include/CommonAPI/Struct.hpp +++ b/include/CommonAPI/Struct.hpp @@ -214,6 +214,7 @@ struct Struct { // Polymorphic structs are mapped to an interface that is derived from the base class // PolymorphicStruct and contain their parameter in a Struct. struct PolymorphicStruct { + virtual ~PolymorphicStruct() {}; virtual Serial getSerial() const = 0; }; diff --git a/include/CommonAPI/Variant.hpp b/include/CommonAPI/Variant.hpp index 4500aae..96f283a 100644 --- a/include/CommonAPI/Variant.hpp +++ b/include/CommonAPI/Variant.hpp @@ -223,7 +223,7 @@ private: public: inline bool hasValue() const { - return (valueType_ <= TypesTupleSize::value); + return (valueType_ != 0); } typename std::aligned_storage<maxSize>::type valueStorage_; @@ -342,12 +342,12 @@ struct ApplyStreamVisitor<Visitor_, Variant_, Deployment_> { static void visit(Visitor_ &, Variant_ &, const Deployment_ *) { - assert(false); + //assert(false); } static void visit(Visitor_ &, const Variant_ &, const Deployment_ *) { - assert(false); + //assert(false); } }; diff --git a/src/CommonAPI/Logger.cpp b/src/CommonAPI/Logger.cpp index 9527431..81b93f2 100644 --- a/src/CommonAPI/Logger.cpp +++ b/src/CommonAPI/Logger.cpp @@ -32,17 +32,23 @@ Logger::Level Logger::maximumLogLevel_(Logger::Level::LL_INFO); Logger::Logger() { #ifdef USE_DLT - DLT_REGISTER_APP("CAPI", "CAPI"); - std::string context = Runtime::getProperty("LogContext"); - if (context == "") context = "CAPI"; - DLT_REGISTER_CONTEXT(dlt_, context.c_str(), "CAPI"); + if (useDlt_) { + std::string app = Runtime::getProperty("LogApplication"); + if (app == "") app = "CAPI"; + DLT_REGISTER_APP(app.c_str(), "CAPI"); + std::string context = Runtime::getProperty("LogContext"); + if (context == "") context = "CAPI"; + DLT_REGISTER_CONTEXT(dlt_, context.c_str(), "CAPI"); + } #endif } Logger::~Logger() { #ifdef USE_DLT - DLT_UNREGISTER_CONTEXT(dlt_); - DLT_UNREGISTER_APP(); + if (useDlt_) { + DLT_UNREGISTER_CONTEXT(dlt_); + DLT_UNREGISTER_APP(); + } #endif } |