Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Added: smart pointers in ParameterMgrPlatformConnector issue #311
Browse files Browse the repository at this point in the history
  • Loading branch information
vlmarkov committed Jan 28, 2019
1 parent 4842b32 commit 2e4e3ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions parameter/ParameterMgrPlatformConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@
#include "ParameterMgrPlatformConnector.h"
#include "ParameterMgr.h"
#include "ParameterMgrLogger.h"
#include "Memory.hpp"
#include <assert.h>

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
6 changes: 4 additions & 2 deletions parameter/include/ParameterMgrPlatformConnector.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "ElementHandle.h"
#include "ParameterMgrLoggerForward.h"

#include <memory>

class CParameterMgr;

class PARAMETER_EXPORT CParameterMgrPlatformConnector
Expand Down Expand Up @@ -196,9 +198,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 2e4e3ba

Please sign in to comment.