diff options
author | christian mueller <christian.ei.mueller@bmw.de> | 2012-01-30 18:38:07 +0100 |
---|---|---|
committer | christian mueller <christian.ei.mueller@bmw.de> | 2012-01-31 17:40:32 +0100 |
commit | ad0c452e9890a35a1b7a6c2e2421e092c5cf2c2d (patch) | |
tree | 48cc38fa0a4ada0ece0f8571260c5438b64a675c /includes | |
parent | 58d62c4af578c10375bf9baa946e33f340c42a1f (diff) | |
download | audiomanager-ad0c452e9890a35a1b7a6c2e2421e092c5cf2c2d.tar.gz |
* wrapping DLT calls in a new Class because of performance, codesize and lazyness reasons
* the whole project now compiles without a warning with -pedantic
Diffstat (limited to 'includes')
-rw-r--r-- | includes/DLTWrapper.h | 457 | ||||
-rw-r--r-- | includes/config.h | 2 | ||||
-rw-r--r-- | includes/routing/RoutingReceiveInterface.h | 12 |
3 files changed, 464 insertions, 7 deletions
diff --git a/includes/DLTWrapper.h b/includes/DLTWrapper.h new file mode 100644 index 0000000..dcce4ab --- /dev/null +++ b/includes/DLTWrapper.h @@ -0,0 +1,457 @@ +/** + * Copyright (C) 2011, BMW AG + * + * GeniviAudioMananger AudioManagerDaemon + * + * \file DLTWrapper.h + * + * \date 20-Oct-2011 3:42:04 PM + * \author Christian Mueller (christian.ei.mueller@bmw.de) + * + * \section License + * GNU Lesser General Public License, version 2.1, with special exception (GENIVI clause) + * Copyright (C) 2011, BMW AG Christian Mueller Christian.ei.mueller@bmw.de + * + * This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation. + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License, version 2.1, for more details. + * You should have received a copy of the GNU Lesser General Public License, version 2.1, along with this program; if not, see <http://www.gnu.org/licenses/lgpl-2.1.html>. + * Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may also be applicable to programs even in cases in which the program is not a library in the technical sense. + * Linking AudioManager statically or dynamically with other modules is making a combined work based on AudioManager. You may license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to license your linked modules under the GNU Lesser General Public License, version 2.1, you may use the program under the following exception. + * As a special exception, the copyright holders of AudioManager give you permission to combine AudioManager with software programs or libraries that are released under any license unless such a combination is not permitted by the license of such a software program or library. You may copy and distribute such a system following the terms of the GNU Lesser General Public License, version 2.1, including this special exception, for AudioManager and the licenses of the other code concerned. + * Note that people who make modified versions of AudioManager are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, version 2.1, gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception. + * + */ + +#ifndef DLTWRAPPER_H_ +#define DLTWRAPPER_H_ + +#include <dlt/dlt.h> +#include <string> + +class DLTWrapper +{ +public: + static DLTWrapper* instance(); + void registerApp(const char *appid, const char * description); + void registerContext(DltContext& handle, const char *contextid, const char * description); + void unregisterContext(DltContext& handle); + void init(DltLogLevelType loglevel, DltContext* context = NULL); + void send(); + void append(const int8_t value); + void append(const uint8_t value); + void append(const int16_t value); + void append(const uint16_t value); + void append(const int32_t value); + void append(const uint32_t value); + void append(const char*& value); + void append(const std::string& value); + void append(const bool value); + ~DLTWrapper(); +private: + DLTWrapper(); //is private because of singleton pattern + DltContext mDltContext; + DltContextData mDltContextData; + static DLTWrapper* mDLTWrapper; + +}; + +inline DLTWrapper* getWrapper() +{ + return DLTWrapper::instance(); +} + +template<typename T> void logInfo(T value) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->send(); +} + +template<typename T, typename T1> void logInfo(T value, T1 value1) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->send(); +} + +template<typename T, typename T1, typename T2> void logInfo(T value, T1 value1, T2 value2) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3> void logInfo(T value, T1 value1, T2 value2, T3 value3) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_INFO); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->append(value8); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->append(value8); + inst->append(value9); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> void logInfo(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->append(value8); + inst->append(value9); + inst->append(value10); + inst->send(); +} + +template<typename T> void logError(T value) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->send(); +} + +template<typename T, typename T1> void logError(T value, T1 value1) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->send(); +} + +template<typename T, typename T1, typename T2> void logError(T value, T1 value1, T2 value2) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3> void logError(T value, T1 value1, T2 value2, T3 value3) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->append(value8); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->append(value8); + inst->append(value9); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10> void logError(T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9, T10 value10) +{ + DLTWrapper* inst(getWrapper()); + inst->init(DLT_LOG_ERROR); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->append(value8); + inst->append(value9); + inst->append(value10); + inst->send(); +} + +template<typename T> void log(DltContext* const context, DltLogLevelType loglevel, T value) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->send(); +} + +template<typename T, typename T1> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->send(); +} + +template<typename T, typename T1, typename T2> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->send(); +} + +template<typename T, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> void log(DltContext* const context, DltLogLevelType loglevel, T value, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8) +{ + DLTWrapper* inst(getWrapper()); + inst->init(loglevel, context); + inst->append(value); + inst->append(value1); + inst->append(value2); + inst->append(value3); + inst->append(value4); + inst->append(value5); + inst->append(value6); + inst->append(value7); + inst->append(value8); + inst->send(); +} + +#endif /* DLTWRAPPER_H_ */ diff --git a/includes/config.h b/includes/config.h index 920b050..a7267c1 100644 --- a/includes/config.h +++ b/includes/config.h @@ -1,7 +1,7 @@ #ifndef _CONFIG_H #define _CONFIG_H -#define DAEMONVERSION "ver-0.0.1-16-g002295b" +#define DAEMONVERSION "ver-0.0.1-17-gbef6b6f" #define WITH_DBUS_WRAPPER #define WITH_SOCKETHANDLER_LOOP diff --git a/includes/routing/RoutingReceiveInterface.h b/includes/routing/RoutingReceiveInterface.h index ff33d61..e610f92 100644 --- a/includes/routing/RoutingReceiveInterface.h +++ b/includes/routing/RoutingReceiveInterface.h @@ -22,8 +22,8 @@ *
* THIS CODE HAS BEEN GENERATED BY ENTERPRISE ARCHITECT GENIVI MODEL. PLEASE CHANGE ONLY IN ENTERPRISE ARCHITECT AND GENERATE AGAIN
*/
-#if !defined(EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_)
-#define EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_
+#if !defined(EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_)
+#define EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_
#include <vector>
#include <string>
@@ -41,7 +41,7 @@ namespace am { * Routing Receive sendInterface description. This class implements everything from RoutingAdapter -> Audiomanager * @author christian * @version 1.0 - * @created 26-Jan-2012 6:00:53 PM + * @created 30-Jan-2012 6:29:29 PM */ class RoutingReceiveInterface { @@ -253,7 +253,7 @@ namespace am { * @param name * @param sourceClassID */ - virtual am_Error_e peekSourceClassID(const std::string name, const am_sourceClass_t& sourceClassID) =0; + virtual am_Error_e peekSourceClassID(const std::string& name, const am_sourceClass_t& sourceClassID) =0; /** * this function peeks a sourceclassID. It is used by the RoutingPlugins to determine the SinkClassIDs of a sinkClass.
* @return E_OK on succes, E_DATABASE_ERROR on error @@ -261,7 +261,7 @@ namespace am { * @param name * @param sinkClassID */ - virtual am_Error_e peekSinkClassID(const std::string name, const am_sinkClass_t& sinkClassID) =0; + virtual am_Error_e peekSinkClassID(const std::string& name, const am_sinkClass_t& sinkClassID) =0; /** * is called when a low level interrupt changes it status. * @@ -332,4 +332,4 @@ namespace am { }; } -#endif // !defined(EA_6B4A81F5_2BD8_4604_859D_4539E7E95638__INCLUDED_) +#endif // !defined(EA_6B5234F4_E3F3_46f3_9B2A_892FD2A0236E__INCLUDED_) |