summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Donchev <Aleksander.Donchev@partner.bmw.de>2013-10-10 10:00:58 +0200
committerChristian Linke <christian.linke@bmw.de>2013-10-22 13:26:58 +0200
commitcdc2a0eecd0b1e407cf9df7e9f57c9c7910ef3f8 (patch)
treea8a22fee681d2baf7cfcd564824f4a37d0c0f0db
parentd8f2b76b774f82b6caf4483b8ea4008ae36c898a (diff)
downloadaudiomanager-discovery_stable.tar.gz
* Bug #120. In CAmSerializer fixed the asyncCall function with one ref argument.discovery_stable
-rw-r--r--include/shared/CAmSerializer.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/shared/CAmSerializer.h b/include/shared/CAmSerializer.h
index 9bb2e4c..de26b58 100644
--- a/include/shared/CAmSerializer.h
+++ b/include/shared/CAmSerializer.h
@@ -113,6 +113,31 @@ private:
};
/**
+ * delegate template for one argument
+ */
+ template<class TClass, typename Targ> class CAmOneArgDelegateRef: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ void (TClass::*mFunction)(Targ&);
+ Targ mArgument;
+
+ public:
+ CAmOneArgDelegateRef(TClass* instance, void (TClass::*function)(Targ&), Targ& argument) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument)
+ {};
+
+ bool call(int* pipe)
+ {
+ (void) pipe;
+ (*mInstance.*mFunction)(mArgument);
+ return (true);
+ };
+ };
+
+ /**
* delegate template for two arguments
*/
template<class TClass, typename Targ, typename Targ1> class CAmTwoArgDelegate: public CAmDelegate
@@ -952,7 +977,7 @@ public:
template<class TClass1, class Targ>
void asyncCall(TClass1* instance, void (TClass1::*function)(Targ&), Targ& argument)
{
- CAmDelegagePtr p(new CAmOneArgDelegate<TClass1, Targ&>(instance, function, argument));
+ CAmDelegagePtr p(new CAmOneArgDelegateRef<TClass1, Targ>(instance, function, argument));
send(p);
}