xo-object2: missed generated (Printable,Array) code + .json5

This commit is contained in:
Roland Conybeare 2026-01-29 15:19:35 -05:00
commit 298e05dd06
4 changed files with 145 additions and 0 deletions

View file

@ -0,0 +1,13 @@
{
mode: "implementation",
includes: [ "<xo/printable2/Printable.hpp>",
"<xo/printable2/detail/IPrintable_Xfer.hpp>" ],
local_types: [ ],
namespace1: "xo",
namespace2: "scm",
facet_idl: "idl/Printable.json5",
brief: "provide APrintable interface for DArray",
using_doxygen: true,
repr: "DArray",
doc: [ "implement APrintable for DArray" ],
}

View file

@ -0,0 +1,62 @@
/** @file IPrintable_DArray.hpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DArray.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_repr.hpp.j2]
* 3. idl for facet methods
* [idl/IPrintable_DArray.json5]
**/
#pragma once
#include "Printable.hpp"
#include <xo/printable2/Printable.hpp>
#include <xo/printable2/detail/IPrintable_Xfer.hpp>
#include "DArray.hpp"
namespace xo { namespace scm { class IPrintable_DArray; } }
namespace xo {
namespace facet {
template <>
struct FacetImplementation<xo::print::APrintable,
xo::scm::DArray>
{
using ImplType = xo::print::IPrintable_Xfer
<xo::scm::DArray,
xo::scm::IPrintable_DArray>;
};
}
}
namespace xo {
namespace scm {
/** @class IPrintable_DArray
**/
class IPrintable_DArray {
public:
/** @defgroup scm-printable-darray-type-traits **/
///@{
using ppindentinfo = xo::print::APrintable::ppindentinfo;
using Copaque = xo::print::APrintable::Copaque;
using Opaque = xo::print::APrintable::Opaque;
///@}
/** @defgroup scm-printable-darray-methods **/
///@{
// const methods
/** Pretty-printing support for this object.
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
static bool pretty(const DArray & self, const ppindentinfo & ppii);
// non-const methods
///@}
};
} /*namespace scm*/
} /*namespace xo*/
/* end */

View file

@ -0,0 +1,28 @@
/** @file IPrintable_DArray.cpp
*
* Generated automagically from ingredients:
* 1. code generator:
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
* arguments:
* --input [idl/IPrintable_DArray.json5]
* 2. jinja2 template for abstract facet .hpp file:
* [iface_facet_any.hpp.j2]
* 3. idl for facet methods
* [idl/IPrintable_DArray.json5]
**/
#include "array/IPrintable_DArray.hpp"
namespace xo {
namespace scm {
auto
IPrintable_DArray::pretty(const DArray & self, const ppindentinfo & ppii) -> bool
{
return self.pretty(ppii);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IPrintable_DArray.cpp */

View file

@ -0,0 +1,42 @@
/** @file DSyntaxStateMachine.hpp
*
* @author Roland Conybeare, Jan 2026
**/
#pragma once
#include <xo/object2/DArray.hpp>
namespace xo {
namespace scm {
/** @class DSyntaxStateMachine
* @brief static interface for implementing ASyntaxStateMachine
*
* Using CRTP to collect methods common to ASyntaxStateMachine
* implementations.
*
* Deliberately unusable through base class pointer.
* For runtime polymorphism use something like:
* @code
* Derived * d = ...;
* auto obj = with_facet<ASyntaxStateMachine>::mkobj(d);
* // or
* obj<ASyntaxStateMachine,Derived>(d)
* @endcode
**/
template<typename Derived>
class DSyntaxStateMachine {
friend Derived;
/** arglist is DArray of obj<AGCObejct,DVariable> **/
void on_parsed_formal_arglist(this auto&& self, DArray * arglist, ParserStateMachine * p_psm) {
p_psm->illegal_parsed_formal_arglist(
}
};
} /*namespace scm*/
} /*namespace xo*/
/* end DSyntaxStateMachine.hpp */