/* * Copyright (C) 2017-present ScyllaDB * */ /* * SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 */ #pragma once #include #include #include #include #include namespace sstables { class sstable; }; // Customize deleter so that lw_shared_ptr can work with an incomplete sstable class namespace seastar { template <> struct lw_shared_ptr_deleter { static void dispose(sstables::sstable* sst); }; } namespace sstables { using shared_sstable = seastar::lw_shared_ptr; using sstable_list = std::unordered_set; std::string to_string(const shared_sstable& sst, bool include_origin = true); } // namespace sstables template <> struct fmt::formatter : fmt::formatter { template auto format(const sstables::shared_sstable& sst, FormatContext& ctx) const { return fmt::format_to(ctx.out(), "{}", sstables::to_string(sst)); } }; namespace std { inline std::ostream& operator<<(std::ostream& os, const sstables::shared_sstable& sst) { return os << fmt::format("{}", sst); } } // namespace std