Vita
cache_hash.cc
Go to the documentation of this file.
1
13#include <iostream>
14
15#include "kernel/cache_hash.h"
16
17namespace vita
18{
26bool hash_t::load(std::istream &in)
27{
28 hash_t tmp;
29
30 if (!(in >> tmp.data[0] >> tmp.data[1]))
31 return false;
32
33 *this = tmp;
34
35 return true;
36}
37
42bool hash_t::save(std::ostream &out) const
43{
44 out << data[0] << ' ' << data[1] << '\n';
45
46 return out.good();
47}
48
56std::ostream &operator<<(std::ostream &o, hash_t h)
57{
58 return o << h.data[0] << h.data[1];
59}
60
61} // namespace vita
Contains flags and manipulators to control the output format of individuals.
The main namespace for the project.
std::ostream & operator<<(std::ostream &o, hash_t h)
Mainly useful for debugging / testing.
Definition: cache_hash.cc:56
A 128bit unsigned integer used as individual's signature / hash table look-up key.
Definition: cache_hash.h:27
bool save(std::ostream &) const
Definition: cache_hash.cc:42
bool load(std::istream &)
Definition: cache_hash.cc:26