xo-object2: APrintable+DFloat

This commit is contained in:
Roland Conybeare 2026-01-05 11:53:44 -05:00
commit a903a058f1
9 changed files with 112 additions and 9 deletions

View file

@ -7,12 +7,14 @@ set(SELF_SRCS
IGCObject_DList.cpp
ISequence_Any.cpp
ISequence_DList.cpp
IPrintable_DFloat.cpp
DList.cpp
DFloat.cpp
object2_register_types.cpp
)
xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS})
# note: deps here must also appear in cmake/xo_alloc2Config.cmake.in
# note: deps here must also appear in cmake/xo_object2Config.cmake.in
xo_dependency(${SELF_LIB} xo_gc)
#xo_dependency(${SELF_LIB} indentlog)
xo_dependency(${SELF_LIB} xo_printable2)
xo_dependency(${SELF_LIB} indentlog)

View file

@ -4,9 +4,11 @@
**/
#include "DFloat.hpp"
#include <xo/indentlog/print/pretty.hpp>
namespace xo {
using xo::facet::typeseq;
using xo::print::ppdetail_atomic;
namespace scm {
DFloat *
@ -18,6 +20,12 @@ namespace xo {
return new (mem) DFloat(x);
}
bool
DFloat::pretty(const ppindentinfo & ppii) const
{
return ppdetail_atomic<double>::print_pretty(ppii, value_);
}
} /*namespace scm*/
} /*namespace xo*/

View file

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