From 77d9cdaf6acee03a1e360e0e1a3cd0b01a95b407 Mon Sep 17 00:00:00 2001 From: Dirk Huss Date: Wed, 9 Dec 2015 14:30:44 +0100 Subject: CommonAPI 3.1.5 --- CMakeLists.txt | 4 ++-- README | 2 +- include/CommonAPI/ProxyManager.hpp | 6 +++--- include/CommonAPI/Variant.hpp | 4 ++++ src/CommonAPI/Runtime.cpp | 16 ++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b212df..961674f 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 4 ) +SET( LIBCOMMONAPI_PATCH_VERSION 5 ) message(STATUS "Project name: ${PROJECT_NAME}") @@ -229,7 +229,7 @@ endif() # create pkg-config file if(NOT WIN32 AND PKG_CONFIG_FOUND) configure_file(CommonAPI.pc.in ${PROJECT_BINARY_DIR}/CommonAPI.pc @ONLY) - install(FILES ${PROJECT_BINARY_DIR}/CommonAPI.pc DESTINATION lib/pkconfig) + install(FILES ${PROJECT_BINARY_DIR}/CommonAPI.pc DESTINATION lib/pkgconfig) endif() ############################################################################## diff --git a/README b/README index 02f1a3b..c790ed2 100644 --- a/README +++ b/README @@ -1,3 +1,3 @@ -This is CommonAPI 3.1.4 +This is CommonAPI 3.1.5 Please refer to INSTALL for further information. \ No newline at end of file diff --git a/include/CommonAPI/ProxyManager.hpp b/include/CommonAPI/ProxyManager.hpp index d7bcada..52d666c 100644 --- a/include/CommonAPI/ProxyManager.hpp +++ b/include/CommonAPI/ProxyManager.hpp @@ -18,6 +18,7 @@ #include #include #include +#include namespace CommonAPI { @@ -52,13 +53,12 @@ public: template class ProxyClass_, typename ... AttributeExtensions_> std::shared_ptr > - buildProxy(const std::string &_instance) { - std::shared_ptr proxy = createProxy(getDomain(), getInterface(), _instance, getConnectionId()); + buildProxy(const std::string &_instance, const ConnectionId_t& _connectionId = DEFAULT_CONNECTION_ID) { + std::shared_ptr proxy = createProxy(getDomain(), getInterface(), _instance, (DEFAULT_CONNECTION_ID == _connectionId) ? getConnectionId() : _connectionId); if (proxy) { return std::make_shared>(proxy); } return NULL; - } protected: diff --git a/include/CommonAPI/Variant.hpp b/include/CommonAPI/Variant.hpp index 34304b9..4500aae 100644 --- a/include/CommonAPI/Variant.hpp +++ b/include/CommonAPI/Variant.hpp @@ -197,6 +197,10 @@ public: return valueType_; } + uint8_t getMaxValueType() const { + return uint8_t(TypesTupleSize::value); + } + private: template void set(const Type_ &_value, const bool clear); diff --git a/src/CommonAPI/Runtime.cpp b/src/CommonAPI/Runtime.cpp index b2cab99..7d075a2 100644 --- a/src/CommonAPI/Runtime.cpp +++ b/src/CommonAPI/Runtime.cpp @@ -213,8 +213,7 @@ Runtime::createProxy( // ...it seems do not, lets try to load a library that does... std::lock_guard itsGuard(loadMutex_); std::string library = getLibrary(_domain, _interface, _instance, true); - loadLibrary(library); - { + if (loadLibrary(library) || defaultFactory_) { proxy = createProxyHelper(_domain, _interface, _instance, _connectionId, true); } } @@ -232,8 +231,7 @@ Runtime::createProxy( // ...it seems do not, lets try to load a library that does... std::lock_guard itsGuard(loadMutex_); std::string library = getLibrary(_domain, _interface, _instance, true); - loadLibrary(library); - { + if (loadLibrary(library) || defaultFactory_) { proxy = createProxyHelper(_domain, _interface, _instance, _context, true); } } @@ -249,8 +247,7 @@ Runtime::registerStub(const std::string &_domain, const std::string &_interface, if (!isRegistered) { std::string library = getLibrary(_domain, _interface, _instance, false); std::lock_guard itsGuard(loadMutex_); - loadLibrary(library); - { + if (loadLibrary(library) || defaultFactory_) { isRegistered = registerStubHelper(_domain, _interface, _instance, _stub, _connectionId, true); } } @@ -265,8 +262,7 @@ Runtime::registerStub(const std::string &_domain, const std::string &_interface, if (!isRegistered) { std::string library = getLibrary(_domain, _interface, _instance, false); std::lock_guard itsGuard(loadMutex_); - loadLibrary(library); - { + if (loadLibrary(library) || defaultFactory_) { isRegistered = registerStubHelper(_domain, _interface, _instance, _stub, _context, true); } } @@ -342,7 +338,7 @@ Runtime::loadLibrary(const std::string &_library) { loadedLibraries_.insert(itsLibrary); COMMONAPI_DEBUG("Loading interface library \"", itsLibrary, "\" succeeded."); } else { - //COMMONAPI_ERROR("Loading interface library \"", itsLibrary, "\" failed (", GetLastError(), ")"); + COMMONAPI_DEBUG("Loading interface library \"", itsLibrary, "\" failed (", GetLastError(), ")"); isLoaded = false; } #else @@ -351,7 +347,7 @@ Runtime::loadLibrary(const std::string &_library) { COMMONAPI_DEBUG("Loading interface library \"", itsLibrary, "\" succeeded."); } else { - //COMMONAPI_ERROR("Loading interface library \"", itsLibrary, "\" failed (", dlerror(), ")"); + COMMONAPI_DEBUG("Loading interface library \"", itsLibrary, "\" failed (", dlerror(), ")"); isLoaded = false; } #endif -- cgit v1.2.1