summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexandar Donchev <Aleksander.Donchev@partner.bmw.de>2015-03-11 19:10:54 +0100
committerAlexandar Donchev <Aleksander.Donchev@partner.bmw.de>2015-03-11 19:10:54 +0100
commitc628fa5304171cd827f56aa475668d99d26ad28a (patch)
treefda6587626ce2ebfaed367ce767eddc6f3f6d3de /include
parent3ff140d47796839b0d733d2ec83a638bb5d06bb1 (diff)
downloadaudiomanager-c628fa5304171cd827f56aa475668d99d26ad28a.tar.gz
* Sound property lookup enhancement throught caching . Tests for cached sound properties.
Signed-off-by: Christian Linke <christian.linke@bmw.de> Signed-off-by: Alexandar Donchev <Aleksander.Donchev@partner.bmw.de>>
Diffstat (limited to 'include')
-rwxr-xr-xinclude/control/IAmControlReceive.h51
-rw-r--r--include/shared/CAmSerializer.h62
2 files changed, 108 insertions, 5 deletions
diff --git a/include/control/IAmControlReceive.h b/include/control/IAmControlReceive.h
index 79c0981..9f7bd4e 100755
--- a/include/control/IAmControlReceive.h
+++ b/include/control/IAmControlReceive.h
@@ -20,8 +20,8 @@
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL.
* PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN.
*/
-#if !defined(EA_770423FB_365F_4c4b_824E_276D1AE06003__INCLUDED_)
-#define EA_770423FB_365F_4c4b_824E_276D1AE06003__INCLUDED_
+#if !defined(EA_302355E7_3225_415d_AC7F_F0F7468FCCCF__INCLUDED_)
+#define EA_302355E7_3225_415d_AC7F_F0F7468FCCCF__INCLUDED_
#include <vector>
#include <string>
@@ -30,11 +30,11 @@ namespace am {
class CAmSocketHandler;
}
+#include "NodeStateManager.h"
#include "audiomanagertypes.h"
-#include "NodeStateManager.h"
-#define ControlReceiveVersion "3.0"
+#define ControlReceiveVersion "3.1"
namespace am {
/**
@@ -652,7 +652,48 @@ public:
* @return NsmErrorStatus_Ok in case of success
*/
virtual NsmErrorStatus_e sendLifecycleRequestCompleteNSM(const uint32_t RequestId, const NsmErrorStatus_e status) =0;
+ /**
+ * This function retrieves a list of all sink mainsoundproperties with its values
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getListMainSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_MainSoundProperty_s>& listSoundproperties) const =0;
+ /**
+ * This function retrieves a list of all source mainsoundproperties with its
+ * values
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getListMainSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_MainSoundProperty_s>& listSoundproperties) const =0;
+ /**
+ * This function retrieves a list of all sink soundproperties with its values
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getListSinkSoundProperties(const am_sinkID_t sinkID, std::vector<am_SoundProperty_s>& listSoundproperties) const =0;
+ /**
+ * This function retrieves a list of all sink soundproperties with its values
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getListSourceSoundProperties(const am_sourceID_t sourceID, std::vector<am_SoundProperty_s>& listSoundproperties) const =0;
+ /**
+ * This function retrieves the value of a sink Mainsoundproperty.
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getMainSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_CustomMainSoundPropertyType_t propertyType, int16_t& value) const =0;
+ /**
+ * This function retrieves the value of a sink soundproperty.
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getSinkSoundPropertyValue(const am_sinkID_t sinkID, const am_CustomSoundPropertyType_t propertyType, int16_t& value) const =0;
+ /**
+ * This function retrieves the value of a source Mainsoundproperty.
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getMainSourceSoundPropertyValue(const am_sourceID_t sourceID, const am_CustomMainSoundPropertyType_t propertyType, int16_t& value) const =0;
+ /**
+ * This function retrieves the value of a source soundproperty.
+ * @return E_OK when successful, E_DATABASE on error
+ */
+ virtual am_Error_e getSourceSoundPropertyValue(const am_sourceID_t sourceID, const am_CustomSoundPropertyType_t propertyType, int16_t& value) const =0;
};
}
-#endif // !defined(EA_770423FB_365F_4c4b_824E_276D1AE06003__INCLUDED_)
+#endif // !defined(EA_302355E7_3225_415d_AC7F_F0F7468FCCCF__INCLUDED_)
diff --git a/include/shared/CAmSerializer.h b/include/shared/CAmSerializer.h
index ff131d4..7d6cf80 100644
--- a/include/shared/CAmSerializer.h
+++ b/include/shared/CAmSerializer.h
@@ -745,6 +745,48 @@ private:
};
/**
+ * template for synchronous const calls with three arguments
+ */
+ template<class TClass, typename TretVal, typename TargCall, typename TargCall1, typename TargCall2, typename Targ, typename Targ1, typename Targ2> class CAmSyncThreeArgConstDelegate: public CAmDelegate
+ {
+ private:
+ TClass* mInstance;
+ TretVal (TClass::*mFunction)(TargCall argument, TargCall1 argument1, TargCall2 argument2) const;
+ Targ mArgument;
+ Targ1 mArgument1;
+ Targ2 mArgument2;
+ TretVal mRetval;
+
+ public:
+ CAmSyncThreeArgConstDelegate(TClass* instance, TretVal (TClass::*function)(TargCall argument, TargCall1 argument1, TargCall2 argument2) const, Targ argument, Targ1 argument1, Targ2 argument2) :
+ mInstance(instance), //
+ mFunction(function), //
+ mArgument(argument), //
+ mArgument1(argument1), //
+ mArgument2(argument2), //
+ mRetval()
+ {
+ }
+ ;
+
+ bool call(int* pipe)
+ {
+ mRetval = (*mInstance.*mFunction)(mArgument, mArgument1, mArgument2);
+ write(pipe[1], this, sizeof(this));
+ return (false);
+ }
+ ;
+
+ TretVal returnResults(Targ& argument, Targ1& argument1, Targ2& argument2)
+ {
+ argument = mArgument;
+ argument1 = mArgument1;
+ argument2 = mArgument2;
+ return (mRetval);
+ }
+ };
+
+ /**
* template for synchronous calls with four arguments
*/
template<class TClass, typename TretVal, typename TargCAll, typename TargCall1, typename TargCall2, typename TargCall3, typename Targ, typename Targ1, typename Targ2, typename Targ3> class CAmSyncFourArgDelegate: public CAmDelegate
@@ -1301,6 +1343,26 @@ public:
}
/**
+ * calls a const function with three arguments synchronously threadsafe. for more see syncCall with one argument
+ */
+ template<class TClass1, class TretVal, class TargCall, class TargCall1, class TargCall2, class Targ, class Targ1, class Targ2>
+ void syncCall(TClass1* instance, TretVal (TClass1::*function)(TargCall, TargCall1, TargCall2) const, TretVal& retVal, Targ& argument, Targ1& argument1, Targ2& argument2)
+ {
+ CAmSyncThreeArgConstDelegate<TClass1, TretVal, TargCall, TargCall1, TargCall2, Targ, Targ1, Targ2>* p(new CAmSyncThreeArgConstDelegate<TClass1, TretVal, TargCall, TargCall1, TargCall2, Targ, Targ1, Targ2>(instance, function, argument, argument1, argument2));
+ send(static_cast<CAmDelegagePtr>(p));
+ int numReads;
+ CAmDelegagePtr ptr;
+ if ((numReads = read(mReturnPipe[0], &ptr, sizeof(ptr))) == -1)
+ {
+ logError("CAmSerializer::receiverCallback could not read pipe!");
+ throw std::runtime_error("CAmSerializer Could not read pipe!");
+ }
+ //working with friend class here is not the finest of all programming stiles but it worCAmTwoArgDelegateks...
+ retVal = p->returnResults(argument, argument1, argument2);
+ delete p;
+ }
+
+ /**
* calls a function with four arguments synchronously threadsafe. for more see syncCall with one argument
*/
template<class TClass1, class TretVal, class TargCall, class TargCall1, class TargCall2, class TargCall3, class Targ, class Targ1, class Targ2, class Targ3>