SystemDeviceIterator.hxx (1611B)
1 #ifndef INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX 2 #define INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX 3 4 // --------------------------------------------------------------------------------------- 5 6 #include <iterator> 7 #include <cstddef> 8 9 #include "portaudiocpp/System.hxx" 10 11 // --------------------------------------------------------------------------------------- 12 13 // Forward declaration(s): 14 namespace portaudio 15 { 16 class Device; 17 class HostApi; 18 } 19 20 // --------------------------------------------------------------------------------------- 21 22 // Declaration(s): 23 namespace portaudio 24 { 25 26 27 ////// 28 /// @brief Iterator class for iterating through all Devices in a System. 29 /// 30 /// Devices will be iterated by iterating all Devices in each 31 /// HostApi in the System. Compliant with the STL bidirectional 32 /// iterator concept. 33 ////// 34 class System::DeviceIterator 35 { 36 public: 37 typedef std::bidirectional_iterator_tag iterator_category; 38 typedef Device value_type; 39 typedef ptrdiff_t difference_type; 40 typedef Device * pointer; 41 typedef Device & reference; 42 43 Device &operator*() const; 44 Device *operator->() const; 45 46 DeviceIterator &operator++(); 47 DeviceIterator operator++(int); 48 DeviceIterator &operator--(); 49 DeviceIterator operator--(int); 50 51 bool operator==(const DeviceIterator &rhs) const; 52 bool operator!=(const DeviceIterator &rhs) const; 53 54 private: 55 friend class System; 56 friend class HostApi; 57 Device **ptr_; 58 }; 59 60 61 } // namespace portaudio 62 63 // --------------------------------------------------------------------------------------- 64 65 #endif // INCLUDED_PORTAUDIO_SYSTEMDEVICEITERATOR_HXX 66