From 83056ee196b681966b04aa04bff922d4531566ad Mon Sep 17 00:00:00 2001 From: rbencina Date: Tue, 20 Jan 2015 05:10:17 +0000 Subject: [PATCH] cpp binding: make operator == and != const. thanks to Riot for this patch. ticket #230 --- bindings/cpp/include/portaudiocpp/Device.hxx | 4 ++-- bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx | 4 ++-- bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx | 4 ++-- bindings/cpp/source/portaudiocpp/Device.cxx | 4 ++-- bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx | 4 ++-- bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bindings/cpp/include/portaudiocpp/Device.hxx b/bindings/cpp/include/portaudiocpp/Device.hxx index ffde7aa..cc248af 100644 --- a/bindings/cpp/include/portaudiocpp/Device.hxx +++ b/bindings/cpp/include/portaudiocpp/Device.hxx @@ -60,8 +60,8 @@ namespace portaudio bool isHostApiDefaultInputDevice() const; // extended bool isHostApiDefaultOutputDevice() const; // extended - bool operator==(const Device &rhs); - bool operator!=(const Device &rhs); + bool operator==(const Device &rhs) const; + bool operator!=(const Device &rhs) const; // host api reference HostApi &hostApi(); diff --git a/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx b/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx index 613fc3d..b395ede 100644 --- a/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx +++ b/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx @@ -48,8 +48,8 @@ namespace portaudio DeviceIterator &operator--(); DeviceIterator operator--(int); - bool operator==(const DeviceIterator &rhs); - bool operator!=(const DeviceIterator &rhs); + bool operator==(const DeviceIterator &rhs) const; + bool operator!=(const DeviceIterator &rhs) const; private: friend class System; diff --git a/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx b/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx index b9b13b8..431f87b 100644 --- a/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx +++ b/bindings/cpp/include/portaudiocpp/SystemHostApiIterator.hxx @@ -45,8 +45,8 @@ namespace portaudio HostApiIterator &operator--(); HostApiIterator operator--(int); - bool operator==(const HostApiIterator &rhs); - bool operator!=(const HostApiIterator &rhs); + bool operator==(const HostApiIterator &rhs) const; + bool operator!=(const HostApiIterator &rhs) const; private: friend class System; diff --git a/bindings/cpp/source/portaudiocpp/Device.cxx b/bindings/cpp/source/portaudiocpp/Device.cxx index cd7eb7c..1655bd4 100644 --- a/bindings/cpp/source/portaudiocpp/Device.cxx +++ b/bindings/cpp/source/portaudiocpp/Device.cxx @@ -131,12 +131,12 @@ namespace portaudio // ------------------------------------------------------------------------------- - bool Device::operator==(const Device &rhs) + bool Device::operator==(const Device &rhs) const { return (index_ == rhs.index_); } - bool Device::operator!=(const Device &rhs) + bool Device::operator!=(const Device &rhs) const { return !(*this == rhs); } diff --git a/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx b/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx index c3c00f7..9311384 100644 --- a/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx +++ b/bindings/cpp/source/portaudiocpp/SystemDeviceIterator.cxx @@ -44,12 +44,12 @@ namespace portaudio // ----------------------------------------------------------------------------------- - bool System::DeviceIterator::operator==(const System::DeviceIterator &rhs) + bool System::DeviceIterator::operator==(const System::DeviceIterator &rhs) const { return (ptr_ == rhs.ptr_); } - bool System::DeviceIterator::operator!=(const System::DeviceIterator &rhs) + bool System::DeviceIterator::operator!=(const System::DeviceIterator &rhs) const { return !(*this == rhs); } diff --git a/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx b/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx index f34ca40..c41b4cb 100644 --- a/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx +++ b/bindings/cpp/source/portaudiocpp/SystemHostApiIterator.cxx @@ -44,12 +44,12 @@ namespace portaudio // ----------------------------------------------------------------------------------- - bool System::HostApiIterator::operator==(const System::HostApiIterator &rhs) + bool System::HostApiIterator::operator==(const System::HostApiIterator &rhs) const { return (ptr_ == rhs.ptr_); } - bool System::HostApiIterator::operator!=(const System::HostApiIterator &rhs) + bool System::HostApiIterator::operator!=(const System::HostApiIterator &rhs) const { return !(*this == rhs); } -- 2.43.0