xo-object2: streamline setup
This commit is contained in:
parent
a136642a20
commit
441044dd01
9 changed files with 55 additions and 104 deletions
|
|
@ -3,8 +3,7 @@
|
|||
set(SELF_LIB xo_object2)
|
||||
set(SELF_SRCS
|
||||
init_object2.cpp
|
||||
object2_register_types.cpp
|
||||
object2_register_facets.cpp
|
||||
SetupObject2.cpp
|
||||
|
||||
GCObjectConversion_DFloat.cpp
|
||||
GCObjectConversion_DInteger.cpp
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
/** @file object2_register_facets.cpp
|
||||
/** @file SetupObject2.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Jan 2026
|
||||
**/
|
||||
|
||||
#include "object2_register_facets.hpp"
|
||||
#include "SetupObject2.hpp"
|
||||
#include "RuntimeError.hpp"
|
||||
|
||||
#include <xo/object2/Dictionary.hpp>
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
namespace xo {
|
||||
using xo::print::APrintable;
|
||||
using xo::mm::ACollector;
|
||||
using xo::mm::AAllocator;
|
||||
using xo::mm::AGCObject;
|
||||
using xo::scm::DList;
|
||||
|
|
@ -30,11 +31,12 @@ namespace xo {
|
|||
using xo::scm::DArray;
|
||||
using xo::facet::DVariantPlaceholder;
|
||||
using xo::facet::FacetRegistry;
|
||||
using xo::facet::impl_for;
|
||||
using xo::facet::typeseq;
|
||||
|
||||
namespace scm {
|
||||
bool
|
||||
object2_register_facets()
|
||||
SetupObject2::register_facets()
|
||||
{
|
||||
scope log(XO_DEBUG(true));
|
||||
|
||||
|
|
@ -81,7 +83,24 @@ namespace xo {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
SetupObject2::register_types(obj<ACollector> gc)
|
||||
{
|
||||
scope log(XO_DEBUG(true));
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= gc.install_type(impl_for<AGCObject, DBoolean>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DFloat>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DInteger>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DList>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DArray>());
|
||||
ok &= gc.install_type(impl_for<AGCObject, DDictionary>());
|
||||
|
||||
return ok;
|
||||
}
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end object2_register_facets.cpp */
|
||||
/* end SetupObject2.cpp */
|
||||
|
|
@ -4,23 +4,21 @@
|
|||
**/
|
||||
|
||||
#include "init_object2.hpp"
|
||||
#include "object2_register_facets.hpp"
|
||||
#include "object2_register_types.hpp"
|
||||
#include "SetupObject2.hpp"
|
||||
#include <xo/stringtable2/init_stringtable2.hpp>
|
||||
#include <xo/alloc2/CollectorTypeRegistry.hpp>
|
||||
#include <xo/alloc2/init_alloc2.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::scm::object2_register_facets;
|
||||
using xo::scm::object2_register_types;
|
||||
using xo::scm::SetupObject2;
|
||||
using xo::mm::CollectorTypeRegistry;
|
||||
|
||||
void
|
||||
InitSubsys<S_object2_tag>::init()
|
||||
{
|
||||
object2_register_facets();
|
||||
SetupObject2::register_facets();
|
||||
|
||||
CollectorTypeRegistry::instance().register_types(&object2_register_types);
|
||||
CollectorTypeRegistry::instance().register_types(&SetupObject2::register_types);
|
||||
}
|
||||
|
||||
InitEvidence
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
/** @file object2_register_types.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#include "object2_register_types.hpp"
|
||||
|
||||
#include "boolean/IGCObject_DBoolean.hpp"
|
||||
#include "number/IGCObject_DFloat.hpp"
|
||||
#include "number/IGCObject_DInteger.hpp"
|
||||
#include "string/IGCObject_DString.hpp"
|
||||
#include "list/IGCObject_DList.hpp"
|
||||
#include "array/IGCObject_DArray.hpp"
|
||||
#include "dictionary/IGCObject_DDictionary.hpp"
|
||||
|
||||
#include <xo/facet/FacetRegistry.hpp>
|
||||
#include <xo/indentlog/scope.hpp>
|
||||
|
||||
namespace xo {
|
||||
using xo::mm::ACollector;
|
||||
using xo::mm::AGCObject;
|
||||
using xo::facet::impl_for;
|
||||
using xo::scope;
|
||||
|
||||
namespace scm {
|
||||
bool
|
||||
object2_register_types(obj<ACollector> gc)
|
||||
{
|
||||
scope log(XO_DEBUG(true));
|
||||
|
||||
bool ok = true;
|
||||
|
||||
ok &= gc.install_type(impl_for<AGCObject, DBoolean>());
|
||||
|
||||
ok &= gc.install_type(impl_for<AGCObject, DFloat>());
|
||||
|
||||
ok &= gc.install_type(impl_for<AGCObject, DInteger>());
|
||||
|
||||
ok &= gc.install_type(impl_for<AGCObject, DList>());
|
||||
|
||||
ok &= gc.install_type(impl_for<AGCObject, DArray>());
|
||||
|
||||
ok &= gc.install_type(impl_for<AGCObject, DDictionary>());
|
||||
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end object2_register_types.cpp */
|
||||
Loading…
Add table
Add a link
Reference in a new issue