From 37c97e345d12f95dde44e1d1a4c2f2aadd4615bc Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 25 Aug 2022 14:54:53 -0500 Subject: add initial structure --- .../include/portaudiocpp/SystemDeviceIterator.hxx | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx (limited to 'portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx') diff --git a/portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx b/portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx new file mode 100644 index 0000000..ffa195d --- /dev/null +++ b/portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx @@ -0,0 +1,66 @@ +#ifndef INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX +#define INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX + +// --------------------------------------------------------------------------------------- + +#include +#include + +#include "portaudiocpp/System.hxx" + +// --------------------------------------------------------------------------------------- + +// Forward declaration(s): +namespace portaudio +{ + class Device; + class HostApi; +} + +// --------------------------------------------------------------------------------------- + +// Declaration(s): +namespace portaudio +{ + + + ////// + /// @brief Iterator class for iterating through all Devices in a System. + /// + /// Devices will be iterated by iterating all Devices in each + /// HostApi in the System. Compliant with the STL bidirectional + /// iterator concept. + ////// + class System::DeviceIterator + { + public: + typedef std::bidirectional_iterator_tag iterator_category; + typedef Device value_type; + typedef ptrdiff_t difference_type; + typedef Device * pointer; + typedef Device & reference; + + Device &operator*() const; + Device *operator->() const; + + DeviceIterator &operator++(); + DeviceIterator operator++(int); + DeviceIterator &operator--(); + DeviceIterator operator--(int); + + bool operator==(const DeviceIterator &rhs) const; + bool operator!=(const DeviceIterator &rhs) const; + + private: + friend class System; + friend class HostApi; + Device **ptr_; + }; + + +} // namespace portaudio + +// --------------------------------------------------------------------------------------- + +#endif // INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX + -- cgit v1.2.1