sparrow-ipc 0.3.0
Loading...
Searching...
No Matches
dictionary_cache.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <functional>
5#include <map>
6#include <optional>
7
8#include <sparrow/record_batch.hpp>
9
11
12namespace sparrow_ipc
13{
26 {
27 public:
40 void store_dictionary(int64_t id, sparrow::record_batch batch, bool is_delta);
41
48 std::optional<std::reference_wrapper<const sparrow::record_batch>> get_dictionary(int64_t id) const;
49
56 [[nodiscard]] bool contains(int64_t id) const noexcept;
57
61 void clear() noexcept;
62
68 [[nodiscard]] size_t size() const noexcept ;
69
70 private:
71 std::map<int64_t, sparrow::record_batch> m_dictionaries;
72 };
73}
Caches dictionaries during deserialization.
std::optional< std::reference_wrapper< const sparrow::record_batch > > get_dictionary(int64_t id) const
Retrieve a cached dictionary.
void clear() noexcept
Clear all cached dictionaries.
void store_dictionary(int64_t id, sparrow::record_batch batch, bool is_delta)
Store or update a dictionary.
size_t size() const noexcept
Get the number of cached dictionaries.
bool contains(int64_t id) const noexcept
Check if a dictionary is cached.
#define SPARROW_IPC_API
Definition config.hpp:12