mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-09 12:28:13 -04:00
refactor(string_table): move to internal namespace
This commit is contained in:
parent
9aec567331
commit
3fb6e34ca3
@ -612,6 +612,7 @@ list(APPEND LIBDWARFS_COMMON_SRC
|
||||
src/dwarfs/file_type.cpp
|
||||
src/dwarfs/fstypes.cpp
|
||||
src/dwarfs/history.cpp
|
||||
src/dwarfs/internal/string_table.cpp
|
||||
src/dwarfs/internal/worker_group.cpp
|
||||
src/dwarfs/library_dependencies.cpp
|
||||
src/dwarfs/logger.cpp
|
||||
@ -620,7 +621,6 @@ list(APPEND LIBDWARFS_COMMON_SRC
|
||||
src/dwarfs/options.cpp
|
||||
src/dwarfs/os_access_generic.cpp
|
||||
src/dwarfs/performance_monitor.cpp
|
||||
src/dwarfs/string_table.cpp
|
||||
src/dwarfs/terminal.cpp
|
||||
src/dwarfs/thread_pool.cpp
|
||||
src/dwarfs/util.cpp
|
||||
|
@ -33,7 +33,8 @@
|
||||
|
||||
#include <dwarfs/file_stat.h>
|
||||
#include <dwarfs/file_type.h>
|
||||
#include <dwarfs/string_table.h>
|
||||
|
||||
#include <dwarfs/internal/string_table.h>
|
||||
|
||||
#include <dwarfs/gen-cpp2/metadata_layouts.h>
|
||||
|
||||
|
@ -34,6 +34,8 @@ namespace dwarfs {
|
||||
|
||||
class logger;
|
||||
|
||||
namespace internal {
|
||||
|
||||
class string_table {
|
||||
public:
|
||||
using LegacyTableView =
|
||||
@ -103,4 +105,6 @@ class string_table {
|
||||
std::unique_ptr<impl const> impl_;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
} // namespace dwarfs
|
@ -31,7 +31,6 @@
|
||||
|
||||
#include <dwarfs/file_stat.h>
|
||||
#include <dwarfs/file_type.h>
|
||||
#include <dwarfs/string_table.h>
|
||||
|
||||
namespace dwarfs {
|
||||
|
||||
|
@ -52,11 +52,11 @@
|
||||
#include <dwarfs/logger.h>
|
||||
#include <dwarfs/options.h>
|
||||
#include <dwarfs/performance_monitor.h>
|
||||
#include <dwarfs/string_table.h>
|
||||
#include <dwarfs/util.h>
|
||||
#include <dwarfs/vfs_stat.h>
|
||||
|
||||
#include <dwarfs/internal/metadata_v2.h>
|
||||
#include <dwarfs/internal/string_table.h>
|
||||
|
||||
#include <dwarfs/gen-cpp2/metadata_layouts.h>
|
||||
#include <dwarfs/gen-cpp2/metadata_types_custom_protocol.h>
|
||||
|
@ -28,9 +28,10 @@
|
||||
|
||||
#include <dwarfs/error.h>
|
||||
#include <dwarfs/logger.h>
|
||||
#include <dwarfs/string_table.h>
|
||||
|
||||
namespace dwarfs {
|
||||
#include <dwarfs/internal/string_table.h>
|
||||
|
||||
namespace dwarfs::internal {
|
||||
|
||||
class legacy_string_table : public string_table::impl {
|
||||
public:
|
||||
@ -307,4 +308,4 @@ string_table::pack(std::span<std::string_view const> input,
|
||||
return pack_generic(input, options);
|
||||
}
|
||||
|
||||
} // namespace dwarfs
|
||||
} // namespace dwarfs::internal
|
@ -58,7 +58,6 @@
|
||||
#include <dwarfs/scanner.h>
|
||||
#include <dwarfs/script.h>
|
||||
#include <dwarfs/segmenter_factory.h>
|
||||
#include <dwarfs/string_table.h>
|
||||
#include <dwarfs/thread_pool.h>
|
||||
#include <dwarfs/util.h>
|
||||
#include <dwarfs/version.h>
|
||||
@ -67,6 +66,7 @@
|
||||
#include <dwarfs/internal/block_manager.h>
|
||||
#include <dwarfs/internal/global_entry_data.h>
|
||||
#include <dwarfs/internal/metadata_freezer.h>
|
||||
#include <dwarfs/internal/string_table.h>
|
||||
#include <dwarfs/internal/worker_group.h>
|
||||
|
||||
#include <dwarfs/gen-cpp2/metadata_types.h>
|
||||
|
@ -36,10 +36,11 @@
|
||||
#include <dwarfs/progress.h>
|
||||
#include <dwarfs/scanner.h>
|
||||
#include <dwarfs/segmenter_factory.h>
|
||||
#include <dwarfs/string_table.h>
|
||||
#include <dwarfs/thread_pool.h>
|
||||
#include <dwarfs/vfs_stat.h>
|
||||
|
||||
#include <dwarfs/internal/string_table.h>
|
||||
|
||||
#include <dwarfs/gen-cpp2/metadata_layouts.h>
|
||||
|
||||
#include "mmap_mock.h"
|
||||
@ -139,11 +140,11 @@ std::string make_filesystem(::benchmark::State const& state) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
auto make_frozen_string_table(T const& strings,
|
||||
string_table::pack_options const& options) {
|
||||
auto make_frozen_string_table(
|
||||
T const& strings, internal::string_table::pack_options const& options) {
|
||||
using namespace apache::thrift::frozen;
|
||||
std::string tmp;
|
||||
auto tbl = string_table::pack(strings, options);
|
||||
auto tbl = internal::string_table::pack(strings, options);
|
||||
freezeToString(tbl, tmp);
|
||||
return mapFrozen<thrift::metadata::string_table>(std::move(tmp));
|
||||
}
|
||||
@ -157,7 +158,7 @@ auto make_frozen_legacy_string_table(std::vector<std::string>&& strings) {
|
||||
|
||||
void frozen_legacy_string_table_lookup(::benchmark::State& state) {
|
||||
auto data = make_frozen_legacy_string_table(test::test_string_vector());
|
||||
string_table table(data);
|
||||
internal::string_table table(data);
|
||||
int i = 0;
|
||||
std::string str;
|
||||
|
||||
@ -168,10 +169,10 @@ void frozen_legacy_string_table_lookup(::benchmark::State& state) {
|
||||
|
||||
void frozen_string_table_lookup(::benchmark::State& state) {
|
||||
auto data = make_frozen_string_table(
|
||||
test::test_strings,
|
||||
string_table::pack_options(state.range(0), state.range(1), true));
|
||||
test::test_strings, internal::string_table::pack_options(
|
||||
state.range(0), state.range(1), true));
|
||||
test::test_logger lgr;
|
||||
string_table table(lgr, "bench", data);
|
||||
internal::string_table table(lgr, "bench", data);
|
||||
int i = 0;
|
||||
std::string str;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user