|
5 | 5 | #include <string_view> |
6 | 6 | #include <utility> |
7 | 7 |
|
8 | | -// TODO what to do with namespace? |
9 | | -// TODO add tests for these? |
10 | | -// TODO add namespace ? sparrow-ipc / detail or utils? |
11 | | -#include "config/config.hpp" |
12 | | - |
13 | | -// Aligns a value to the next multiple of 8, as required by the Arrow IPC format for message bodies. |
14 | | -SPARROW_IPC_API int64_t align_to_8(int64_t n); |
| 8 | +#include "Schema_generated.h" |
15 | 9 |
|
16 | | -// Parse the format string |
17 | | -SPARROW_IPC_API std::optional<int32_t> parse_format(std::string_view format_str, std::string_view sep); |
| 10 | +#include "config/config.hpp" |
18 | 11 |
|
19 | | -SPARROW_IPC_API std::pair<org::apache::arrow::flatbuf::Type, flatbuffers::Offset<void>> |
20 | | -get_flatbuffer_decimal_type(flatbuffers::FlatBufferBuilder& builder, std::string_view format_str, int32_t bitWidth); |
| 12 | +// TODO add tests |
| 13 | +// TODO in that case define #ifdef TESTING for the fcts here to be testable and available in anonymous namespaces |
| 14 | +namespace sparrow_ipc |
| 15 | +{ |
| 16 | + namespace utils |
| 17 | + { |
| 18 | + // Aligns a value to the next multiple of 8, as required by the Arrow IPC format for message bodies |
| 19 | + SPARROW_IPC_API int64_t align_to_8(int64_t n); |
21 | 20 |
|
22 | | -SPARROW_IPC_API std::pair<org::apache::arrow::flatbuf::Type, flatbuffers::Offset<void>> |
23 | | -get_flatbuffer_type(flatbuffers::FlatBufferBuilder& builder, std::string_view format_str); |
| 21 | + // Creates a Flatbuffers type from a format string |
| 22 | + // This function maps a sparrow data type to the corresponding Flatbuffers type |
| 23 | + SPARROW_IPC_API std::pair<org::apache::arrow::flatbuf::Type, flatbuffers::Offset<void>> |
| 24 | + get_flatbuffer_type(flatbuffers::FlatBufferBuilder& builder, std::string_view format_str); |
| 25 | + } |
| 26 | +} |
0 commit comments