FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
registry.hpp File Reference

Storage backend registry: name -> factories. More...

#include "fastmm/store/backend.hpp"
#include "fastmm/store/reader.hpp"
#include <memory>
#include <string>
#include <string_view>
#include <vector>

Go to the source code of this file.

Classes

struct  fastmm::store::StoreEntry
 
class  fastmm::store::StoreRegistry
 

Namespaces

namespace  fastmm
 
namespace  fastmm::store
 

Enumerations

enum class  fastmm::store::AddResult : std::uint8_t { fastmm::store::Added , fastmm::store::AlreadyPresent , fastmm::store::Conflict , fastmm::store::Invalid }
 

Functions

constexpr std::string_view fastmm::store::to_string (AddResult r) noexcept
 
void fastmm::store::register_builtin_backends (StoreRegistry &r=StoreRegistry::instance())
 Adds the backends FastMM ships ("sqlite"). Idempotent.
 
std::string fastmm::store::configured_backend (const GenericSection &storage)
 [storage] backend, defaulting to "sqlite"; "none" disables the store.
 

Variables

constexpr std::string_view fastmm::store::kNoBackend = "none"
 

Detailed Description

Storage backend registry: name -> factories.

[storage] backend names one entry.

fastmm::store::StoreRegistry::instance().add("clickhouse", &make_ch_backend, &make_ch_reader);

Nothing registers itself, for the same reason the strategy registry does not (a static library's self-registering object is dropped by the linker): fastmm::store::register_builtin_backends() adds the ones FastMM ships, and an out-of-tree backend calls add() before starting a session. The name "none" is reserved and never reaches the registry: it means no backend at all.