From 1f0b8e914edda3006afb70974d6aace78102c288 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Thu, 8 Jan 2026 14:21:00 -0800 Subject: [PATCH] container: root: common: type: add PluggableSpace entrypoint --- container/src/root/common/type.hh | 34 +++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/container/src/root/common/type.hh b/container/src/root/common/type.hh index ebb54ce..a8f09a4 100644 --- a/container/src/root/common/type.hh +++ b/container/src/root/common/type.hh @@ -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; + using t_space = std::tuple; 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 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