diff options
Diffstat (limited to 'parameter/ParameterMgrLogger.h')
-rw-r--r-- | parameter/ParameterMgrLogger.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/parameter/ParameterMgrLogger.h b/parameter/ParameterMgrLogger.h index 5a8dd9d..0e42d8a 100644 --- a/parameter/ParameterMgrLogger.h +++ b/parameter/ParameterMgrLogger.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2014, Intel Corporation + * Copyright (c) 2011-2015, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -29,22 +29,29 @@ */ #pragma once +#include "ParameterMgrLoggerForward.h" #include "ParameterMgr.h" #include <string> -class CParameterMgrPlatformConnector; - +/* Wrap a class to expose its logging [log(bool, string&)] capabilities + * through ILogger. */ +template<class T> class CParameterMgrLogger : public CParameterMgr::ILogger { public: - CParameterMgrLogger(CParameterMgrPlatformConnector* pParameterMgrPlatformConnector); + CParameterMgrLogger(T& parameterMgrConnector) : + _parameterMgrConnector(parameterMgrConnector) + { + } - // Logging - virtual void log(bool bIsWarning, const std::string& strLog); + virtual void log(bool bIsWarning, const std::string& strLog) + { + _parameterMgrConnector.doLog(bIsWarning, strLog); + } private: // Log destination - CParameterMgrPlatformConnector* _pParameterMgrPlatformConnector; + T& _parameterMgrConnector; }; |