mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-02-19 19:42:48 +01:00
WiimoteDevice
: Make equality actually constant
This commit is contained in:
parent
e66984bd41
commit
b21c8dedd7
@ -9,7 +9,7 @@ public:
|
|||||||
virtual bool write_data(const std::vector<uint8>& data) = 0;
|
virtual bool write_data(const std::vector<uint8>& data) = 0;
|
||||||
virtual std::optional<std::vector<uint8_t>> read_data() = 0;
|
virtual std::optional<std::vector<uint8_t>> read_data() = 0;
|
||||||
|
|
||||||
virtual bool operator==(WiimoteDevice& o) const = 0;
|
virtual bool operator==(const WiimoteDevice& o) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
using WiimoteDevicePtr = std::shared_ptr<WiimoteDevice>;
|
using WiimoteDevicePtr = std::shared_ptr<WiimoteDevice>;
|
||||||
|
@ -47,8 +47,8 @@ std::vector<WiimoteDevicePtr> HidapiWiimote::get_devices() {
|
|||||||
return wiimote_devices;
|
return wiimote_devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HidapiWiimote::operator==(WiimoteDevice& rhs) const {
|
bool HidapiWiimote::operator==(const WiimoteDevice& rhs) const {
|
||||||
auto other = dynamic_cast<HidapiWiimote*>(&rhs);
|
auto other = dynamic_cast<const HidapiWiimote*>(&rhs);
|
||||||
if (!other)
|
if (!other)
|
||||||
return false;
|
return false;
|
||||||
return m_path == other->m_path;
|
return m_path == other->m_path;
|
||||||
|
@ -10,7 +10,7 @@ public:
|
|||||||
|
|
||||||
bool write_data(const std::vector<uint8> &data) override;
|
bool write_data(const std::vector<uint8> &data) override;
|
||||||
std::optional<std::vector<uint8>> read_data() override;
|
std::optional<std::vector<uint8>> read_data() override;
|
||||||
bool operator==(WiimoteDevice& o) const override;
|
bool operator==(const WiimoteDevice& o) const override;
|
||||||
|
|
||||||
static std::vector<WiimoteDevicePtr> get_devices();
|
static std::vector<WiimoteDevicePtr> get_devices();
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ std::optional<std::vector<uint8>> L2CapWiimote::read_data()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool L2CapWiimote::operator==(WiimoteDevice& rhs) const
|
bool L2CapWiimote::operator==(const WiimoteDevice& rhs) const
|
||||||
{
|
{
|
||||||
auto mote = dynamic_cast<const L2CapWiimote*>(&rhs);
|
auto mote = dynamic_cast<const L2CapWiimote*>(&rhs);
|
||||||
if (!mote)
|
if (!mote)
|
||||||
|
@ -10,7 +10,7 @@ class L2CapWiimote : public WiimoteDevice
|
|||||||
|
|
||||||
bool write_data(const std::vector<uint8>& data) override;
|
bool write_data(const std::vector<uint8>& data) override;
|
||||||
std::optional<std::vector<uint8>> read_data() override;
|
std::optional<std::vector<uint8>> read_data() override;
|
||||||
bool operator==(WiimoteDevice& o) const override;
|
bool operator==(const WiimoteDevice& o) const override;
|
||||||
|
|
||||||
static void AddCandidateAddress(bdaddr_t addr);
|
static void AddCandidateAddress(bdaddr_t addr);
|
||||||
static std::vector<WiimoteDevicePtr> get_devices();
|
static std::vector<WiimoteDevicePtr> get_devices();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user