mirror of https://github.com/AxioDL/boo.git
Merge pull request #19 from lioncash/move
DeviceToken: Amend move constructor
This commit is contained in:
commit
c33604b8cb
|
@ -28,14 +28,7 @@ class DeviceToken {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DeviceToken(const DeviceToken&) = delete;
|
DeviceToken(const DeviceToken&) = delete;
|
||||||
DeviceToken(const DeviceToken&& other)
|
DeviceToken(DeviceToken&& other) noexcept = default;
|
||||||
: m_devType(other.m_devType)
|
|
||||||
, m_vendorId(other.m_vendorId)
|
|
||||||
, m_productId(other.m_productId)
|
|
||||||
, m_vendorName(other.m_vendorName)
|
|
||||||
, m_productName(other.m_productName)
|
|
||||||
, m_devPath(other.m_devPath)
|
|
||||||
, m_connectedDev(other.m_connectedDev) {}
|
|
||||||
DeviceToken(DeviceType devType, unsigned vid, unsigned pid, const char* vname, const char* pname, const char* path)
|
DeviceToken(DeviceType devType, unsigned vid, unsigned pid, const char* vname, const char* pname, const char* path)
|
||||||
: m_devType(devType), m_vendorId(vid), m_productId(pid), m_devPath(path), m_connectedDev(NULL) {
|
: m_devType(devType), m_vendorId(vid), m_productId(pid), m_devPath(path), m_connectedDev(NULL) {
|
||||||
if (vname)
|
if (vname)
|
||||||
|
@ -44,6 +37,12 @@ public:
|
||||||
m_productName = pname;
|
m_productName = pname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeviceToken& operator=(const DeviceToken&) = delete;
|
||||||
|
DeviceToken& operator=(DeviceToken&&) noexcept = default;
|
||||||
|
|
||||||
|
bool operator==(const DeviceToken& rhs) const { return m_devPath == rhs.m_devPath; }
|
||||||
|
bool operator<(const DeviceToken& rhs) const { return m_devPath < rhs.m_devPath; }
|
||||||
|
|
||||||
DeviceType getDeviceType() const { return m_devType; }
|
DeviceType getDeviceType() const { return m_devType; }
|
||||||
unsigned getVendorId() const { return m_vendorId; }
|
unsigned getVendorId() const { return m_vendorId; }
|
||||||
unsigned getProductId() const { return m_productId; }
|
unsigned getProductId() const { return m_productId; }
|
||||||
|
@ -56,9 +55,6 @@ public:
|
||||||
m_connectedDev = DeviceSignature::DeviceNew(*this);
|
m_connectedDev = DeviceSignature::DeviceNew(*this);
|
||||||
return m_connectedDev;
|
return m_connectedDev;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const DeviceToken& rhs) const { return m_devPath == rhs.m_devPath; }
|
|
||||||
bool operator<(const DeviceToken& rhs) const { return m_devPath < rhs.m_devPath; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace boo
|
} // namespace boo
|
||||||
|
|
Loading…
Reference in New Issue