Change-Id: Id9fae6f0fe89e90d3a78827a12eac0810c3ada4b
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1250
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
public:
PresenceSubscriber();
- PresenceSubscriber(PresenceSubscriber&&) = default;
+ PresenceSubscriber(PresenceSubscriber&&);
/**
* @throw PlatformException
~PresenceSubscriber();
- PresenceSubscriber& operator=(PresenceSubscriber&&) = default;
+ PresenceSubscriber& operator=(PresenceSubscriber&&);
/**
* @throw PlatformException
{
}
+PresenceSubscriber::PresenceSubscriber(PresenceSubscriber&& from) :
+ m_handle{ nullptr }
+{
+ std::swap(m_handle, from.m_handle);
+}
+
PresenceSubscriber::PresenceSubscriber(const std::string& host,
OCConnectivityType connectivityType, SubscribeCallback presenceHandler) :
m_handle{ nullptr }
}
}
+PresenceSubscriber& PresenceSubscriber::operator=(PresenceSubscriber&& from)
+{
+ unsubscribe();
+ std::swap(m_handle, from.m_handle);
+ return *this;
+}
+
void PresenceSubscriber::unsubscribe()
{
if (m_handle == nullptr) return;