My Project
portiterator.hpp
1 
20 #ifndef _PORTITERATOR_HPP_
21 #define _PORTITERATOR_HPP_ 1
22 #include <iterator>
23 #include <map>
24 #include <thread>
25 #include <mutex>
26 #include <cstddef>
27 
28 #include "portmap_t.hpp"
29 
30 class FIFO;
31 
32 class PortIterator : public std::iterator< std::forward_iterator_tag, FIFO >
33 {
34 public:
35  PortIterator( portmap_t * const port_map );
36 
37  PortIterator( portmap_t * const port_map, const std::size_t index );
38 
39  PortIterator( const PortIterator &it );
40 
41  virtual ~PortIterator();
42 
43  PortIterator& operator++() ;
44 
45  bool operator==(const PortIterator& rhs) ;
46  bool operator!=(const PortIterator& rhs) ;
47  FIFO& operator*() ;
48 
49 private:
50  static inline
51  void initKeyMap( portmap_t * const port_map,
52  std::vector< std::string > &key_map ) ;
53 
54  portmap_t * const port_map;
55  std::vector< std::string > key_map;
56  std::size_t map_index = 0;
57  bool is_end = false;
58 };
59 
60 #endif /* END _PORTITERATOR_HPP_ */
bool operator==(const PortIterator &rhs)
Definition: portiterator.cpp:66
Definition: portiterator.hpp:32
Definition: portmap_t.hpp:27
PortIterator(portmap_t *const port_map)
Definition: portiterator.cpp:29