diff --git a/production/db/inc/index/index.hpp b/production/db/inc/index/index.hpp index 85ed94ce8e84..21684f381d3b 100644 --- a/production/db/inc/index/index.hpp +++ b/production/db/inc/index/index.hpp @@ -57,11 +57,11 @@ constexpr size_t c_offset_buffer_size = 32; class index_offset_buffer_t { public: - void insert(gaia_offset_t offset, common::gaia_type_t type); - gaia_offset_t get_offset(size_t index) const; - common::gaia_type_t get_type(size_t index) const; - bool empty() const; - size_t size() const; + inline void insert(gaia_offset_t offset, common::gaia_type_t type); + inline gaia_offset_t get_offset(size_t index) const; + inline common::gaia_type_t get_type(size_t index) const; + inline size_t size() const; + inline bool empty() const; private: std::array, c_offset_buffer_size> m_offsets = {}; diff --git a/production/db/inc/index/index.inc b/production/db/inc/index/index.inc index 97e242eccbef..1e0b4de9212b 100644 --- a/production/db/inc/index/index.inc +++ b/production/db/inc/index/index.inc @@ -133,3 +133,29 @@ typename T_structure::iterator index_t::find_physical_k return m_data.end(); } + +void index_offset_buffer_t::insert(gaia_offset_t offset, common::gaia_type_t type) +{ + m_offsets[m_size] = std::make_pair(std::move(offset), std::move(type)); + ++m_size; +} + +gaia_offset_t index_offset_buffer_t::get_offset(size_t index) const +{ + return m_offsets[index].first; +} + +common::gaia_type_t index_offset_buffer_t::get_type(size_t index) const +{ + return m_offsets[index].second; +} + +size_t index_offset_buffer_t::size() const +{ + return m_size; +} + +bool index_offset_buffer_t::empty() const +{ + return m_size == 0; +} diff --git a/production/db/index/CMakeLists.txt b/production/db/index/CMakeLists.txt index 127a386d52a5..43a9c486e4d4 100644 --- a/production/db/index/CMakeLists.txt +++ b/production/db/index/CMakeLists.txt @@ -18,8 +18,7 @@ add_library(gaia_index STATIC src/base_index.cpp src/index.cpp src/hash_index.cpp - src/range_index.cpp - src/index_offset_buffer.cpp) + src/range_index.cpp) configure_gaia_target(gaia_index) target_include_directories(gaia_index PUBLIC ${GAIA_INDEX_INCLUDES}) target_link_libraries(gaia_index PRIVATE gaia_common gaia_payload_types) diff --git a/production/db/index/src/index_offset_buffer.cpp b/production/db/index/src/index_offset_buffer.cpp deleted file mode 100644 index d2032d680791..000000000000 --- a/production/db/index/src/index_offset_buffer.cpp +++ /dev/null @@ -1,43 +0,0 @@ -///////////////////////////////////////////// -// Copyright (c) Gaia Platform LLC -// All rights reserved. -///////////////////////////////////////////// - -#include "index.hpp" - -namespace gaia -{ -namespace db -{ -namespace index -{ - -gaia_offset_t index_offset_buffer_t::get_offset(size_t index) const -{ - return m_offsets[index].first; -} - -common::gaia_type_t index_offset_buffer_t::get_type(size_t index) const -{ - return m_offsets[index].second; -} - -size_t index_offset_buffer_t::size() const -{ - return m_size; -} - -bool index_offset_buffer_t::empty() const -{ - return m_size == 0; -} - -void index_offset_buffer_t::insert(gaia_offset_t offset, common::gaia_type_t type) -{ - m_offsets[m_size] = std::make_pair(std::move(offset), std::move(type)); - ++m_size; -} - -} // namespace index -} // namespace db -} // namespace gaia