container: root: common: type: add PluggableSpace entrypoint

This commit is contained in:
2026-01-08 14:21:00 -08:00
parent 843add3d63
commit 1f0b8e914e

View File

@@ -1,6 +1,6 @@
// docker-finance | modern accounting for the power-user
//
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
// Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -146,16 +146,16 @@ class PluggablePath
t_pair m_pair;
};
//! \brief Data type for the pluggable's namespace
//! \todo C++23 concept pair-like
//! \brief Data type for the pluggable's namespace and entrypoint class name
//! \todo C++23 concept tuple-like
//! \since docker-finance 1.1.0
class PluggableSpace
{
using t_pair = std::pair<std::string, std::string>;
using t_space = std::tuple<std::string, std::string, std::string>;
public:
//! \brief Construct data type with most-outer and inner namespaces
explicit PluggableSpace(const t_pair& pair) : m_pair(pair) {}
explicit PluggableSpace(const t_space& args) : m_space(args) {}
~PluggableSpace() = default;
PluggableSpace(const PluggableSpace&) = default;
@@ -169,7 +169,7 @@ class PluggableSpace
//! \return NPI reference
auto& outer(const std::string& arg)
{
m_pair.first = arg;
std::get<0>(m_space) = arg;
return *this;
}
@@ -177,18 +177,29 @@ class PluggableSpace
//! \return NPI reference
auto& inner(const std::string& arg)
{
m_pair.second = arg;
std::get<1>(m_space) = arg;
return *this;
}
//! \brief Set pluggable's entrypoint class name
//! \return NPI reference
auto& entry(const std::string& arg)
{
std::get<2>(m_space) = arg;
return *this;
}
//! \return Pluggable's most-outer namespace
const std::string& outer() const { return m_pair.first; }
const std::string& outer() const { return std::get<0>(m_space); }
//! \return Pluggable's inner namespace(s)
const std::string& inner() const { return m_pair.second; }
const std::string& inner() const { return std::get<1>(m_space); }
//! \return Pluggable's entrypoint class name
const std::string& entry() const { return std::get<2>(m_space); }
private:
t_pair m_pair;
t_space m_space;
};
//! \brief Data type for pluggable auto-(un)loader arguments
@@ -255,9 +266,10 @@ concept PPath = requires(t_path path, PluggablePath plug) {
template <typename t_space>
concept PSpace = requires(t_space space, PluggableSpace plug) {
space.operator()().operator=(plug);
space.operator()().outer("").inner("");
space.operator()().outer("").inner("").entry("");
space.operator()().outer();
space.operator()().inner();
space.operator()().entry();
};
//! \concept dfi::common::type::PArgs