Commit b80bfeef authored by jacobgladish's avatar jacobgladish

Renamed shared_ptr std::shared_ptr. closes #12

parent 505133a1
...@@ -75,7 +75,7 @@ bridge::AdapterSignalVector adapters::mock::MockAdapter::GetSignals() ...@@ -75,7 +75,7 @@ bridge::AdapterSignalVector adapters::mock::MockAdapter::GetSignals()
int32_t int32_t
adapters::mock::MockAdapter::Initialize(shared_ptr<bridge::IAdapterLog> const& log) adapters::mock::MockAdapter::Initialize(std::shared_ptr<bridge::IAdapterLog> const& log)
{ {
CreateMockDevices(); CreateMockDevices();
CreateSignals(); CreateSignals();
...@@ -105,7 +105,7 @@ int32_t ...@@ -105,7 +105,7 @@ int32_t
adapters::mock::MockAdapter::EnumDevices( adapters::mock::MockAdapter::EnumDevices(
bridge::EnumDeviceOptions /*opts*/, bridge::EnumDeviceOptions /*opts*/,
bridge::AdapterDeviceVector& deviceList, bridge::AdapterDeviceVector& deviceList,
shared_ptr<bridge::IAdapterIoRequest>* req) std::shared_ptr<bridge::IAdapterIoRequest>* req)
{ {
if (req) if (req)
req->reset(); req->reset();
...@@ -120,21 +120,21 @@ adapters::mock::MockAdapter::EnumDevices( ...@@ -120,21 +120,21 @@ adapters::mock::MockAdapter::EnumDevices(
int32_t int32_t
adapters::mock::MockAdapter::GetProperty( adapters::mock::MockAdapter::GetProperty(
shared_ptr<bridge::IAdapterProperty>& prop, std::shared_ptr<bridge::IAdapterProperty>& prop,
shared_ptr<bridge::IAdapterIoRequest>* req) std::shared_ptr<bridge::IAdapterIoRequest>* req)
{ {
if (req) if (req)
req->reset(); req->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop); std::shared_ptr<MockAdapterProperty> mockAdapterProperty = std::dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty) if (!mockAdapterProperty)
return ER_BAD_ARG_1; return ER_BAD_ARG_1;
shared_ptr<MockAdapterDevice> device = mockAdapterProperty->GetParent(); std::shared_ptr<MockAdapterDevice> device = mockAdapterProperty->GetParent();
if (!device) if (!device)
return ER_INVALID_ADDRESS; return ER_INVALID_ADDRESS;
shared_ptr<MockAdapter> adapter = device->GetParent(); std::shared_ptr<MockAdapter> adapter = device->GetParent();
if (!adapter) if (!adapter)
return ER_INVALID_ADDRESS; return ER_INVALID_ADDRESS;
...@@ -146,21 +146,21 @@ adapters::mock::MockAdapter::GetProperty( ...@@ -146,21 +146,21 @@ adapters::mock::MockAdapter::GetProperty(
int32_t int32_t
adapters::mock::MockAdapter::SetProperty( adapters::mock::MockAdapter::SetProperty(
shared_ptr<bridge::IAdapterProperty> const& prop, std::shared_ptr<bridge::IAdapterProperty> const& prop,
shared_ptr<bridge::IAdapterIoRequest>* req) std::shared_ptr<bridge::IAdapterIoRequest>* req)
{ {
if (req) if (req)
req ->reset(); req ->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop); std::shared_ptr<MockAdapterProperty> mockAdapterProperty = std::dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty) if (!mockAdapterProperty)
return ER_BAD_ARG_1; return ER_BAD_ARG_1;
shared_ptr<MockAdapterDevice> device = mockAdapterProperty->GetParent(); std::shared_ptr<MockAdapterDevice> device = mockAdapterProperty->GetParent();
if (!device) if (!device)
return ER_INVALID_ADDRESS; return ER_INVALID_ADDRESS;
shared_ptr<MockAdapter> adapter = device->GetParent(); std::shared_ptr<MockAdapter> adapter = device->GetParent();
if (!adapter) if (!adapter)
return ER_INVALID_ADDRESS; return ER_INVALID_ADDRESS;
...@@ -172,23 +172,23 @@ adapters::mock::MockAdapter::SetProperty( ...@@ -172,23 +172,23 @@ adapters::mock::MockAdapter::SetProperty(
int32_t int32_t
adapters::mock::MockAdapter::GetPropertyValue( adapters::mock::MockAdapter::GetPropertyValue(
shared_ptr<bridge::IAdapterProperty> const& prop, std::shared_ptr<bridge::IAdapterProperty> const& prop,
std::string const& attributeName, std::string const& attributeName,
shared_ptr<bridge::IAdapterValue>& value, std::shared_ptr<bridge::IAdapterValue>& value,
shared_ptr<bridge::IAdapterIoRequest>* req) std::shared_ptr<bridge::IAdapterIoRequest>* req)
{ {
if (req) if (req)
req->reset(); req->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop); std::shared_ptr<MockAdapterProperty> mockAdapterProperty = std::dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty) if (!mockAdapterProperty)
return ER_BAD_ARG_1; return ER_BAD_ARG_1;
shared_ptr<MockAdapterValue> attr = mockAdapterProperty->GetAttributeByName(attributeName); std::shared_ptr<MockAdapterValue> attr = mockAdapterProperty->GetAttributeByName(attributeName);
if (!attr) if (!attr)
return ER_INVALID_ADDRESS; return ER_INVALID_ADDRESS;
value = dynamic_pointer_cast<bridge::IAdapterValue>(attr); value = std::dynamic_pointer_cast<bridge::IAdapterValue>(attr);
return ER_OK; return ER_OK;
} }
...@@ -196,18 +196,18 @@ adapters::mock::MockAdapter::GetPropertyValue( ...@@ -196,18 +196,18 @@ adapters::mock::MockAdapter::GetPropertyValue(
int32_t int32_t
adapters::mock::MockAdapter::SetPropertyValue( adapters::mock::MockAdapter::SetPropertyValue(
shared_ptr<bridge::IAdapterProperty> const& prop, std::shared_ptr<bridge::IAdapterProperty> const& prop,
shared_ptr<bridge::IAdapterValue> const& value, std::shared_ptr<bridge::IAdapterValue> const& value,
shared_ptr<bridge::IAdapterIoRequest>* req) std::shared_ptr<bridge::IAdapterIoRequest>* req)
{ {
if (req) if (req)
req->reset(); req->reset();
shared_ptr<MockAdapterProperty> mockAdapterProperty = dynamic_pointer_cast<MockAdapterProperty>(prop); std::shared_ptr<MockAdapterProperty> mockAdapterProperty = std::dynamic_pointer_cast<MockAdapterProperty>(prop);
if (!mockAdapterProperty) if (!mockAdapterProperty)
return ER_BAD_ARG_1; return ER_BAD_ARG_1;
shared_ptr<MockAdapterValue> attr = mockAdapterProperty->GetAttributeByName(value->GetName()); std::shared_ptr<MockAdapterValue> attr = mockAdapterProperty->GetAttributeByName(value->GetName());
if (!attr) if (!attr)
return ER_INVALID_ADDRESS; return ER_INVALID_ADDRESS;
...@@ -219,14 +219,14 @@ adapters::mock::MockAdapter::SetPropertyValue( ...@@ -219,14 +219,14 @@ adapters::mock::MockAdapter::SetPropertyValue(
int32_t int32_t
adapters::mock::MockAdapter::CallMethod( adapters::mock::MockAdapter::CallMethod(
shared_ptr<bridge::IAdapterMethod>& method, std::shared_ptr<bridge::IAdapterMethod>& method,
shared_ptr<bridge::IAdapterIoRequest>* req) std::shared_ptr<bridge::IAdapterIoRequest>* req)
{ {
shared_ptr<MockAdapterMethod> m = dynamic_pointer_cast<MockAdapterMethod>(method); std::shared_ptr<MockAdapterMethod> m = std::dynamic_pointer_cast<MockAdapterMethod>(method);
if (!m) if (!m)
return ER_BAD_ARG_1; return ER_BAD_ARG_1;
shared_ptr<MockAdapterDevice> device = m->GetParent(); std::shared_ptr<MockAdapterDevice> device = m->GetParent();
if (!device) if (!device)
return ER_INVALID_ADDRESS; return ER_INVALID_ADDRESS;
...@@ -237,7 +237,7 @@ adapters::mock::MockAdapter::CallMethod( ...@@ -237,7 +237,7 @@ adapters::mock::MockAdapter::CallMethod(
int32_t int32_t
adapters::mock::MockAdapter::RegisterSignalListener( adapters::mock::MockAdapter::RegisterSignalListener(
std::string const& signalName, std::string const& signalName,
shared_ptr<bridge::IAdapterSignalListener> const& listener, std::shared_ptr<bridge::IAdapterSignalListener> const& listener,
void* argp, void* argp,
bridge::IAdapter::RegistrationHandle& handle) bridge::IAdapter::RegistrationHandle& handle)
{ {
...@@ -270,7 +270,7 @@ adapters::mock::MockAdapter::UnregisterSignalListener(bridge::IAdapter::Registra ...@@ -270,7 +270,7 @@ adapters::mock::MockAdapter::UnregisterSignalListener(bridge::IAdapter::Registra
void void
adapters::mock::MockAdapter::CreateMockDevices() adapters::mock::MockAdapter::CreateMockDevices()
{ {
shared_ptr<MockAdapter> self = dynamic_pointer_cast<MockAdapter>(shared_from_this()); std::shared_ptr<MockAdapter> self = std::dynamic_pointer_cast<MockAdapter>(shared_from_this());
typedef std::vector<adapters::mock::MockDeviceDescriptor> vector; typedef std::vector<adapters::mock::MockDeviceDescriptor> vector;
...@@ -278,7 +278,7 @@ adapters::mock::MockAdapter::CreateMockDevices() ...@@ -278,7 +278,7 @@ adapters::mock::MockAdapter::CreateMockDevices()
for (vector::const_iterator begin = devices.begin(), end = devices.end(); for (vector::const_iterator begin = devices.begin(), end = devices.end();
begin != end; ++begin) begin != end; ++begin)
{ {
shared_ptr<MockAdapterDevice> dev = MockAdapterDevice::Create(*begin, self); std::shared_ptr<MockAdapterDevice> dev = MockAdapterDevice::Create(*begin, self);
m_devices.push_back(dev); m_devices.push_back(dev);
} }
} }
...@@ -286,18 +286,18 @@ adapters::mock::MockAdapter::CreateMockDevices() ...@@ -286,18 +286,18 @@ adapters::mock::MockAdapter::CreateMockDevices()
void void
adapters::mock::MockAdapter::CreateSignals() adapters::mock::MockAdapter::CreateSignals()
{ {
shared_ptr<MockAdapterDevice> parent; std::shared_ptr<MockAdapterDevice> parent;
bridge::AdapterValueVector values; bridge::AdapterValueVector values;
shared_ptr<MockAdapterValue> val(new MockAdapterValue(bridge::kDeviceArravalHandle)); std::shared_ptr<MockAdapterValue> val(new MockAdapterValue(bridge::kDeviceArravalHandle));
shared_ptr<MockAdapterSignal> signal(new MockAdapterSignal(bridge::kDeviceArrivalSignal, std::shared_ptr<MockAdapterSignal> signal(new MockAdapterSignal(bridge::kDeviceArrivalSignal,
parent, values)); parent, values));
m_signals.push_back(signal); m_signals.push_back(signal);
} }
int32_t int32_t
adapters::mock::MockAdapter::NotifySignalListeners(shared_ptr<MockAdapterSignal> const& signal) adapters::mock::MockAdapter::NotifySignalListeners(std::shared_ptr<MockAdapterSignal> const& signal)
{ {
int32_t st = ER_FAIL; int32_t st = ER_FAIL;
if (!signal) if (!signal)
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "Common/defines.h" #include "Common/defines.h"
#include <map> #include <map>
#include <memory>
namespace adapters namespace adapters
{ {
...@@ -12,7 +13,7 @@ namespace mock ...@@ -12,7 +13,7 @@ namespace mock
class MockAdapterDevice; class MockAdapterDevice;
class MockAdapterSignal; class MockAdapterSignal;
class MockAdapter : public bridge::IAdapter, public enable_shared_from_this<bridge::IAdapter> class MockAdapter : public bridge::IAdapter, public std::enable_shared_from_this<bridge::IAdapter>
{ {
public: public:
MockAdapter(); MockAdapter();
...@@ -26,7 +27,7 @@ namespace mock ...@@ -26,7 +27,7 @@ namespace mock
virtual common::Guid GetExposedApplicationGuid(); virtual common::Guid GetExposedApplicationGuid();
virtual bridge::AdapterSignalVector GetSignals(); virtual bridge::AdapterSignalVector GetSignals();
virtual int32_t Initialize(shared_ptr<bridge::IAdapterLog> const& log); virtual int32_t Initialize(std::shared_ptr<bridge::IAdapterLog> const& log);
virtual int32_t Shutdown(); virtual int32_t Shutdown();
virtual int32_t GetConfiguration(std::vector<uint8_t>* /*configData*/) virtual int32_t GetConfiguration(std::vector<uint8_t>* /*configData*/)
...@@ -38,40 +39,40 @@ namespace mock ...@@ -38,40 +39,40 @@ namespace mock
virtual int32_t EnumDevices( virtual int32_t EnumDevices(
bridge::EnumDeviceOptions opts, bridge::EnumDeviceOptions opts,
bridge::AdapterDeviceVector& deviceList, bridge::AdapterDeviceVector& deviceList,
shared_ptr<bridge::IAdapterIoRequest>* req); std::shared_ptr<bridge::IAdapterIoRequest>* req);
virtual int32_t GetProperty( virtual int32_t GetProperty(
shared_ptr<bridge::IAdapterProperty>& prop, std::shared_ptr<bridge::IAdapterProperty>& prop,
shared_ptr<bridge::IAdapterIoRequest>* req); std::shared_ptr<bridge::IAdapterIoRequest>* req);
virtual int32_t SetProperty( virtual int32_t SetProperty(
shared_ptr<bridge::IAdapterProperty> const& prop, std::shared_ptr<bridge::IAdapterProperty> const& prop,
shared_ptr<bridge::IAdapterIoRequest>* req); std::shared_ptr<bridge::IAdapterIoRequest>* req);
virtual int32_t GetPropertyValue( virtual int32_t GetPropertyValue(
shared_ptr<bridge::IAdapterProperty> const& prop, std::shared_ptr<bridge::IAdapterProperty> const& prop,
std::string const& attributeName, std::string const& attributeName,
shared_ptr<bridge::IAdapterValue>& value, std::shared_ptr<bridge::IAdapterValue>& value,
shared_ptr<bridge::IAdapterIoRequest>* req); std::shared_ptr<bridge::IAdapterIoRequest>* req);
virtual int32_t SetPropertyValue( virtual int32_t SetPropertyValue(
shared_ptr<bridge::IAdapterProperty> const& prop, std::shared_ptr<bridge::IAdapterProperty> const& prop,
shared_ptr<bridge::IAdapterValue> const& value, std::shared_ptr<bridge::IAdapterValue> const& value,
shared_ptr<bridge::IAdapterIoRequest>* req); std::shared_ptr<bridge::IAdapterIoRequest>* req);
virtual int32_t CallMethod( virtual int32_t CallMethod(
shared_ptr<bridge::IAdapterMethod>& method, std::shared_ptr<bridge::IAdapterMethod>& method,
shared_ptr<bridge::IAdapterIoRequest>* req); std::shared_ptr<bridge::IAdapterIoRequest>* req);
virtual int32_t RegisterSignalListener( virtual int32_t RegisterSignalListener(
std::string const& signalName, std::string const& signalName,
shared_ptr<bridge::IAdapterSignalListener> const& listener, std::shared_ptr<bridge::IAdapterSignalListener> const& listener,
void* argp, void* argp,
bridge::IAdapter::RegistrationHandle& handle); bridge::IAdapter::RegistrationHandle& handle);
virtual int32_t UnregisterSignalListener(bridge::IAdapter::RegistrationHandle const& h); virtual int32_t UnregisterSignalListener(bridge::IAdapter::RegistrationHandle const& h);
int32_t NotifySignalListeners(shared_ptr<MockAdapterSignal> const& signal); int32_t NotifySignalListeners(std::shared_ptr<MockAdapterSignal> const& signal);
private: private:
void CreateMockDevices(); void CreateMockDevices();
...@@ -84,14 +85,14 @@ namespace mock ...@@ -84,14 +85,14 @@ namespace mock
std::string m_exposedAdapterPrefix; std::string m_exposedAdapterPrefix;
std::string m_exposedApplicationName; std::string m_exposedApplicationName;
common::Guid m_exposedApplicationGuid; common::Guid m_exposedApplicationGuid;
shared_ptr<bridge::IAdapterLog> m_log; std::shared_ptr<bridge::IAdapterLog> m_log;
std::vector< shared_ptr<MockAdapterDevice> > m_devices; std::vector< std::shared_ptr<MockAdapterDevice> > m_devices;
std::vector< shared_ptr<MockAdapterSignal> > m_signals; std::vector< std::shared_ptr<MockAdapterSignal> > m_signals;
struct RegisteredSignal struct RegisteredSignal
{ {
shared_ptr<bridge::IAdapterSignalListener> Listener; std::shared_ptr<bridge::IAdapterSignalListener> Listener;
void* Context; void* Context;
bridge::IAdapter::RegistrationHandle RegHandle; bridge::IAdapter::RegistrationHandle RegHandle;
}; };
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
using namespace adapters::mock; using namespace adapters::mock;
shared_ptr<MockAdapterDevice> MockAdapterDevice::Create( std::shared_ptr<MockAdapterDevice> MockAdapterDevice::Create(
MockDeviceDescriptor const& desc, MockDeviceDescriptor const& desc,
weak_ptr<MockAdapter> const& parent) std::weak_ptr<MockAdapter> const& parent)
{ {
shared_ptr<MockAdapterDevice> device(new MockAdapterDevice(desc, parent)); std::shared_ptr<MockAdapterDevice> device(new MockAdapterDevice(desc, parent));
for (int i = 0; i < kMockDeviceMaxProperties; ++i) for (int i = 0; i < kMockDeviceMaxProperties; ++i)
{ {
...@@ -15,7 +15,7 @@ shared_ptr<MockAdapterDevice> MockAdapterDevice::Create( ...@@ -15,7 +15,7 @@ shared_ptr<MockAdapterDevice> MockAdapterDevice::Create(
if (descriptor.Id == kLastDescriptorId) if (descriptor.Id == kLastDescriptorId)
break; break;
device->m_properties.push_back(shared_ptr<bridge::IAdapterProperty>( device->m_properties.push_back(std::shared_ptr<bridge::IAdapterProperty>(
new MockAdapterProperty(descriptor, device))); new MockAdapterProperty(descriptor, device)));
} }
...@@ -25,7 +25,7 @@ shared_ptr<MockAdapterDevice> MockAdapterDevice::Create( ...@@ -25,7 +25,7 @@ shared_ptr<MockAdapterDevice> MockAdapterDevice::Create(
return device; return device;
} }
MockAdapterDevice::MockAdapterDevice(MockDeviceDescriptor const& desc, weak_ptr<MockAdapter> const& parent) MockAdapterDevice::MockAdapterDevice(MockDeviceDescriptor const& desc, std::weak_ptr<MockAdapter> const& parent)
: m_name(desc.Name) : m_name(desc.Name)
, m_parent(parent) , m_parent(parent)
, m_vendor(desc.VendorName) , m_vendor(desc.VendorName)
...@@ -41,7 +41,7 @@ MockAdapterDevice::MockAdapterDevice(MockDeviceDescriptor const& desc, weak_ptr< ...@@ -41,7 +41,7 @@ MockAdapterDevice::MockAdapterDevice(MockDeviceDescriptor const& desc, weak_ptr<
void MockAdapterDevice::CreateSignals() void MockAdapterDevice::CreateSignals()
{ {
bridge::AdapterValueVector params; bridge::AdapterValueVector params;
m_signalPrototypes.push_back(shared_ptr<MockAdapterSignal>(new MockAdapterSignal( m_signalPrototypes.push_back(std::shared_ptr<MockAdapterSignal>(new MockAdapterSignal(
bridge::kChangeOfValueSignal, shared_from_this(), params))); bridge::kChangeOfValueSignal, shared_from_this(), params)));
// TODO: This is incomplete, re-visit once signal emit is worked on // TODO: This is incomplete, re-visit once signal emit is worked on
...@@ -49,16 +49,16 @@ void MockAdapterDevice::CreateSignals() ...@@ -49,16 +49,16 @@ void MockAdapterDevice::CreateSignals()
void MockAdapterDevice::CreateMethods() void MockAdapterDevice::CreateMethods()
{ {
shared_ptr<MockAdapterDevice> self = shared_from_this(); std::shared_ptr<MockAdapterDevice> self = shared_from_this();
shared_ptr<MockAdapterMethod> m(new MockAdapterMethod(kDeviceResetMethod, self)); std::shared_ptr<MockAdapterMethod> m(new MockAdapterMethod(kDeviceResetMethod, self));
m->AddInputParam(shared_ptr<bridge::IAdapterValue>(new MockAdapterValue(kDeviceResetPropertyHandle))); m->AddInputParam(std::shared_ptr<bridge::IAdapterValue>(new MockAdapterValue(kDeviceResetPropertyHandle)));
m_methods.push_back(m); m_methods.push_back(m);
} }
int32_t MockAdapterDevice::DispatchMethod( int32_t MockAdapterDevice::DispatchMethod(
shared_ptr<MockAdapterMethod>& method, std::shared_ptr<MockAdapterMethod>& method,
shared_ptr<bridge::IAdapterIoRequest>* req) std::shared_ptr<bridge::IAdapterIoRequest>* req)
{ {
if (req) if (req)
req->reset(); req->reset();
...@@ -72,8 +72,8 @@ int32_t MockAdapterDevice::DispatchMethod( ...@@ -72,8 +72,8 @@ int32_t MockAdapterDevice::DispatchMethod(
int32_t MockAdapterDevice::SendSignal( int32_t MockAdapterDevice::SendSignal(
std::string const& signalName, std::string const& signalName,
shared_ptr<MockAdapterProperty> const& prop, std::shared_ptr<MockAdapterProperty> const& prop,
shared_ptr<MockAdapterValue> const& value) std::shared_ptr<MockAdapterValue> const& value)
{ {
if (!prop) if (!prop)
return ER_BAD_ARG_2; return ER_BAD_ARG_2;
...@@ -82,8 +82,8 @@ int32_t MockAdapterDevice::SendSignal( ...@@ -82,8 +82,8 @@ int32_t MockAdapterDevice::SendSignal(
int32_t st = ER_FAIL; int32_t st = ER_FAIL;
shared_ptr<MockAdapterSignal> signal; std::shared_ptr<MockAdapterSignal> signal;
shared_ptr<MockAdapter> parent = m_parent.lock(); std::shared_ptr<MockAdapter> parent = m_parent.lock();
if (!parent) if (!parent)
return ER_FAIL; return ER_FAIL;
...@@ -93,7 +93,7 @@ int32_t MockAdapterDevice::SendSignal( ...@@ -93,7 +93,7 @@ int32_t MockAdapterDevice::SendSignal(
{ {
if ((*begin)->GetName() == signalName) if ((*begin)->GetName() == signalName)
{ {
signal = dynamic_pointer_cast<MockAdapterSignal>(*begin); signal = std::dynamic_pointer_cast<MockAdapterSignal>(*begin);
DSB_ASSERT(signal != NULL); DSB_ASSERT(signal != NULL);
if (signal) if (signal)
signal = signal->Clone(); signal = signal->Clone();
...@@ -107,12 +107,12 @@ int32_t MockAdapterDevice::SendSignal( ...@@ -107,12 +107,12 @@ int32_t MockAdapterDevice::SendSignal(
{ {
bridge::AdapterValueVector params; bridge::AdapterValueVector params;
shared_ptr<MockAdapterDevice> self = shared_from_this(); std::shared_ptr<MockAdapterDevice> self = shared_from_this();
shared_ptr<MockAdapterValue> p(new MockAdapterValue("PropertyName")); std::shared_ptr<MockAdapterValue> p(new MockAdapterValue("PropertyName"));
p->SetData(common::Variant(prop->GetName())); p->SetData(common::Variant(prop->GetName()));
shared_ptr<MockAdapterValue> v(new MockAdapterValue("PropertyValue")); std::shared_ptr<MockAdapterValue> v(new MockAdapterValue("PropertyValue"));
v->SetData(value->GetData()); v->SetData(value->GetData());
params.push_back(p); params.push_back(p);
...@@ -125,7 +125,7 @@ int32_t MockAdapterDevice::SendSignal( ...@@ -125,7 +125,7 @@ int32_t MockAdapterDevice::SendSignal(
return st; return st;
} }
int32_t MockAdapterDevice::Reset(shared_ptr<MockAdapterMethod>& method) int32_t MockAdapterDevice::Reset(std::shared_ptr<MockAdapterMethod>& method)
{ {
int32_t st = ER_OK; int32_t st = ER_OK;
...@@ -137,7 +137,7 @@ int32_t MockAdapterDevice::Reset(shared_ptr<MockAdapterMethod>& method) ...@@ -137,7 +137,7 @@ int32_t MockAdapterDevice::Reset(shared_ptr<MockAdapterMethod>& method)
else if (inParams.size() == 1) else if (inParams.size() == 1)
{ {
// reset property by name // reset property by name
shared_ptr<bridge::IAdapterValue> arg1 = inParams[0]; std::shared_ptr<bridge::IAdapterValue> arg1 = inParams[0];
if (!arg1) if (!arg1)
return ER_BAD_ARG_1; return ER_BAD_ARG_1;
} }
...@@ -182,7 +182,7 @@ std::string MockAdapterDevice::GetDescription() ...@@ -182,7 +182,7 @@ std::string MockAdapterDevice::GetDescription()
return m_description; return m_description;
} }
shared_ptr<bridge::IAdapterIcon> MockAdapterDevice::GetIcon() std::shared_ptr<bridge::IAdapterIcon> MockAdapterDevice::GetIcon()
{ {
return m_icon; return m_icon;
} }
...@@ -203,7 +203,7 @@ bridge::AdapterSignalVector const& MockAdapterDevice::GetSignals() const ...@@ -203,7 +203,7 @@ bridge::AdapterSignalVector const& MockAdapterDevice::GetSignals() const
} }