Yoba Perl
hash_entry.hpp
1 #ifndef YOBAPERL_HASH_ENTRY_HPP
2 #define YOBAPERL_HASH_ENTRY_HPP
3 
4 #include "yobaperl/common.hpp"
5 #include "yobaperl/scalar.hpp"
6 
7 namespace yoba {
8 
9 
10 
17 class YOBAPERL_EXPORT HashEntry
18 {
19  friend class Hash;
20  friend class HashIterator;
21 
22 public:
23 
24 
25 
30  HashEntry(const HashEntry & to_copy);
31 
36  HashEntry(HashEntry && to_move);
37 
38 
39 
41 
46  std::string getKey() const;
47 
52  Scalar getValue() const;
53 
58  std::string toString() const;
59 
64  std::pair<std::string, Scalar> toPair() const;
65 
67 
68 
69 
71 
76  HE * getHE() const;
77 
82  U32 getHashCode() const;
83 
85 
86 
87 
89 
90  bool operator== (const HashEntry & other) const;
91  bool operator!= (const HashEntry & other) const;
92  friend std::ostream & operator<< (std::ostream & stream, const HashEntry & entry);
93 
95 
96 
97 
98 private:
99  HashEntry(const Hash & hash, HE * he);
100 
101  const Hash & _hash;
102  HE * _he = nullptr;
103 };
104 
105 
106 
107 } // namespace yoba
108 
109 #endif // YOBAPERL_HASH_ENTRY_HPP
Key-value pair.
Definition: hash_entry.hpp:17
Definition: array.cpp:5
Hash reference
Definition: hash.hpp:22
Hash iterator.
Scalar reference
Definition: scalar.hpp:24