| 1613 | |
| 1614 | // Reading destroys the old group contents! Returns true if all was ok. |
| 1615 | template <typename INPUT> bool read_metadata(allocator_type &alloc, INPUT *fp) |
| 1616 | { |
| 1617 | clear(alloc, true); |
| 1618 | |
| 1619 | if (!sparsehash_internal::read_data(fp, &_bitmap, sizeof(_bitmap))) |
| 1620 | return false; |
| 1621 | |
| 1622 | // We'll allocate the space, but we won't fill it: it will be |
| 1623 | // left as uninitialized raw memory. |
| 1624 | uint32_t num_items = spp_popcount(_bitmap); // yes, _num_buckets not set |
| 1625 | _set_num_items(num_items); |
| 1626 | _group = num_items ? _allocate_group(alloc, num_items/* , true */) : 0; |
| 1627 | return true; |
| 1628 | } |
| 1629 | |
| 1630 | // Again, only meaningful if value_type is a POD. |
| 1631 | template <typename INPUT> bool read_nopointer_data(INPUT *fp) |
no test coverage detected