Skip to content

src/storage/trie/trie_batches.hpp

Namespaces

Name
sgns
sgns::storage
sgns::storage::trie

Classes

Name
class sgns::storage::trie::TrieBatch
class sgns::storage::trie::PersistentTrieBatch
class sgns::storage::trie::EphemeralTrieBatch
class sgns::storage::trie::TopperTrieBatch

Source code

#ifndef SUPERGENIUS_STORAGE_TRIE_IMPL_TRIE_BATCH
#define SUPERGENIUS_STORAGE_TRIE_IMPL_TRIE_BATCH

#include "storage/buffer_map_types.hpp"

namespace sgns::storage::trie {

  class TrieBatch : public face::Readable<Buffer, Buffer>,
                    public face::Writeable<Buffer, Buffer>,
                    public face::Iterable<Buffer, Buffer> {
   public:
    ~TrieBatch() override = default;

    virtual outcome::result<void> clearPrefix(const Buffer &prefix) = 0;
  };

  class TopperTrieBatch;

  class PersistentTrieBatch
      : public TrieBatch,
        public std::enable_shared_from_this<PersistentTrieBatch> {
   public:
    virtual outcome::result<Buffer> commit() = 0;

    virtual std::unique_ptr<TopperTrieBatch> batchOnTop() = 0;
  };

  class EphemeralTrieBatch : public TrieBatch {};

  class TopperTrieBatch : public TrieBatch {
   public:
    virtual outcome::result<void> writeBack() = 0;
  };

}  // namespace sgns::storage::trie

#endif  // SUPERGENIUS_STORAGE_TRIE_IMPL_TRIE_BATCH

Updated on 2026-03-04 at 13:10:45 -0800