Skip to content

Commit

Permalink
Using-declare vector types
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <[email protected]>
  • Loading branch information
jjerphan committed Jan 22, 2024
1 parent f8982cd commit 402431f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions cpp/arcticdb/column_store/chunked_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,22 @@
#include <arcticdb/util/constructors.hpp>
#include <arcticdb/column_store/block.hpp>

#ifdef DEBUG_BUILD
#include <boost/container/small_vector.hpp>
#endif

#include <cstdint>

namespace arcticdb {

#ifdef DEBUG_BUILD
using MemBlockVectorType = std::vector<MemBlock *>;
using MemBlockOffsetsVectorType = std::vector<size_t>;
#else
using MemBlockVectorType = boost::container::small_vector<MemBlock *, 1>;

Check failure on line 29 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Linux C++ Tests / compile (linux, linux, manylinux_x86_64, /tmp/cpp_build, *.gz, *.so, *.[ao], vcpkg_installed, mon...

‘boost’ does not name a type

Check failure on line 29 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

'container': the symbol to the left of a '::' must be a type

Check failure on line 29 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

'small_vector': is not a member of 'boost'

Check failure on line 29 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

syntax error: identifier 'small_vector'
using MemBlockOffsetsVectorType = boost::container::small_vector<size_t, 1>;

Check failure on line 30 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Linux C++ Tests / compile (linux, linux, manylinux_x86_64, /tmp/cpp_build, *.gz, *.so, *.[ao], vcpkg_installed, mon...

‘boost’ does not name a type

Check failure on line 30 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

'container': the symbol to the left of a '::' must be a type

Check failure on line 30 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

'small_vector': is not a member of 'boost'

Check failure on line 30 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

syntax error: identifier 'small_vector'
#endif

/*
* ChunkedBufferImpl is an untyped buffer that is composed of blocks of data that can be either regularly or
* irregularly sized, with optimizations for the following representations:
Expand Down Expand Up @@ -400,14 +410,8 @@ class ChunkedBufferImpl {

size_t bytes_ = 0;
size_t regular_sized_until_ = 0;
//#define DEBUG_BUILD
#ifndef DEBUG_BUILD
boost::container::small_vector<BlockType *, 1> blocks_;
boost::container::small_vector<size_t, 1> block_offsets_;
#else
std::vector<BlockType*> blocks_;
std::vector<size_t> block_offsets_;
#endif
MemBlockVectorType blocks_;

Check failure on line 413 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Linux C++ Tests / compile (linux, linux, manylinux_x86_64, /tmp/cpp_build, *.gz, *.so, *.[ao], vcpkg_installed, mon...

‘MemBlockVectorType’ does not name a type

Check failure on line 413 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

'blocks_': unknown override specifier

Check failure on line 413 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

missing type specifier - int assumed. Note: C++ does not support default-int
MemBlockOffsetsVectorType block_offsets_;

Check failure on line 414 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Linux C++ Tests / compile (linux, linux, manylinux_x86_64, /tmp/cpp_build, *.gz, *.so, *.[ao], vcpkg_installed, mon...

‘MemBlockOffsetsVectorType’ does not name a type

Check failure on line 414 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

'block_offsets_': unknown override specifier

Check failure on line 414 in cpp/arcticdb/column_store/chunked_buffer.hpp

View workflow job for this annotation

GitHub Actions / Windows C++ Tests / compile (windows, windows-cl, win_amd64, C:/cpp_build, C:/vcpkg_packages, *.pdb, *.lib, *.ilk, *....

missing type specifier - int assumed. Note: C++ does not support default-int
};

constexpr size_t PageSize = 4096;
Expand Down
2 changes: 1 addition & 1 deletion cpp/arcticdb/column_store/column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ void Column::compact_blocks() {
data_.compact_blocks();
}

const std::vector<MemBlock *>& Column::blocks() const {
const MemBlockVectorType& Column::blocks() const {
return data_.buffer().blocks();
}

Expand Down
2 changes: 1 addition & 1 deletion cpp/arcticdb/column_store/column.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ class Column {

void compact_blocks();

const std::vector<MemBlock *>& blocks() const;
const MemBlockVectorType& blocks() const;

template<typename T>
std::optional<T> scalar_at(position_t row) const {
Expand Down

0 comments on commit 402431f

Please sign in to comment.