Yoba Perl
hash_iterator.hpp
1 #ifndef YOBAPERL_HASH_ITERATOR_HPP
2 #define YOBAPERL_HASH_ITERATOR_HPP
3 
4 #include "yobaperl/common.hpp"
5 #include "yobaperl/hash_entry.hpp"
6 
7 namespace yoba {
8 
9 
26 class YOBAPERL_EXPORT HashIterator
27 {
28  friend class Hash;
29 
30 public:
31 
32 
33 
38  HashIterator(HashIterator && to_move);
39 
40 
41 
43 
44  HashEntry operator* () const;
45  HashIterator & operator++ ();
46  HashIterator operator++ (int);
47  HashIterator & operator+= (SSize_t diff);
48  bool operator== (const HashIterator & other) const;
49  bool operator!= (const HashIterator & other) const;
50  operator bool() const;
51 
53 
54 
55 
56 protected:
57  HE * _getHE() const;
58 
59 private:
60  HashIterator(const Hash & hash, bool is_null = false);
61  HashIterator(const HashIterator & to_copy);
62 
63  const Hash & _hash;
64  HE * _hash_entry = nullptr;
65 };
66 
67 
68 
69 }
70 
71 #endif // YOBAPERL_HASH_ITERATOR_HPP
Key-value pair.
Definition: hash_entry.hpp:17
Definition: array.cpp:5
Hash reference
Definition: hash.hpp:22
Hash iterator.