summaryrefslogtreecommitdiff
path: root/AudioManagerUtilities
diff options
context:
space:
mode:
Diffstat (limited to 'AudioManagerUtilities')
-rw-r--r--AudioManagerUtilities/include/CAmCommonAPIWrapper.h235
-rw-r--r--AudioManagerUtilities/include/CAmDltWrapper.h2
-rw-r--r--AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp110
3 files changed, 232 insertions, 115 deletions
diff --git a/AudioManagerUtilities/include/CAmCommonAPIWrapper.h b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
index e756cc7..08823af 100644
--- a/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
+++ b/AudioManagerUtilities/include/CAmCommonAPIWrapper.h
@@ -24,28 +24,82 @@
#include <map>
#include <queue>
#include <memory>
-#include <CommonAPI/CommonAPI.h>
+#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 "config.h"
#include "CAmSocketHandler.h"
/**
- * A Common-API wrapper class, that loads the common-api runtime and instantiates all necessary other objects. Works with the CAmSocketHandler.
- * It is implemented as singleton and usually once instantiated at the beginning with CAmSocketHandler.
+ * A Common-API wrapper class, which loads the common-api runtime and instantiates all necessary objects.
+ * It is implemented as singleton and usually instantiated at the beginning with CAmSocketHandler as parameter.
* Example: CAmCommonAPIWrapper *pCAPIWrapper = CAmCommonAPIWrapper::instantiateOnce( aSocketHandlerPointer );
*/
namespace am
{
-using namespace CommonAPI;
class CAmSocketHandler;
class CAmCommonAPIWrapper
{
+ void commonPrepareCallback(const sh_pollHandle_t handle, void* userData);
+ TAmShPollPrepare<CAmCommonAPIWrapper> pCommonPrepareCallback;
+
+ bool commonDispatchCallback(const sh_pollHandle_t handle, void* userData);
+ TAmShPollDispatch<CAmCommonAPIWrapper> pCommonDispatchCallback;
+
+ void commonFireCallback(const pollfd pollfd, const sh_pollHandle_t, void*);
+ TAmShPollFired<CAmCommonAPIWrapper> pCommonFireCallback;
+
+ bool commonCheckCallback(const sh_pollHandle_t handle, void*);
+ TAmShPollCheck<CAmCommonAPIWrapper> pCommonCheckCallback;
+
+ void commonTimerCallback(sh_timerHandle_t handle, void* userData);
+ TAmShTimerCallBack<CAmCommonAPIWrapper> pCommonTimerCallback;
+
+ struct timerHandles
+ {
+ sh_timerHandle_t handle;
+ CommonAPI::Timeout* timeout;
+ };
+
+ CAmSocketHandler *mpSocketHandler; //!< pointer to the sockethandler
+
+ std::shared_ptr<CommonAPI::Runtime> mRuntime;
+ std::shared_ptr<CommonAPI::MainLoopContext> mContext;
+
+ CommonAPI::DispatchSourceListenerSubscription mDispatchSourceListenerSubscription;
+ CommonAPI::WatchListenerSubscription mWatchListenerSubscription;
+ CommonAPI::TimeoutSourceListenerSubscription mTimeoutSourceListenerSubscription;
+ CommonAPI::WakeupListenerSubscription mWakeupListenerSubscription;
+ std::multimap<CommonAPI::DispatchPriority, CommonAPI::DispatchSource*> mRegisteredDispatchSources;
+ std::map<int,CommonAPI::Watch*> mMapWatches;
+ CommonAPI::Watch* mWatchToCheck;
+ std::list<CommonAPI::DispatchSource*> mSourcesToDispatch;
+ std::vector<timerHandles> mpListTimerhandles;
+
+ void registerDispatchSource(CommonAPI::DispatchSource* dispatchSource, const CommonAPI::DispatchPriority dispatchPriority);
+ void deregisterDispatchSource(CommonAPI::DispatchSource* dispatchSource);
+ void registerWatch(CommonAPI::Watch* watch, const CommonAPI::DispatchPriority dispatchPriority);
+ void deregisterWatch(CommonAPI::Watch* watch);
+ void registerTimeout(CommonAPI::Timeout* timeout, const CommonAPI::DispatchPriority dispatchPriority);
+ void deregisterTimeout(CommonAPI::Timeout* timeout);
+ void wakeup();
+
+protected:
+ CAmCommonAPIWrapper(CAmSocketHandler* socketHandler) ;
+
public:
virtual ~CAmCommonAPIWrapper();
+
/**
* \brief Returns an already instantiated object.
*
@@ -54,6 +108,7 @@ public:
* @return The common-api wrapper object.
*/
static CAmCommonAPIWrapper* getInstance();
+
/**
* \brief Creates a singleton instance attached to the provided socket handler object.
*
@@ -67,74 +122,142 @@ public:
*/
static CAmCommonAPIWrapper* instantiateOnce(CAmSocketHandler* socketHandler);
- void registerDispatchSource(DispatchSource* dispatchSource, const DispatchPriority dispatchPriority);
- void deregisterDispatchSource(DispatchSource* dispatchSource);
- void registerWatch(Watch* watch, const DispatchPriority dispatchPriority);
- void deregisterWatch(Watch* watch);
- void registerTimeout(Timeout* timeout, const DispatchPriority dispatchPriority);
- void deregisterTimeout(Timeout* timeout);
- void wakeup();
- std::shared_ptr<CommonAPI::Factory> factory() const;
- std::shared_ptr<CommonAPI::Runtime> runtime() const;
- //Wraps the invitation to the service publisher
- template <class TStubImp> bool registerStub(const std::shared_ptr<TStubImp> & shStub, const std::string & aCommonAPIAddress)
+ /**
+ * \brief Getter for the socket handler.
+ *
+ * @return Pointer to the socket handler.
+ */
+ CAmSocketHandler *getSocketHandler() const { return mpSocketHandler; }
+
+ /**
+ * \brief Register stub objects.
+ *
+ * Example: std::shared_ptr<ConcreteStubClass> aStub;
+ * registerService( aStub, "local", "com.your_company.instance_name");
+ *
+ * @param shStub: Shared pointer to a stub instance
+ * @param domain: A string with the domain name, usually "local"
+ * @param instance: Common-api instance string as example "com.your_company.instance_name"
+ *
+ */
+ template <class TStubImp> bool registerService(const std::shared_ptr<TStubImp> & shStub, const std::string & domain, const std::string & instance)
{
- return runtime()->getServicePublisher()->registerService(shStub, aCommonAPIAddress, factory());
+ return mRuntime->registerService(domain, instance, shStub, mContext);
}
- bool unregisterStub(const std::string & aCommonAPIAddress)
- {
- (void)aCommonAPIAddress;
- /** Not implemented yet
- todo: Check whether the appropriate method is available and uncomment...
- return runtime()->getServicePublisher()->unregisterService(aCommonAPIAddress);
- */
- return true;
+ /**
+ * \brief Unregister stub objects.
+ *
+ * @param domain: A string with the domain name, usually "local"
+ * @param interface: Common-api interface string as example "com.your_company.interface_name"
+ * @param instance: Common-api instance string as example "com.your_company.instance_name"
+ *
+ */
+ bool unregisterService(const std::string &domain, const std::string &interface, const std::string &instance)
+ {
+ return mRuntime->unregisterService(domain, interface, instance);
}
+ /**
+ * \brief Deprecated method. Instead you should use bool registerService(const std::shared_ptr<TStubImp> & shStub, const std::string & domain, const std::string & instance).
+ *
+ * Register stub objects.
+ *
+ * Example: std::shared_ptr<ConcreteStubClass> aStub;
+ * registerService( aStub, "local:com.your_company.interface_name:com.your_company.instance_name");
+ *
+ * @param shStub: Shared pointer to a stub instance
+ * @param address: Complete common-api address as example "local:com.your_company.interface_name:com.your_company.instance_name"
+ *
+ */
+ template <class TStubImp> bool __attribute__((deprecated)) registerStub(const std::shared_ptr<TStubImp> & shStub, const std::string & address)
+ {
+ std::vector<std::string> parts = CommonAPI::split(address, ':');
+ assert(parts.size()==3);
-protected:
- CAmCommonAPIWrapper(CAmSocketHandler* socketHandler) ;
-private:
- void commonPrepareCallback(const sh_pollHandle_t handle, void* userData);
- TAmShPollPrepare<CAmCommonAPIWrapper> pCommonPrepareCallback;
+ return registerService(shStub, parts[0], parts[2]);
+ }
- bool commonDispatchCallback(const sh_pollHandle_t handle, void* userData);
- TAmShPollDispatch<CAmCommonAPIWrapper> pCommonDispatchCallback;
+ /**
+ * \brief Deprecated method. Instead you should use bool unregisterService(const std::string &domain, const std::string &interface, const std::string &instance).
+ *
+ * Unregister stub objects.
+ *
+ * @param address: Complete common-api address as example "local:com.your_company.interface_name:com.your_company.instance_name"
+ *
+ */
+ bool __attribute__((deprecated)) unregisterStub(const std::string & address)
+ {
+ std::vector<std::string> parts = CommonAPI::split(address, ':');
+ assert(parts.size()==3);
- void commonFireCallback(const pollfd pollfd, const sh_pollHandle_t, void*);
- TAmShPollFired<CAmCommonAPIWrapper> pCommonFireCallback;
+ return unregisterService(parts[0], parts[1], parts[2]);
+ }
- bool commonCheckCallback(const sh_pollHandle_t handle, void*);
- TAmShPollCheck<CAmCommonAPIWrapper> pCommonCheckCallback;
- void commonTimerCallback(sh_timerHandle_t handle, void* userData);
- TAmShTimerCallBack<CAmCommonAPIWrapper> pCommonTimerCallback;
+ /**
+ * \brief Build proxy objects.
+ *
+ * Example: std::shared_ptr<AProxyClass<>> aProxy = buildProxy<AProxyClass>("local", "com.your_company.instance_name");
+ *
+ * @param domain: A string with the domain name, usually "local"
+ * @param instance: Common-api instance string as example "com.your_company.instance_name"
+ *
+ * @return A proxy object.
+ */
+ template<template<typename ...> class ProxyClass, typename ... AttributeExtensions>
+ std::shared_ptr<ProxyClass<AttributeExtensions...>> buildProxy(const std::string &domain, const std::string &instance)
+ {
+ return mRuntime->buildProxy<ProxyClass>(domain, instance, mContext);
+ }
- struct timerHandles
- {
- sh_timerHandle_t handle;
- Timeout* timeout;
- };
- //!< reference to the dbus instance
- CAmSocketHandler *mpSocketHandler; //!< pointer to the sockethandler
- std::shared_ptr<CommonAPI::Factory> mFactory;
- std::shared_ptr<CommonAPI::MainLoopContext> mContext;
+ /**
+ * \brief Deprecated method. Instead you should use buildProxy(const std::string &domain, const std::string &instance).
+ *
+ * Build proxy objects.
+ * Example: std::shared_ptr<AProxyClass<>> aProxy = buildProxy<AProxyClass>("local:com.your_company.interface_name:com.your_company.instance_name");
+ *
+ * @param address: Complete common-api address as example "local:com.your_company.interface_name:com.your_company.instance_name"
+ *
+ * @return A proxy object.
+ */
+ template<template<typename ...> class ProxyClass, typename ... AttributeExtensions>
+ std::shared_ptr<ProxyClass<AttributeExtensions...>> __attribute__((deprecated)) buildProxy(const std::string & address)
+ {
+ std::vector<std::string> parts=CommonAPI::split(address, ':');
+ assert(parts.size()==3);
- DispatchSourceListenerSubscription mDispatchSourceListenerSubscription;
- WatchListenerSubscription mWatchListenerSubscription;
- TimeoutSourceListenerSubscription mTimeoutSourceListenerSubscription;
- WakeupListenerSubscription mWakeupListenerSubscription;
- std::multimap<DispatchPriority, DispatchSource*> mRegisteredDispatchSources;
- std::map<int,Watch*> mMapWatches;
- Watch* mWatchToCheck;
- std::list<DispatchSource*> mSourcesToDispatch;
- std::vector<timerHandles> mpListTimerhandles;
+ 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; };
};
-#define Am_CAPI CAmCommonAPIWrapper::getInstance()
+
+//Alias
+extern CAmCommonAPIWrapper* (*getCAPI)();
+
+#ifndef AMCAPI
+ #define AMCAPI getCAPI()
+#endif
+
+#ifndef AM_CAPI
+ #define AM_CAPI getCAPI()
+#endif
+
+#ifndef CAPI
+ #define CAPI getCAPI()
+#endif
+
}
diff --git a/AudioManagerUtilities/include/CAmDltWrapper.h b/AudioManagerUtilities/include/CAmDltWrapper.h
index fb28f78..a7e464d 100644
--- a/AudioManagerUtilities/include/CAmDltWrapper.h
+++ b/AudioManagerUtilities/include/CAmDltWrapper.h
@@ -25,7 +25,7 @@
#include "audiomanagertypes.h"
#ifdef WITH_DLT
-#include <dlt.h>
+#include <dlt/dlt.h>
namespace am
{
#else
diff --git a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
index f486920..9bfeadb 100644
--- a/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
+++ b/AudioManagerUtilities/src/CAmCommonAPIWrapper.cpp
@@ -1,44 +1,48 @@
/**
- * SPDX license identifier: MPL-2.0
+ * SPDX license identifier: MPL-2.0
*
- * Copyright (C) 2012, BMW AG
- *
- * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
- * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
+ * Copyright (C) 2012, BMW AG
*
+ * \author Christian Linke, christian.linke@bmw.de BMW 2011,2012
+ * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013
*
* \copyright
* This Source Code Form is subject to the terms of the
* Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
- * \file CAmCommonAPIWrapper.cpp
- * For further information see http://www.genivi.org/.
+ * \file CAmCommonAPIWrapper.cpp
+ * For further information see http://www.genivi.org/.
*/
#include <config.h>
#include <fstream>
#include <sstream>
-#include <string>
#include <algorithm>
-#include <cassert>
#include <cstdlib>
#include <stdexcept>
#include <poll.h>
#include <tuple>
+#include <sstream>
+#include <vector>
#include "audiomanagertypes.h"
#include "CAmSocketHandler.h"
#include "CAmDltWrapper.h"
#include "CAmCommonAPIWrapper.h"
+#ifndef COMMONAPI_INTERNAL_COMPILATION
+#define COMMONAPI_INTERNAL_COMPILATION
+#include <CommonAPI/DBus/DBusFactory.hpp>
+#undef COMMONAPI_INTERNAL_COMPILATION
+#endif
+
+
namespace am
{
static CAmCommonAPIWrapper* pSingleCommonAPIInstance = NULL;
-using namespace CommonAPI;
-
CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler):
pCommonPrepareCallback(this,&CAmCommonAPIWrapper::commonPrepareCallback), //
pCommonDispatchCallback(this, &CAmCommonAPIWrapper::commonDispatchCallback), //
@@ -49,12 +53,29 @@ CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler):
mWatchToCheck(NULL)
{
assert(NULL!=socketHandler);
-//1. Load the runtime
- std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load();
-//2. Get the context and store a pointer to it
- mContext = runtime->getNewMainLoopContext();
-//3. Make subscriptions
- mDispatchSourceListenerSubscription = mContext->subscribeForDispatchSources(
+//Get the runtime
+#if COMMONAPI_VERSION_NUMBER < 300
+ mRuntime = CommonAPI::Runtime::load();
+#else
+ mRuntime = CommonAPI::Runtime::get();
+#endif
+ assert(NULL!=mRuntime);
+
+//Create the context
+ mContext = std::make_shared<CommonAPI::MainLoopContext>();
+ assert(NULL!=mContext);
+
+#if COMMONAPI_VERSION_NUMBER < 300
+ mFactory = runtime->createFactory(mContext);
+ assert(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),
std::bind(&CAmCommonAPIWrapper::deregisterDispatchSource, this, std::placeholders::_1));
mWatchListenerSubscription = mContext->subscribeForWatches(
@@ -63,20 +84,6 @@ CAmCommonAPIWrapper::CAmCommonAPIWrapper(CAmSocketHandler* socketHandler):
mTimeoutSourceListenerSubscription = mContext->subscribeForTimeouts(
std::bind(&CAmCommonAPIWrapper::registerTimeout, this, std::placeholders::_1, std::placeholders::_2),
std::bind(&CAmCommonAPIWrapper::deregisterTimeout, this, std::placeholders::_1));
-//4. Create the factory
- std::shared_ptr<CommonAPI::Factory> factory = runtime->createFactory(mContext);
- assert(factory);
- logInfo(__PRETTY_FUNCTION__,"CommonAPI -> Factory created");
- mFactory = factory;
-//5. Get the publisher V.2.1
-// std::shared_ptr<CommonAPI::ServicePublisher> servicePublisher = runtime->getServicePublisher();
-// assert(servicePublisher);
-// logInfo(__PRETTY_FUNCTION__,"CommonAPI -> Publisher available");
-//6. Instantiate your concrete stub implementations
-// std::shared_ptr<StubImpl> theStub = std::make_shared<StubImpl>(1);
-//7. Register the services
-// std::string capiAddress("local:org.genivi.audiomanager.sourcestate:de.bmw.infotainment.broadcast.ta");
-// registerStub(theStub, capiAddress);
}
CAmCommonAPIWrapper::~CAmCommonAPIWrapper()
@@ -84,10 +91,9 @@ CAmCommonAPIWrapper::~CAmCommonAPIWrapper()
mContext->unsubscribeForDispatchSources(mDispatchSourceListenerSubscription);
mContext->unsubscribeForWatches(mWatchListenerSubscription);
mContext->unsubscribeForTimeouts(mTimeoutSourceListenerSubscription);
-//The following objects must be released in the given order.
mFactory.reset();
mContext.reset();
-
+ mRuntime.reset();
mpSocketHandler = NULL;
mWatchToCheck = NULL;
}
@@ -112,26 +118,15 @@ CAmCommonAPIWrapper* CAmCommonAPIWrapper::getInstance()
return pSingleCommonAPIInstance;
}
-std::shared_ptr<CommonAPI::Factory> CAmCommonAPIWrapper::factory() const
-{
- return mFactory;
-}
-
-
-std::shared_ptr<CommonAPI::Runtime> CAmCommonAPIWrapper::runtime() const
-{
- return mFactory->getRuntime();
-}
-
bool CAmCommonAPIWrapper::commonDispatchCallback(const sh_pollHandle_t handle, void *userData)
{
(void) handle;
(void) userData;
- std::list<DispatchSource*>::iterator iterator(mSourcesToDispatch.begin());
+ std::list<CommonAPI::DispatchSource*>::iterator iterator(mSourcesToDispatch.begin());
for(;iterator!=mSourcesToDispatch.end();)
{
- DispatchSource* source = *iterator;
+ CommonAPI::DispatchSource* source = *iterator;
if (!source->dispatch()) {
iterator=mSourcesToDispatch.erase(iterator);
}
@@ -146,7 +141,7 @@ bool CAmCommonAPIWrapper::commonDispatchCallback(const sh_pollHandle_t handle, v
bool CAmCommonAPIWrapper::commonCheckCallback(const sh_pollHandle_t, void *)
{
- std::vector<DispatchSource*> vecDispatch=mWatchToCheck->getDependentDispatchSources();
+ std::vector<CommonAPI::DispatchSource*> vecDispatch=mWatchToCheck->getDependentDispatchSources();
mSourcesToDispatch.insert(mSourcesToDispatch.end(), vecDispatch.begin(), vecDispatch.end());
return (mWatchToCheck || !mSourcesToDispatch.empty());
@@ -173,7 +168,7 @@ void CAmCommonAPIWrapper::commonPrepareCallback(const sh_pollHandle_t, void*)
dispatchSourceIterator != mRegisteredDispatchSources.end();
dispatchSourceIterator++)
{
- int64_t dispatchTimeout(TIMEOUT_INFINITE);
+ int64_t dispatchTimeout(CommonAPI::TIMEOUT_INFINITE);
if(dispatchSourceIterator->second->prepare(dispatchTimeout))
{
while (dispatchSourceIterator->second->dispatch());
@@ -181,12 +176,12 @@ void CAmCommonAPIWrapper::commonPrepareCallback(const sh_pollHandle_t, void*)
}
}
-void CAmCommonAPIWrapper::registerDispatchSource(DispatchSource* dispatchSource, const DispatchPriority dispatchPriority)
+void CAmCommonAPIWrapper::registerDispatchSource(CommonAPI::DispatchSource* dispatchSource, const CommonAPI::DispatchPriority dispatchPriority)
{
mRegisteredDispatchSources.insert({dispatchPriority, dispatchSource});
}
-void CAmCommonAPIWrapper::deregisterDispatchSource(DispatchSource* dispatchSource)
+void CAmCommonAPIWrapper::deregisterDispatchSource(CommonAPI::DispatchSource* dispatchSource)
{
for(auto dispatchSourceIterator = mRegisteredDispatchSources.begin();
dispatchSourceIterator != mRegisteredDispatchSources.end();
@@ -199,10 +194,9 @@ void CAmCommonAPIWrapper::deregisterDispatchSource(DispatchSource* dispatchSourc
}
}
-void CAmCommonAPIWrapper::deregisterWatch(Watch* watch)
+void CAmCommonAPIWrapper::deregisterWatch(CommonAPI::Watch* watch)
{
- logInfo(__PRETTY_FUNCTION__);
- for(std::map<int,Watch*>::iterator iter(mMapWatches.begin());iter!=mMapWatches.end();iter++)
+ for(std::map<int,CommonAPI::Watch*>::iterator iter(mMapWatches.begin());iter!=mMapWatches.end();iter++)
{
if (iter->second == watch)
{
@@ -212,9 +206,8 @@ void CAmCommonAPIWrapper::deregisterWatch(Watch* watch)
}
}
-void CAmCommonAPIWrapper::registerTimeout(Timeout* timeout, const DispatchPriority)
+void CAmCommonAPIWrapper::registerTimeout(CommonAPI::Timeout* timeout, const CommonAPI::DispatchPriority)
{
- logInfo(__PRETTY_FUNCTION__);
timespec pollTimeout;
int64_t localTimeout = timeout->getTimeoutInterval();
@@ -233,9 +226,8 @@ void CAmCommonAPIWrapper::registerTimeout(Timeout* timeout, const DispatchPriori
return;
}
-void CAmCommonAPIWrapper::deregisterTimeout(Timeout* timeout)
+void CAmCommonAPIWrapper::deregisterTimeout(CommonAPI::Timeout* timeout)
{
- logInfo(__PRETTY_FUNCTION__);
for( std::vector<timerHandles>::iterator iter(mpListTimerhandles.begin());iter!=mpListTimerhandles.end();iter++)
{
if(iter->timeout==timeout)
@@ -245,7 +237,7 @@ void CAmCommonAPIWrapper::deregisterTimeout(Timeout* timeout)
}
}
-void CAmCommonAPIWrapper::registerWatch(Watch* watch, const DispatchPriority)
+void CAmCommonAPIWrapper::registerWatch(CommonAPI::Watch* watch, const CommonAPI::DispatchPriority)
{
logInfo(__PRETTY_FUNCTION__);
pollfd pollfd_ (watch->getAssociatedFileDescriptor());
@@ -271,4 +263,6 @@ void CAmCommonAPIWrapper::commonTimerCallback(sh_timerHandle_t handle, void *)
}
}
+CAmCommonAPIWrapper* (*getCAPI)() = CAmCommonAPIWrapper::getInstance;
+
}