Skip to content

Commit

Permalink
Added: smart pointers in ParameterMgrPlatformConnector issue intel#311
Browse files Browse the repository at this point in the history
  • Loading branch information
vlmarkov committed Jan 28, 2019
1 parent 4842b32 commit 432af36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions parameter/ParameterMgrPlatformConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,15 @@ using std::string;
// Construction
CParameterMgrPlatformConnector::CParameterMgrPlatformConnector(
const string &strConfigurationFilePath)
: _pParameterMgrLogger(new CParameterMgrLogger<CParameterMgrPlatformConnector>(*this)),
_pParameterMgr(new CParameterMgr(strConfigurationFilePath, *_pParameterMgrLogger)),
: _pParameterMgrLogger(utility::make_unique<CParameterMgrLogger<CParameterMgrPlatformConnector>>(*this)),
_pParameterMgr(utility::make_unique<CParameterMgr>(strConfigurationFilePath, *_pParameterMgrLogger)),
_bStarted(false), _pLogger(nullptr)
{
}

CParameterMgrPlatformConnector::~CParameterMgrPlatformConnector()
{
delete _pParameterMgr;
delete _pParameterMgrLogger;
;
}

// Selection Criteria interface. Beware returned objects are lent, clients shall not delete them!
Expand Down
5 changes: 3 additions & 2 deletions parameter/include/ParameterMgrPlatformConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "ParameterHandle.h"
#include "ElementHandle.h"
#include "ParameterMgrLoggerForward.h"
#include "Memory.hpp"

class CParameterMgr;

Expand Down Expand Up @@ -196,9 +197,9 @@ class PARAMETER_EXPORT CParameterMgrPlatformConnector

protected:
// Private logging
CParameterMgrLogger<CParameterMgrPlatformConnector> *_pParameterMgrLogger;
std::unique_ptr<CParameterMgrLogger<CParameterMgrPlatformConnector>> _pParameterMgrLogger;
// Implementation
CParameterMgr *_pParameterMgr;
std::unique_ptr<CParameterMgr> _pParameterMgr;
// State
bool _bStarted;
// Logging
Expand Down

0 comments on commit 432af36

Please sign in to comment.