xo-facet xo-object2: facet fixes + IPrintable_DString
This commit is contained in:
parent
aba9530a57
commit
d2d3b34ce7
21 changed files with 176 additions and 26 deletions
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Printable.json5]
|
||||
* 2. jinja2 template for facet .hpp file:
|
||||
|
|
@ -18,7 +18,6 @@
|
|||
#include "detail/IPrintable_Xfer.hpp"
|
||||
#include "detail/RPrintable.hpp"
|
||||
|
||||
// todo: additional includes in idl above
|
||||
#include "detail/ppdetail_Printable.hpp"
|
||||
|
||||
/* end Printable.hpp */
|
||||
/* end Printable.hpp */
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Printable.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
#include <xo/facet/facet_implementation.hpp>
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
|
||||
|
||||
namespace xo {
|
||||
namespace print {
|
||||
|
||||
|
|
@ -35,6 +36,8 @@ public:
|
|||
// types
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
/** dynamic pretty-printing state during layout **/
|
||||
using ppindentinfo = xo::print::ppindentinfo;
|
||||
///@}
|
||||
|
|
@ -45,9 +48,8 @@ public:
|
|||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** Pretty-printing support for this object.
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp]
|
||||
**/
|
||||
virtual bool pretty(Copaque data, const ppindentinfo & ppii) const = 0;
|
||||
See [xo-indentlog/xo/indentlog/pretty.hpp] **/
|
||||
virtual bool pretty(Copaque data, const ppindentinfo & ppii) const = 0;
|
||||
|
||||
// nonconst methods
|
||||
///@}
|
||||
|
|
@ -69,4 +71,4 @@ using IPrintable_ImplType = xo::facet::FacetImplType<APrintable, DRepr>;
|
|||
} /*namespace print*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* */
|
||||
/* APrintable.hpp */
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Printable.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
@ -56,7 +56,7 @@ namespace print {
|
|||
|
||||
// const methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
[[noreturn]] bool pretty(Copaque, const ppindentinfo &) const override { _fatal(); }
|
||||
[[noreturn]] bool pretty(Copaque, const ppindentinfo &) const override { _fatal(); }
|
||||
|
||||
// nonconst methods
|
||||
|
||||
|
|
@ -83,4 +83,4 @@ namespace print {
|
|||
} /*namespace print */
|
||||
} /*namespace xo */
|
||||
|
||||
/* IPrintable_Any.hpp */
|
||||
/* IPrintable_Any.hpp */
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Printable.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
@ -41,7 +41,7 @@ namespace print {
|
|||
|
||||
// const methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
bool pretty(Copaque data, const ppindentinfo & ppii) const override {
|
||||
bool pretty(Copaque data, const ppindentinfo & ppii) const override {
|
||||
return I::pretty(_dcast(data), ppii);
|
||||
}
|
||||
|
||||
|
|
@ -78,4 +78,4 @@ namespace print {
|
|||
} /*namespace print */
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IPrintable_Xfer.hpp */
|
||||
/* end IPrintable_Xfer.hpp */
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* [/home/roland/proj/xo-umbrella2-claude1/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [idl/Printable.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
|
|
@ -30,8 +30,8 @@ public:
|
|||
///@{
|
||||
using ObjectType = Object;
|
||||
using DataPtr = Object::DataPtr;
|
||||
using typeseq = xo::reflect::typeseq;
|
||||
using ppindentinfo = APrintable::ppindentinfo;
|
||||
using typeseq = xo::facet::typeseq;
|
||||
///@}
|
||||
|
||||
/** @defgroup print-printable-router-ctors **/
|
||||
|
|
@ -39,8 +39,8 @@ public:
|
|||
RPrintable() {}
|
||||
RPrintable(Object::DataPtr data) : Object{std::move(data)} {}
|
||||
RPrintable(const APrintable * iface, void * data)
|
||||
requires std::is_same_v<typename Object::DataType, xo::facet::DVariantPlaceholder>
|
||||
: Object(iface, data) {}
|
||||
requires std::is_same_v<typename Object::DataType, xo::facet::DVariantPlaceholder>
|
||||
: Object(iface, data) {}
|
||||
|
||||
///@}
|
||||
/** @defgroup print-printable-router-methods **/
|
||||
|
|
@ -48,13 +48,11 @@ public:
|
|||
|
||||
// const methods
|
||||
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||
bool pretty(const ppindentinfo & ppii) const {
|
||||
bool pretty(const ppindentinfo & ppii) const {
|
||||
return O::iface()->pretty(O::data(), ppii);
|
||||
}
|
||||
|
||||
// non-const methods
|
||||
// << do something for non-const methods >>
|
||||
//
|
||||
// non-const methods (still const in router!)
|
||||
|
||||
///@}
|
||||
/** @defgroup print-printable-member-vars **/
|
||||
|
|
@ -79,4 +77,4 @@ namespace xo { namespace facet {
|
|||
};
|
||||
} }
|
||||
|
||||
/* end RPrintable.hpp */
|
||||
/* end RPrintable.hpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue