summaryrefslogtreecommitdiff
path: root/portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-25 14:54:53 -0500
committersanine <sanine.not@pm.me>2022-08-25 14:54:53 -0500
commit37c97e345d12f95dde44e1d1a4c2f2aadd4615bc (patch)
treee1bb25bc855883062bdd7847ff2c04290f71c840 /portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx
parent5634c7b04da619669f2f29f6798c03982be05180 (diff)
add initial structure
Diffstat (limited to 'portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx')
-rw-r--r--portaudio/bindings/cpp/include/portaudiocpp/SystemDeviceIterator.hxx66
1 files changed, 66 insertions, 0 deletions
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 <iterator>
+#include <cstddef>
+
+#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
+