write_trie_backwards.h 674 B

1234567891011121314151617181920212223
  1. #pragma once
  2. #include "minimize.h"
  3. #include <util/generic/vector.h>
  4. #include <util/stream/output.h>
  5. #include <cstddef>
  6. namespace NCompactTrie {
  7. class TReverseNodeEnumerator {
  8. public:
  9. virtual ~TReverseNodeEnumerator() = default;
  10. virtual bool Move() = 0;
  11. virtual size_t GetLeafLength() const = 0;
  12. virtual size_t RecreateNode(char* buffer, size_t resultLength) = 0;
  13. };
  14. struct TOpaqueTrie;
  15. size_t WriteTrieBackwards(IOutputStream& os, TReverseNodeEnumerator& enumerator, bool verbose);
  16. size_t WriteTrieBackwardsNoAlloc(IOutputStream& os, TReverseNodeEnumerator& enumerator, TOpaqueTrie& trie, EMinimizeMode mode);
  17. }