From dea4e788adf3a2432ad2835cef0d235e9f93e260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gonzalve?= Date: Sat, 28 Feb 2015 21:00:07 +0100 Subject: stop messing around with useless pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backsynchronizer is dynamically allocated for simulation purpose. Nevertheless, this is useless as this can be easily achieved thanks to a typedef. This patch simplify the backsynchronization use. Signed-off-by: Sébastien Gonzalve --- parameter/ParameterMgr.cpp | 31 +++++++++++-------------------- parameter/ParameterMgr.h | 4 ---- 2 files changed, 11 insertions(+), 24 deletions(-) (limited to 'parameter') diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index 2e66c02..45f1ac2 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -97,6 +97,15 @@ #define base CElement +#ifdef SIMULATION + // In simulation, back synchronization of the blackboard won't probably work + // We need to ensure though the blackboard is initialized with valid data + typedef CSimulatedBackSynchronizer BackSynchronizer; +#else + // Real back synchronizer from subsystems + typedef CHardwareBackSynchronizer BackSynchronizer; +#endif + using std::string; using std::list; using std::vector; @@ -467,17 +476,12 @@ bool CParameterMgr::load(string& strError) return false; } - // Back synchronization for areas in parameter blackboard not covered by any domain - CBackSynchronizer* pBackSynchronizer = createBackSynchronizer(); - // Back-synchronize { CAutoLog autoLog(this, "Main blackboard back synchronization"); - pBackSynchronizer->sync(); - - // Get rid of back synchronizer - delete pBackSynchronizer; + // Back synchronization for areas in parameter blackboard not covered by any domain + BackSynchronizer(getConstSystemClass(), _pMainParameterBlackboard).sync(); } // We're done loading the settings and back synchronizing @@ -2541,19 +2545,6 @@ bool CParameterMgr::handleRemoteProcessingInterface(string& strError) return true; } -// Back synchronization -CBackSynchronizer* CParameterMgr::createBackSynchronizer() const -{ -#ifdef SIMULATION - // In simulation, back synchronization of the blackboard won't probably work - // We need to ensure though the blackboard is initialized with valid data - return new CSimulatedBackSynchronizer(getConstSystemClass(), _pMainParameterBlackboard); -#else - // Real back synchronizer from subsystems - return new CHardwareBackSynchronizer(getConstSystemClass(), _pMainParameterBlackboard); -#endif -} - // Children typwise access CParameterFrameworkConfiguration* CParameterMgr::getFrameworkConfiguration() { diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h index 9c6d6fd..d0b71bd 100644 --- a/parameter/ParameterMgr.h +++ b/parameter/ParameterMgr.h @@ -52,7 +52,6 @@ class CSystemClassConfiguration; class CParameterBlackboard; class CConfigurableDomains; class IRemoteProcessorServerInterface; -class CBackSynchronizer; class CParameterHandle; class CSubsystemPlugins; class CParameterAccessContext; @@ -573,9 +572,6 @@ private: // Remote Processor Server connection handling bool handleRemoteProcessingInterface(std::string& strError); - // Back synchronization - CBackSynchronizer* createBackSynchronizer() const; - // Tuning bool _bTuningModeIsOn; -- cgit v1.1