summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities
diff options
context:
space:
mode:
authorAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2015-10-02 13:09:08 +0200
committerAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2015-10-02 13:09:08 +0200
commit6b730d5d2f993a7acddba2ba7ed649ef308a8e8e (patch)
tree4654ae96abe125990766bc172b566b19520c9205 /AudioManagerUtilities
parentbd7ec24a2abe47ae4398b23282e8288e00eaec47 (diff)
downloadaudiomanager-6b730d5d2f993a7acddba2ba7ed649ef308a8e8e.tar.gz
* Settings for commonAPI without binding code.
Signed-off-by: Christian Linke <christian.linke@bmw.de>
Diffstat (limited to 'AudioManagerUtilities')
-rw-r--r--AudioManagerUtilities/include/CAmCommonAPIWrapper.h16
-rw-r--r--AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp18
2 files changed, 10 insertions, 24 deletions
diff --git a/AudioManagerUtilities/include/CAmCommonAPIWrapper.h b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
index fd5a784..f2d701d 100644
--- a/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
+++ b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
@@ -26,10 +26,18 @@
#include <memory>
#include <cassert>
#include <CommonAPI/CommonAPI.hpp>
+#ifndef COMMONAPI_INTERNAL_COMPILATION
+#define COMMONAPI_INTERNAL_COMPILATION
+#include <CommonAPI/MainLoopContext.hpp>
+#undef COMMONAPI_INTERNAL_COMPILATION
+#endif
#include <CommonAPI/Utils.hpp>
#include "audiomanagerconfig.h"
#include "CAmSocketHandler.h"
+#if COMMONAPI_VERSION_NUMBER < 300
+#error "CommonAPI versions < 300 are not supported."
+#endif
/**
* A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects.
@@ -262,14 +270,6 @@ public:
return buildProxy<ProxyClass>(parts[0], parts[2]);
}
- /**The following code is deprecated and it might be unavailable in future versions!
- * Compatibility to versions prior 3.0.0
- */
-private:
- std::shared_ptr<CommonAPI::Factory> mFactory;
-public:
- std::shared_ptr<CommonAPI::Factory> __attribute__((deprecated)) factory() const { return mFactory; };
- std::shared_ptr<CommonAPI::Runtime> __attribute__((deprecated)) runtime() const { return mRuntime; };
};
diff --git a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
index 238fa32..6e0cb90 100644
--- a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
@@ -46,12 +46,11 @@ CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler, const
mWatchToCheck(NULL)
{
assert(NULL!=socketHandler);
-
- //Get the runtime
+//Get the runtime
CommonAPI::Runtime::setProperty("LogContext", "AMCAPI");
mRuntime = CommonAPI::Runtime::get();
- logInfo("CommonAPI runtime has been loaded! Default Binding is", mRuntime->getDefaultBinding());
assert(NULL!=mRuntime);
+ logInfo("CommonAPI runtime has been loaded! Default Binding is", mRuntime->getDefaultBinding());
//Create the context
if(applicationName.size())
@@ -61,17 +60,6 @@ CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler, const
assert(NULL!=mContext);
logInfo("CommonAPI main loop context with name '", mContext->getName(), "' has been created!");
-// #if COMMONAPI_USED_BINDING > 0
-// mFactory = CommonAPI::SomeIP::Factory::get();
-// assert(mFactory);
-// mRuntime->registerFactory("someip", mFactory);
-// #else
-// mFactory = CommonAPI::DBus::Factory::get();
-// assert(mFactory);
-// mRuntime->registerFactory("dbus", mFactory);
-// #endif
-
-
//Make subscriptions
mDispatchSourceListenerSubscription = mContext->subscribeForDispatchSources(
std::bind(&CAmCommonAPIWrapper::registerDispatchSource, this, std::placeholders::_1, std::placeholders::_2),
@@ -89,9 +77,7 @@ CAmCommonAPIWrapper::~CAmCommonAPIWrapper()
mContext->unsubscribeForDispatchSources(mDispatchSourceListenerSubscription);
mContext->unsubscribeForWatches(mWatchListenerSubscription);
mContext->unsubscribeForTimeouts(mTimeoutSourceListenerSubscription);
- mFactory.reset();
mContext.reset();
- mRuntime.reset();
mpSocketHandler = NULL;
mWatchToCheck = NULL;
}