From 6986bfed0b951c7bbd7d2200965069052a87a5fc Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 6 Jun 2026 22:27:31 -0400 Subject: [PATCH] .xo-type subrepo tidy --- .xo-type/CMakeLists.txt | 130 ------------------ .xo-type/cmake/xo-bootstrap-macros.cmake | 41 ------ .xo-type/cmake/xo_typeConfig.cmake.in | 18 --- .xo-type/idl/IGCObject_DArrayType.json5 | 16 --- .xo-type/idl/IGCObject_DAtomicType.json5 | 16 --- .xo-type/idl/IGCObject_DFunctionType.json5 | 16 --- .xo-type/idl/IGCObject_DListType.json5 | 16 --- .xo-type/idl/IGCObject_DTypeVar.json5 | 16 --- .xo-type/idl/IGCObject_DTypeVarRef.json5 | 16 --- .xo-type/idl/IType_DArrayType.json5 | 16 --- .xo-type/idl/IType_DAtomicType.json5 | 16 --- .xo-type/idl/IType_DFunctionType.json5 | 16 --- .xo-type/idl/IType_DListType.json5 | 16 --- .xo-type/idl/IType_DTypeVarRef.json5 | 16 --- .xo-type/idl/Type.json5 | 76 ---------- .xo-type/include/xo/type/ArrayType.hpp | 12 -- .xo-type/include/xo/type/AtomicType.hpp | 12 -- .xo-type/include/xo/type/DArrayType.hpp | 62 --------- .xo-type/include/xo/type/DAtomicType.hpp | 57 -------- .xo-type/include/xo/type/DFunctionType.hpp | 116 ---------------- .xo-type/include/xo/type/DListType.hpp | 70 ---------- .xo-type/include/xo/type/FunctionType.hpp | 12 -- .xo-type/include/xo/type/ListType.hpp | 12 -- .xo-type/include/xo/type/Metatype.hpp | 120 ---------------- .xo-type/include/xo/type/SetupType.hpp | 25 ---- .xo-type/include/xo/type/Type.hpp | 22 --- .xo-type/include/xo/type/TypeOps.hpp | 37 ----- .xo-type/include/xo/type/TypeVarRef.hpp | 12 -- .../xo/type/array/IGCObject_DArrayType.hpp | 67 --------- .../xo/type/array/IType_DArrayType.hpp | 66 --------- .../xo/type/atomic/IGCObject_DAtomicType.hpp | 67 --------- .../xo/type/atomic/IType_DAtomicType.hpp | 66 --------- .../type/function/IGCObject_DFunctionType.hpp | 67 --------- .../xo/type/function/IType_DFunctionType.hpp | 66 --------- .xo-type/include/xo/type/init_type.hpp | 21 --- .../xo/type/list/IGCObject_DListType.hpp | 67 --------- .../include/xo/type/list/IType_DListType.hpp | 66 --------- .xo-type/include/xo/type/type/AType.hpp | 91 ------------ .xo-type/include/xo/type/type/IType_Any.hpp | 93 ------------- .xo-type/include/xo/type/type/IType_Xfer.hpp | 103 -------------- .xo-type/include/xo/type/type/RType.hpp | 95 ------------- .../include/xo/type/typevar/DTypeVarRef.hpp | 71 ---------- .../xo/type/typevar/IGCObject_DTypeVarRef.hpp | 67 --------- .../xo/type/typevar/IType_DTypeVarRef.hpp | 66 --------- .xo-type/src/type/CMakeLists.txt | 41 ------ .xo-type/src/type/DArrayType.cpp | 92 ------------- .xo-type/src/type/DAtomicType.cpp | 72 ---------- .xo-type/src/type/DFunctionType.cpp | 106 -------------- .xo-type/src/type/DListType.cpp | 103 -------------- .xo-type/src/type/DTypeVarRef.cpp | 99 ------------- .xo-type/src/type/IGCObject_DArrayType.cpp | 32 ----- .xo-type/src/type/IGCObject_DAtomicType.cpp | 32 ----- .xo-type/src/type/IGCObject_DFunctionType.cpp | 32 ----- .xo-type/src/type/IGCObject_DListType.cpp | 32 ----- .xo-type/src/type/IGCObject_DTypeVar.cpp | 39 ------ .xo-type/src/type/IGCObject_DTypeVarRef.cpp | 32 ----- .xo-type/src/type/IType_Any.cpp | 42 ------ .xo-type/src/type/IType_DArrayType.cpp | 46 ------- .xo-type/src/type/IType_DAtomicType.cpp | 46 ------- .xo-type/src/type/IType_DFunctionType.cpp | 46 ------- .xo-type/src/type/IType_DListType.cpp | 46 ------- .xo-type/src/type/IType_DTypeVar.cpp | 46 ------- .xo-type/src/type/IType_DTypeVarRef.cpp | 46 ------- .xo-type/src/type/Metatype.cpp | 101 -------------- .xo-type/src/type/SetupType.cpp | 71 ---------- .xo-type/src/type/TypeOps.cpp | 15 -- .xo-type/src/type/init_type.cpp | 38 ----- .xo-type/utest/CMakeLists.txt | 18 --- .xo-type/utest/DArrayType.test.cpp | 70 ---------- .xo-type/utest/DAtomicType.test.cpp | 106 -------------- .xo-type/utest/DListType.test.cpp | 65 --------- .xo-type/utest/type_utest_main.cpp | 24 ---- 72 files changed, 3687 deletions(-) delete mode 100644 .xo-type/CMakeLists.txt delete mode 100644 .xo-type/cmake/xo-bootstrap-macros.cmake delete mode 100644 .xo-type/cmake/xo_typeConfig.cmake.in delete mode 100644 .xo-type/idl/IGCObject_DArrayType.json5 delete mode 100644 .xo-type/idl/IGCObject_DAtomicType.json5 delete mode 100644 .xo-type/idl/IGCObject_DFunctionType.json5 delete mode 100644 .xo-type/idl/IGCObject_DListType.json5 delete mode 100644 .xo-type/idl/IGCObject_DTypeVar.json5 delete mode 100644 .xo-type/idl/IGCObject_DTypeVarRef.json5 delete mode 100644 .xo-type/idl/IType_DArrayType.json5 delete mode 100644 .xo-type/idl/IType_DAtomicType.json5 delete mode 100644 .xo-type/idl/IType_DFunctionType.json5 delete mode 100644 .xo-type/idl/IType_DListType.json5 delete mode 100644 .xo-type/idl/IType_DTypeVarRef.json5 delete mode 100644 .xo-type/idl/Type.json5 delete mode 100644 .xo-type/include/xo/type/ArrayType.hpp delete mode 100644 .xo-type/include/xo/type/AtomicType.hpp delete mode 100644 .xo-type/include/xo/type/DArrayType.hpp delete mode 100644 .xo-type/include/xo/type/DAtomicType.hpp delete mode 100644 .xo-type/include/xo/type/DFunctionType.hpp delete mode 100644 .xo-type/include/xo/type/DListType.hpp delete mode 100644 .xo-type/include/xo/type/FunctionType.hpp delete mode 100644 .xo-type/include/xo/type/ListType.hpp delete mode 100644 .xo-type/include/xo/type/Metatype.hpp delete mode 100644 .xo-type/include/xo/type/SetupType.hpp delete mode 100644 .xo-type/include/xo/type/Type.hpp delete mode 100644 .xo-type/include/xo/type/TypeOps.hpp delete mode 100644 .xo-type/include/xo/type/TypeVarRef.hpp delete mode 100644 .xo-type/include/xo/type/array/IGCObject_DArrayType.hpp delete mode 100644 .xo-type/include/xo/type/array/IType_DArrayType.hpp delete mode 100644 .xo-type/include/xo/type/atomic/IGCObject_DAtomicType.hpp delete mode 100644 .xo-type/include/xo/type/atomic/IType_DAtomicType.hpp delete mode 100644 .xo-type/include/xo/type/function/IGCObject_DFunctionType.hpp delete mode 100644 .xo-type/include/xo/type/function/IType_DFunctionType.hpp delete mode 100644 .xo-type/include/xo/type/init_type.hpp delete mode 100644 .xo-type/include/xo/type/list/IGCObject_DListType.hpp delete mode 100644 .xo-type/include/xo/type/list/IType_DListType.hpp delete mode 100644 .xo-type/include/xo/type/type/AType.hpp delete mode 100644 .xo-type/include/xo/type/type/IType_Any.hpp delete mode 100644 .xo-type/include/xo/type/type/IType_Xfer.hpp delete mode 100644 .xo-type/include/xo/type/type/RType.hpp delete mode 100644 .xo-type/include/xo/type/typevar/DTypeVarRef.hpp delete mode 100644 .xo-type/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp delete mode 100644 .xo-type/include/xo/type/typevar/IType_DTypeVarRef.hpp delete mode 100644 .xo-type/src/type/CMakeLists.txt delete mode 100644 .xo-type/src/type/DArrayType.cpp delete mode 100644 .xo-type/src/type/DAtomicType.cpp delete mode 100644 .xo-type/src/type/DFunctionType.cpp delete mode 100644 .xo-type/src/type/DListType.cpp delete mode 100644 .xo-type/src/type/DTypeVarRef.cpp delete mode 100644 .xo-type/src/type/IGCObject_DArrayType.cpp delete mode 100644 .xo-type/src/type/IGCObject_DAtomicType.cpp delete mode 100644 .xo-type/src/type/IGCObject_DFunctionType.cpp delete mode 100644 .xo-type/src/type/IGCObject_DListType.cpp delete mode 100644 .xo-type/src/type/IGCObject_DTypeVar.cpp delete mode 100644 .xo-type/src/type/IGCObject_DTypeVarRef.cpp delete mode 100644 .xo-type/src/type/IType_Any.cpp delete mode 100644 .xo-type/src/type/IType_DArrayType.cpp delete mode 100644 .xo-type/src/type/IType_DAtomicType.cpp delete mode 100644 .xo-type/src/type/IType_DFunctionType.cpp delete mode 100644 .xo-type/src/type/IType_DListType.cpp delete mode 100644 .xo-type/src/type/IType_DTypeVar.cpp delete mode 100644 .xo-type/src/type/IType_DTypeVarRef.cpp delete mode 100644 .xo-type/src/type/Metatype.cpp delete mode 100644 .xo-type/src/type/SetupType.cpp delete mode 100644 .xo-type/src/type/TypeOps.cpp delete mode 100644 .xo-type/src/type/init_type.cpp delete mode 100644 .xo-type/utest/CMakeLists.txt delete mode 100644 .xo-type/utest/DArrayType.test.cpp delete mode 100644 .xo-type/utest/DAtomicType.test.cpp delete mode 100644 .xo-type/utest/DListType.test.cpp delete mode 100644 .xo-type/utest/type_utest_main.cpp diff --git a/.xo-type/CMakeLists.txt b/.xo-type/CMakeLists.txt deleted file mode 100644 index f8d68c50..00000000 --- a/.xo-type/CMakeLists.txt +++ /dev/null @@ -1,130 +0,0 @@ -# xo-type/CMakeLists.txt - -cmake_minimum_required(VERSION 3.10) - -project(xo_type VERSION 1.0) -enable_language(CXX) - -include(GNUInstallDirs) -include(cmake/xo-bootstrap-macros.cmake) - -xo_cxx_toplevel_options3() - -# ---------------------------------------------------------------- -# c++ settings - -# one-time project-specific c++ flags. usually empty -set(PROJECT_CXX_FLAGS "") -add_definitions(${PROJECT_CXX_FLAGS}) - -# ---------------------------------------------------------------- -# facet code generation - -xo_add_genfacet( - TARGET xo-type-facet-type - FACET Type - INPUT idl/Type.json5 - OUTPUT_HPP_DIR include/xo/type - OUTPUT_IMPL_SUBDIR type -) - -# ---------------------------------------------------------------- - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-type-atomictype - FACET_PKG xo_type - INPUT idl/IType_DAtomicType.json5 -) - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-gcobject-atomictype - FACET_PKG xo_alloc2 - INPUT idl/IGCObject_DAtomicType.json5 -) - -# ---------------------------------------------------------------- - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-type-listtype - FACET_PKG xo_type - INPUT idl/IType_DListType.json5 -) - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-gcobject-listtype - FACET_PKG xo_alloc2 - INPUT idl/IGCObject_DListType.json5 -) - -# ---------------------------------------------------------------- - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-type-arraytype - FACET_PKG xo_type - INPUT idl/IType_DArrayType.json5 -) - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-gcobject-arraytype - FACET_PKG xo_alloc2 - INPUT idl/IGCObject_DArrayType.json5 -) - -# ---------------------------------------------------------------- - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-type-functiontype - FACET_PKG xo_type - INPUT idl/IType_DFunctionType.json5 -) - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-gcobject-functiontype - FACET_PKG xo_alloc2 - INPUT idl/IGCObject_DFunctionType.json5 -) - -# ---------------------------------------------------------------- - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-type-typevarref - FACET_PKG xo_type - INPUT idl/IType_DTypeVarRef.json5 -) - -# note: manual target; generated code committed to git -xo_add_genfacetimpl( - TARGET xo-type-facetimpl-gcobject-typevarref - FACET_PKG xo_alloc2 - INPUT idl/IGCObject_DTypeVarRef.json5 -) - -# ---------------------------------------------------------------- - -xo_add_genfacet_all(xo-type-genfacet-all) - -install(DIRECTORY idl/ - DESTINATION share/${PROJECT_NAME}/idl - FILES_MATCHING PATTERN "*.json5") - -# ---------------------------------------------------------------- -# output targets - -add_subdirectory(src/type) -add_subdirectory(utest) - -# ---------------------------------------------------------------- -# cmake export - -xo_export_cmake_config(${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_NAME}Targets) - -# end CMakeLists.txt diff --git a/.xo-type/cmake/xo-bootstrap-macros.cmake b/.xo-type/cmake/xo-bootstrap-macros.cmake deleted file mode 100644 index 592272c0..00000000 --- a/.xo-type/cmake/xo-bootstrap-macros.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# ---------------------------------------------------------------- -# for example: -# $ PREFIX=/usr/local # for example -# $ cmake -DCMAKE_MODULE_PATH=prefix -DCMAKE_INSTALL_PREFIX=$PREFIX -B .build -# -# will get -# CMAKE_MODULE_PATH -# from xo-cmake-config --cmake-module-path -# -# and expect .cmake macros in -# CMAKE_MODULE_PATH/xo_macros/xo_cxx.cmake -# ---------------------------------------------------------------- - -find_program(XO_CMAKE_CONFIG_EXECUTABLE NAMES xo-cmake-config REQUIRED) - -if ("${XO_CMAKE_CONFIG_EXECUTABLE}" STREQUAL "XO_CMAKE_CONFIG_EXECUTABLE-NOT_FOUND") - message(FATAL "could not find xo-cmake-config executable") -endif() - -message(STATUS "XO_CMAKE_CONFIG_EXECUTABLE=${XO_CMAKE_CONFIG_EXECUTABLE}") - -if (XO_SUBMODULE_BUILD) - if (("${CMAKE_MODULE_PATH}" STREQUAL "") OR ("${CMAKE_MODULE_PATH}" STREQUAL prefix)) - # local version of xo-cmake macros - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/xo-cmake/cmake") - message(STATUS "CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}") - endif() -else() - if (("${CMAKE_MODULE_PATH}" STREQUAL "") OR ("${CMAKE_MODULE_PATH}" STREQUAL prefix)) - # default to typical install location for xo-project-macros - execute_process(COMMAND ${XO_CMAKE_CONFIG_EXECUTABLE} --cmake-module-path OUTPUT_VARIABLE CMAKE_MODULE_PATH) - message(STATUS "CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}") - endif() -endif() - -# needs to have been installed somewhere on CMAKE_MODULE_PATH, -# (e.g. from xo-cmake with the same value for CMAKE_INSTALL_PREFIX) -# -include(xo_macros/xo_cxx) - -xo_cxx_bootstrap_message() diff --git a/.xo-type/cmake/xo_typeConfig.cmake.in b/.xo-type/cmake/xo_typeConfig.cmake.in deleted file mode 100644 index e6940650..00000000 --- a/.xo-type/cmake/xo_typeConfig.cmake.in +++ /dev/null @@ -1,18 +0,0 @@ -@PACKAGE_INIT@ - -include(CMakeFindDependencyMacro) -find_dependency(xo_object2) -find_dependency(reflect) -find_dependency(xo_alloc2) -find_dependency(xo_facet) -find_dependency(subsys) - -# note: changes to find_dependency() calls here -# must coordinate with xo_dependency() calls -# in src/type/CMakeLists.txt -# -#find_dependency(xo_indentlog) - -include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Share.cmake") -check_required_components("@PROJECT_NAME@") diff --git a/.xo-type/idl/IGCObject_DArrayType.json5 b/.xo-type/idl/IGCObject_DArrayType.json5 deleted file mode 100644 index 77e59249..00000000 --- a/.xo-type/idl/IGCObject_DArrayType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "array", - includes: [ - ], - local_types: [ ], - namespace1: "xo", - namespace2: "scm", - facet_idl: "idl/GCObject.json5", - brief: "provide AGCObject interface for DArrayType", - using_doxygen: true, - repr: "DArrayType", - doc: [ "implement AGCObject for DArrayType" ], -} diff --git a/.xo-type/idl/IGCObject_DAtomicType.json5 b/.xo-type/idl/IGCObject_DAtomicType.json5 deleted file mode 100644 index 4cb85c1b..00000000 --- a/.xo-type/idl/IGCObject_DAtomicType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "atomic", - includes: [ - ], - local_types: [ ], - namespace1: "xo", - namespace2: "scm", - facet_idl: "idl/GCObject.json5", - brief: "provide AGCObject interface for DAtomicType", - using_doxygen: true, - repr: "DAtomicType", - doc: [ "implement AGCObject for DAtomicType" ], -} diff --git a/.xo-type/idl/IGCObject_DFunctionType.json5 b/.xo-type/idl/IGCObject_DFunctionType.json5 deleted file mode 100644 index af1f3c9b..00000000 --- a/.xo-type/idl/IGCObject_DFunctionType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "function", - includes: [ - ], - local_types: [ ], - namespace1: "xo", - namespace2: "scm", - facet_idl: "idl/GCObject.json5", - brief: "provide AGCObject interface for DFunctionType", - using_doxygen: true, - repr: "DFunctionType", - doc: [ "implement AGCObject for DFunctionType" ], -} diff --git a/.xo-type/idl/IGCObject_DListType.json5 b/.xo-type/idl/IGCObject_DListType.json5 deleted file mode 100644 index 1f4c00ea..00000000 --- a/.xo-type/idl/IGCObject_DListType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "list", - includes: [ - ], - local_types: [ ], - namespace1: "xo", - namespace2: "scm", - facet_idl: "idl/GCObject.json5", - brief: "provide AGCObject interface for DListType", - using_doxygen: true, - repr: "DListType", - doc: [ "implement AGCObject for DListType" ], -} diff --git a/.xo-type/idl/IGCObject_DTypeVar.json5 b/.xo-type/idl/IGCObject_DTypeVar.json5 deleted file mode 100644 index 7e45e223..00000000 --- a/.xo-type/idl/IGCObject_DTypeVar.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "typevar", - includes: [ - ], - local_types: [ ], - namespace1: "xo", - namespace2: "scm", - facet_idl: "idl/GCObject.json5", - brief: "provide AGCObject interface for DTypeVar", - using_doxygen: true, - repr: "DTypeVar", - doc: [ "implement AGCObject for DTypeVar" ], -} diff --git a/.xo-type/idl/IGCObject_DTypeVarRef.json5 b/.xo-type/idl/IGCObject_DTypeVarRef.json5 deleted file mode 100644 index e75802b5..00000000 --- a/.xo-type/idl/IGCObject_DTypeVarRef.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "typevar", - includes: [ - ], - local_types: [ ], - namespace1: "xo", - namespace2: "scm", - facet_idl: "idl/GCObject.json5", - brief: "provide AGCObject interface for DTypeVarRef", - using_doxygen: true, - repr: "DTypeVarRef", - doc: [ "implement AGCObject for DTypeVarRef" ], -} diff --git a/.xo-type/idl/IType_DArrayType.json5 b/.xo-type/idl/IType_DArrayType.json5 deleted file mode 100644 index b84ab477..00000000 --- a/.xo-type/idl/IType_DArrayType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "array", - includes: [], - local_types: [], - namespace1: "xo", - namespace2: "scm", - - facet_idl: "idl/Type.json5", - brief: "provide AType interface for DArrayType", - using_doxygen: true, - repr: "DArrayType", - doc: [ "implement AType for DArrayType" ], -} diff --git a/.xo-type/idl/IType_DAtomicType.json5 b/.xo-type/idl/IType_DAtomicType.json5 deleted file mode 100644 index c94c8923..00000000 --- a/.xo-type/idl/IType_DAtomicType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "atomic", - includes: [], - local_types: [], - namespace1: "xo", - namespace2: "scm", - - facet_idl: "idl/Type.json5", - brief: "provide AType interface for DAtomicType", - using_doxygen: true, - repr: "DAtomicType", - doc: [ "implement AType for DAtomicType" ], -} diff --git a/.xo-type/idl/IType_DFunctionType.json5 b/.xo-type/idl/IType_DFunctionType.json5 deleted file mode 100644 index 99dd82bc..00000000 --- a/.xo-type/idl/IType_DFunctionType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "function", - includes: [], - local_types: [], - namespace1: "xo", - namespace2: "scm", - - facet_idl: "idl/Type.json5", - brief: "provide AType interface for DFunctionType", - using_doxygen: true, - repr: "DFunctionType", - doc: [ "implement AType for DFunctionType" ], -} diff --git a/.xo-type/idl/IType_DListType.json5 b/.xo-type/idl/IType_DListType.json5 deleted file mode 100644 index 0cd59785..00000000 --- a/.xo-type/idl/IType_DListType.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "list", - includes: [], - local_types: [], - namespace1: "xo", - namespace2: "scm", - - facet_idl: "idl/Type.json5", - brief: "provide AType interface for DListType", - using_doxygen: true, - repr: "DListType", - doc: [ "implement AType for DListType" ], -} diff --git a/.xo-type/idl/IType_DTypeVarRef.json5 b/.xo-type/idl/IType_DTypeVarRef.json5 deleted file mode 100644 index 245b597c..00000000 --- a/.xo-type/idl/IType_DTypeVarRef.json5 +++ /dev/null @@ -1,16 +0,0 @@ -{ - mode: "implementation", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "typevar", - includes: [], - local_types: [], - namespace1: "xo", - namespace2: "scm", - - facet_idl: "idl/Type.json5", - brief: "provide AType interface for DTypeVarRef", - using_doxygen: true, - repr: "DTypeVarRef", - doc: [ "implement AType for DTypeVarRef" ], -} diff --git a/.xo-type/idl/Type.json5 b/.xo-type/idl/Type.json5 deleted file mode 100644 index 06fa2dce..00000000 --- a/.xo-type/idl/Type.json5 +++ /dev/null @@ -1,76 +0,0 @@ -{ - mode: "facet", - output_cpp_dir: "src/type", - output_hpp_dir: "include/xo/type", - output_impl_subdir: "type", - includes: [ - "", - "", - ], - user_hpp_includes: [ - ], - namespace1: "xo", - namespace2: "scm", // TODO: change to project namespace if different - pretext: [ - "// pretext if any" - ], - facet: "Type", - detail_subdir: "type", - brief: "Representation for a Schematika type", - using_doxygen: true, - doc: [ - "1. Ability to compare types as members of partial order", - "2. ..." - ], - types: [ - { - name: "obj_AType", - doc: [], - definition: "xo::facet::obj", - }, - { - name: "TypeDescr", - doc: [], - definition: "xo::reflect::TypeDescr", - } - ], - const_methods: [ - { - name: "metatype", - doc: ["category for this type"], - return_type: "Metatype", - args: [], - const: true, - noexcept: true, - }, - { - name: "repr_td", - doc: ["reflected representation for instances of this type"], - return_type: "TypeDescr", - args: [], - const: true, - noexcept: true, - }, - { - name: "is_equal_to", - doc: ["true iff this type is equal to y"], - return_type: "bool", - args: [ - {type: "const obj_AType &", name: "y"}, - ], - const: true, - }, - { - name: "is_subtype_of", - doc: ["true iff this is a subtype of y"], - return_type: "bool", - args: [ - {type: "const obj_AType &", name: "y"}, - ], - const: true, - }, - ], - nonconst_methods: [], - router_facet_explicit_content: [ - ], -} diff --git a/.xo-type/include/xo/type/ArrayType.hpp b/.xo-type/include/xo/type/ArrayType.hpp deleted file mode 100644 index f0c5aa7a..00000000 --- a/.xo-type/include/xo/type/ArrayType.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/** @file ArrayType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "DArrayType.hpp" -#include "array/IType_DArrayType.hpp" -#include "array/IGCObject_DArrayType.hpp" - -/* end ArrayType.hpp */ diff --git a/.xo-type/include/xo/type/AtomicType.hpp b/.xo-type/include/xo/type/AtomicType.hpp deleted file mode 100644 index e5515291..00000000 --- a/.xo-type/include/xo/type/AtomicType.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/** @file AtomicType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "DAtomicType.hpp" -#include "atomic/IType_DAtomicType.hpp" -#include "atomic/IGCObject_DAtomicType.hpp" - -/* end AtomicType.hpp */ diff --git a/.xo-type/include/xo/type/DArrayType.hpp b/.xo-type/include/xo/type/DArrayType.hpp deleted file mode 100644 index 9ded76db..00000000 --- a/.xo-type/include/xo/type/DArrayType.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/** @file DArrayType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "Type.hpp" -#include "Metatype.hpp" -#include -#include - -namespace xo { - namespace scm { - /** @brief A parameterized array type: array(T) - * - * Represents a fixed-size homogeneous collection. - **/ - class DArrayType { - public: - using AGCObjectVisitor = xo::mm::AGCObjectVisitor; - using VisitReason = xo::mm::VisitReason; - using AAllocator = xo::mm::AAllocator; - using TypeDescr = xo::reflect::TypeDescr; - - public: - /** @defgroup xo-scm-arraytype-ctors **/ - ///@{ - - explicit DArrayType(obj elt); - - /** create instance using memory from @p mm with element type @p elt_type **/ - static DArrayType * _make(obj mm, obj elt_type); - - ///@} - /** @defgroup xo-scm-arraytype-type-facet **/ - ///@{ - Metatype metatype() const noexcept { return Metatype::t_array(); } - TypeDescr repr_td() const noexcept; - bool is_equal_to(const obj & y) const noexcept; - bool is_subtype_of(const obj & y) const noexcept; - ///@} - /** @defgroup xo-scm-arraytype-gcobject-facet **/ - ///@{ - DArrayType * gco_shallow_move(obj gc) noexcept; - void visit_gco_children(VisitReason reason, obj gc) noexcept; - ///@} - - private: - /** @defgroup xo-scm-arraytype-member-vars **/ - ///@{ - - /** all array elements satisfy @ref elt_type_ **/ - obj elt_type_; - - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DArrayType.hpp */ diff --git a/.xo-type/include/xo/type/DAtomicType.hpp b/.xo-type/include/xo/type/DAtomicType.hpp deleted file mode 100644 index 8dfaaaa3..00000000 --- a/.xo-type/include/xo/type/DAtomicType.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/** @file DAtomicType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "Type.hpp" -#include "Metatype.hpp" -#include -#include - -namespace xo { - namespace scm { - /** @brief An atomic schematika type - * - * Types that are not parameterized by types or values. - * For example - * unit, bool, i64, f64 - * are atomic in this sense. - **/ - class DAtomicType { - public: - using AGCObjectVisitor = xo::mm::AGCObjectVisitor; - using VisitReason = xo::mm::VisitReason; - using AAllocator = xo::mm::AAllocator; - using TypeDescr = xo::reflect::TypeDescr; - - public: - explicit DAtomicType(Metatype m) : metatype_{m} {} - - /** create instance using memory from @p mm with metatype @p mtype **/ - static DAtomicType * _make(obj mm, Metatype mtype); - /** create instance **/ - static obj make(obj mm, Metatype mtype); - - /** @defgroup xo-scm-atomictype-type-facet **/ - ///@{ - Metatype metatype() const noexcept { return metatype_; } - TypeDescr repr_td() const noexcept; - bool is_equal_to(const obj & y) const noexcept; - bool is_subtype_of(const obj & y) const noexcept; - ///@} - /** @defgroup xo-scm-atomictype-gcobject-facet **/ - ///@{ - DAtomicType * gco_shallow_move(obj gc) noexcept; - void visit_gco_children(VisitReason reason, obj gc) noexcept; - ///@} - - private: - Metatype metatype_; - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DAtomicType.hpp */ diff --git a/.xo-type/include/xo/type/DFunctionType.hpp b/.xo-type/include/xo/type/DFunctionType.hpp deleted file mode 100644 index 496924b5..00000000 --- a/.xo-type/include/xo/type/DFunctionType.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/** @file DFunctionType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "Type.hpp" -#include "Metatype.hpp" -#include -#include -#include - -namespace xo { - namespace scm { - /** @brief A parameterized array type: array(T) - * - * Represents a fixed-size homogeneous collection. - **/ - class DFunctionType { - public: - using AGCObject = xo::mm::AGCObject; - using AGCObjectVisitor = xo::mm::AGCObjectVisitor; - using VisitReason = xo::mm::VisitReason; - using AAllocator = xo::mm::AAllocator; - using TypeDescr = xo::reflect::TypeDescr; - - public: - /** @defgroup xo-scm-arraytype-ctors **/ - ///@{ - - /** create instance using memory from @p mm, - * for a function with return type @p ret_type and arguments @p args - **/ - template - requires (std::convertible_to> && ...) - explicit DFunctionType(obj mm, obj ret_type, Args... args); - - /** create instance using memory from @p mm, - * for a function with return type @p ret_type and arguments @p args - **/ - template - requires (std::convertible_to> && ...) - static DFunctionType * _make(obj mm, - obj ret_type, Args... args); - -#ifdef NOT_USING - /** create instance using memory from @p mm - * for function with return type @p ret_type and arguments @p args - **/ - template - requires (std::same_as> && ...) - static obj make(obj mm, - obj ret_type, Args... args); -#endif - - ///@} - /** @defgroup xo-scm-arraytype-type-facet **/ - ///@{ - Metatype metatype() const noexcept { return Metatype::t_array(); } - TypeDescr repr_td() const noexcept; - bool is_equal_to(obj y) const noexcept; - bool is_subtype_of(const obj & y) const noexcept; - ///@} - /** @defgroup xo-scm-arraytype-gcobject-facet **/ - ///@{ - DFunctionType * gco_shallow_move(obj gc) noexcept; - void visit_gco_children(VisitReason reason, obj gc) noexcept; - ///@} - - private: - /** @defgroup xo-scm-arraytype-member-vars **/ - ///@{ - - /** function return type **/ - obj return_type_; - - /** argument types **/ - DArray * arg_types_ = nullptr; - - ///@} - }; - - template - requires (std::convertible_to> && ...) - DFunctionType::DFunctionType(obj mm, obj return_type, Args... args) - : return_type_{return_type}, - arg_types_{DArray::array(mm, args.template to_facet()...)} - {} - - template - requires (std::convertible_to> && ...) - DFunctionType * - DFunctionType::_make(obj mm, obj ret_type, Args... args) - { - void * mem = mm.alloc_for(); - - return new (mem) DFunctionType(mm, ret_type, args...); - } - -#ifdef NOT_USING - template - requires (std::same_as> && ...) - obj - DFunctionType::make(obj mm, obj ret_type, Args... args) - { - void * mem = mm.alloc_for(); - - return obj(_make(mm, ret_type, args...)); - } -#endif - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DFunctionType.hpp */ diff --git a/.xo-type/include/xo/type/DListType.hpp b/.xo-type/include/xo/type/DListType.hpp deleted file mode 100644 index a34af57d..00000000 --- a/.xo-type/include/xo/type/DListType.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/** @file DListType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "Type.hpp" -#include "Metatype.hpp" -#include -#include -#include - -namespace xo { - namespace scm { - /** @brief An atomic schematika type - * - * Types that are not parameterized by types or values. - * For example - * unit, bool, i64, f64 - * are atomic in this sense. - **/ - class DListType { - public: - using TypeDescr = xo::reflect::TypeDescr; - using AGCObjectVisitor = xo::mm::AGCObjectVisitor; - using VisitReason = xo::mm::VisitReason; - using AAllocator = xo::mm::AAllocator; - - public: - /** @defgroup xo-scm-listtype-ctors **/ - ///@{ - - explicit DListType(obj elt); - - /** create instance using memory from @p mm with element type @p elt_type **/ - static DListType * _make(obj mm, - obj elt_type); - /** create fop to new instance using memory from @p mm with element type @p elt_type **/ - static obj make(obj mm, - obj elt_type); - - ///@} - /** @defgroup xo-scm-listtype-type-facet **/ - ///@{ - Metatype metatype() const noexcept { return Metatype::t_list(); } - TypeDescr repr_td() const noexcept; - bool is_equal_to(const obj & y) const noexcept; - bool is_subtype_of(const obj & y) const noexcept; - ///@} - /** @defgroup xo-scm-listtype-gcobject-facet **/ - ///@{ - DListType * gco_shallow_move(obj gc) noexcept; - void visit_gco_children(VisitReason reason, obj gc) noexcept; - ///@} - - private: - /** @defgroup xo-scm-listtype-member-vars **/ - ///@{ - - /** all list elements satisfy @ref elt_type_ **/ - obj elt_type_; - - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DListType.hpp */ diff --git a/.xo-type/include/xo/type/FunctionType.hpp b/.xo-type/include/xo/type/FunctionType.hpp deleted file mode 100644 index 28cdc11f..00000000 --- a/.xo-type/include/xo/type/FunctionType.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/** @file FunctionType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "DFunctionType.hpp" -#include "function/IType_DFunctionType.hpp" -#include "function/IGCObject_DFunctionType.hpp" - -/* end FunctionType.hpp */ diff --git a/.xo-type/include/xo/type/ListType.hpp b/.xo-type/include/xo/type/ListType.hpp deleted file mode 100644 index 3b573792..00000000 --- a/.xo-type/include/xo/type/ListType.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/** @file ListType.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "DListType.hpp" -#include "list/IType_DListType.hpp" -#include "list/IGCObject_DListType.hpp" - -/* end ListType.hpp */ diff --git a/.xo-type/include/xo/type/Metatype.hpp b/.xo-type/include/xo/type/Metatype.hpp deleted file mode 100644 index 9ff612aa..00000000 --- a/.xo-type/include/xo/type/Metatype.hpp +++ /dev/null @@ -1,120 +0,0 @@ -/** @file Metatype.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include - -namespace xo { - namespace scm { - class Metatype { - public: - enum class code { - /* void */ - t_unit, - t_bool, - t_str, - - /* int16_t */ - t_i16, - /* int32_t */ - t_i32, - /* int64_t */ - t_i64, - - /* float */ - t_f32, - /* double */ - t_f64, - - /* discriminated union */ - t_sum, - /* list */ - t_list, - /* array */ - t_array, - /* function */ - t_function, - /* struct */ - t_struct, - /* dicttionary: like struct, but w/ dynamic key/value pairs */ - t_dict, - - /** any integer type: i16|i32|i64 **/ - t_integer, - - /** any numeric type: i16|i32|i64|f32|f64 **/ - t_numeric, - - /** generalized boolean type: bool, function with bool codomain **/ - t_booleic, - - /** any callable type (e.g. all function types) **/ - t_callable, - - /* any type at all */ - t_any, - }; - - public: - explicit Metatype(code x) : code_{x} {} - - static Metatype t_unit() { return Metatype(code::t_unit); } - static Metatype t_bool() { return Metatype(code::t_bool); } - static Metatype t_str() { return Metatype(code::t_str); } - - static Metatype t_i16() { return Metatype(code::t_i16); } - static Metatype t_i32() { return Metatype(code::t_i32); } - static Metatype t_i64() { return Metatype(code::t_i64); } - - static Metatype t_f32() { return Metatype(code::t_f32); } - static Metatype t_f64() { return Metatype(code::t_f64); } - - static Metatype t_sum() { return Metatype(code::t_sum); } - static Metatype t_list() { return Metatype(code::t_list); } - static Metatype t_array() { return Metatype(code::t_array); } - static Metatype t_function() { return Metatype(code::t_function); } - static Metatype t_struct() { return Metatype(code::t_struct); } - - static Metatype t_dict() { return Metatype(code::t_dict); } - static Metatype t_integer() { return Metatype(code::t_integer); } - static Metatype t_numeric() { return Metatype(code::t_numeric); } - static Metatype t_booleic() { return Metatype(code::t_booleic); } - static Metatype t_callable() { return Metatype(code::t_callable); } - static Metatype t_any() { return Metatype(code::t_any); } - - /** description string for this type category **/ - const char * _descr() const noexcept; - - code code() const noexcept { return code_; } - - /** true iff this metatype is non-parametric: - * i.e. stands for a single type - **/ - bool is_atomic() const noexcept; - - private: - enum code code_; - }; - - inline bool - operator==(Metatype x, Metatype y) { - return (x.code() == y.code()); - } - - inline bool - operator!=(Metatype x, Metatype y) { - return (x.code() != y.code()); - } - - inline std::ostream & - operator<<(std::ostream & os, Metatype x) { - os << x._descr(); - return os; - } - } /*namespace scm*/ -} /*namespace xo*/ - -/* end Metatype.hpp */ diff --git a/.xo-type/include/xo/type/SetupType.hpp b/.xo-type/include/xo/type/SetupType.hpp deleted file mode 100644 index 93304907..00000000 --- a/.xo-type/include/xo/type/SetupType.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/** @file SetupType.hpp - * - * @author Roland Conybeare, Jan 2026 - **/ - -#pragma once - -#include - -namespace xo { - namespace scm { - struct SetupType { - public: - using ACollector = xo::mm::ACollector; - - public: - /** Register type (facet,impl) combinations with FacetRegistry **/ - static bool register_facets(); - /** Register type (facet,impl) combinations with FacetRegistry **/ - static bool register_types(obj gc); - }; - } -} - -/* end SetupType.hpp */ diff --git a/.xo-type/include/xo/type/Type.hpp b/.xo-type/include/xo/type/Type.hpp deleted file mode 100644 index 97da0453..00000000 --- a/.xo-type/include/xo/type/Type.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/** @file Type.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/Type.json5] - * 2. jinja2 template for facet .hpp file: - * [facet.hpp.j2] - * 3. idl for facet methods - * [idl/Type.json5] - **/ - -#pragma once - -#include "type/AType.hpp" -#include "type/IType_Any.hpp" -#include "type/IType_Xfer.hpp" -#include "type/RType.hpp" - - -/* end Type.hpp */ diff --git a/.xo-type/include/xo/type/TypeOps.hpp b/.xo-type/include/xo/type/TypeOps.hpp deleted file mode 100644 index 8877ae8d..00000000 --- a/.xo-type/include/xo/type/TypeOps.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/** @file TypeOps.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "AtomicType.hpp" -#include "ListType.hpp" -#include "ArrayType.hpp" -#include - -namespace xo { - namespace scm { - class TypeOps { - public: - using AAllocator = xo::mm::AAllocator; - - template - static obj atomic_type(obj mm, Metatype metatype) { - assert(metatype.is_atomic()); - return obj(DAtomicType::_make(mm, metatype)); - } - - template - static obj list_type(obj mm, obj elt_type) { - return obj(DListType::_make(mm, elt_type)); - } - - template - static obj array_type(obj mm, obj elt_type) { - return obj(DArrayType::_make(mm, elt_type)); - } - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end TypeOps.hpp */ diff --git a/.xo-type/include/xo/type/TypeVarRef.hpp b/.xo-type/include/xo/type/TypeVarRef.hpp deleted file mode 100644 index 10b80b18..00000000 --- a/.xo-type/include/xo/type/TypeVarRef.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/** @file TypeVarRef.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "typevar/DTypeVarRef.hpp" -#include "typevar/IGCObject_DTypeVarRef.hpp" -#include "typevar/IType_DTypeVarRef.hpp" - -/* end TypeVarRef.hpp */ diff --git a/.xo-type/include/xo/type/array/IGCObject_DArrayType.hpp b/.xo-type/include/xo/type/array/IGCObject_DArrayType.hpp deleted file mode 100644 index 067608e2..00000000 --- a/.xo-type/include/xo/type/array/IGCObject_DArrayType.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/** @file IGCObject_DArrayType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DArrayType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DArrayType.json5] - **/ - -#pragma once - -#include "GCObject.hpp" -#include "DArrayType.hpp" - -namespace xo { namespace scm { class IGCObject_DArrayType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::mm::IGCObject_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IGCObject_DArrayType - **/ - class IGCObject_DArrayType { - public: - /** @defgroup scm-gcobject-darraytype-type-traits **/ - ///@{ - using size_type = xo::mm::AGCObject::size_type; - using AAllocator = xo::mm::AGCObject::AAllocator; - using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; - using VisitReason = xo::mm::AGCObject::VisitReason; - using Copaque = xo::mm::AGCObject::Copaque; - using Opaque = xo::mm::AGCObject::Opaque; - ///@} - /** @defgroup scm-gcobject-darraytype-methods **/ - ///@{ - // const methods - - // non-const methods - /** move instance using object visitor. -Arguably abusing the word 'visitor' here **/ - static Opaque gco_shallow_move(DArrayType & self, obj gc) noexcept; - /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. -Context: provides address of data pointer so it can be updated in place -when @p fn invokes garbage collector reentry point **/ - static void visit_gco_children(DArrayType & self, VisitReason reason, obj fn) noexcept; - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/array/IType_DArrayType.hpp b/.xo-type/include/xo/type/array/IType_DArrayType.hpp deleted file mode 100644 index afeb63f7..00000000 --- a/.xo-type/include/xo/type/array/IType_DArrayType.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/** @file IType_DArrayType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DArrayType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DArrayType.json5] - **/ - -#pragma once - -#include "Type.hpp" -#include "DArrayType.hpp" - -namespace xo { namespace scm { class IType_DArrayType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::scm::IType_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IType_DArrayType - **/ - class IType_DArrayType { - public: - /** @defgroup scm-type-darraytype-type-traits **/ - ///@{ - using obj_AType = xo::scm::AType::obj_AType; - using TypeDescr = xo::scm::AType::TypeDescr; - using Copaque = xo::scm::AType::Copaque; - using Opaque = xo::scm::AType::Opaque; - ///@} - /** @defgroup scm-type-darraytype-methods **/ - ///@{ - // const methods - /** category for this type **/ - static Metatype metatype(const DArrayType & self) noexcept; - /** reflected representation for instances of this type **/ - static TypeDescr repr_td(const DArrayType & self) noexcept; - /** true iff this type is equal to y **/ - static bool is_equal_to(const DArrayType & self, const obj_AType & y); - /** true iff this is a subtype of y **/ - static bool is_subtype_of(const DArrayType & self, const obj_AType & y); - - // non-const methods - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/atomic/IGCObject_DAtomicType.hpp b/.xo-type/include/xo/type/atomic/IGCObject_DAtomicType.hpp deleted file mode 100644 index a4c7f1d6..00000000 --- a/.xo-type/include/xo/type/atomic/IGCObject_DAtomicType.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/** @file IGCObject_DAtomicType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DAtomicType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DAtomicType.json5] - **/ - -#pragma once - -#include "GCObject.hpp" -#include "DAtomicType.hpp" - -namespace xo { namespace scm { class IGCObject_DAtomicType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::mm::IGCObject_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IGCObject_DAtomicType - **/ - class IGCObject_DAtomicType { - public: - /** @defgroup scm-gcobject-datomictype-type-traits **/ - ///@{ - using size_type = xo::mm::AGCObject::size_type; - using AAllocator = xo::mm::AGCObject::AAllocator; - using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; - using VisitReason = xo::mm::AGCObject::VisitReason; - using Copaque = xo::mm::AGCObject::Copaque; - using Opaque = xo::mm::AGCObject::Opaque; - ///@} - /** @defgroup scm-gcobject-datomictype-methods **/ - ///@{ - // const methods - - // non-const methods - /** move instance using object visitor. -Arguably abusing the word 'visitor' here **/ - static Opaque gco_shallow_move(DAtomicType & self, obj gc) noexcept; - /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. -Context: provides address of data pointer so it can be updated in place -when @p fn invokes garbage collector reentry point **/ - static void visit_gco_children(DAtomicType & self, VisitReason reason, obj fn) noexcept; - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/atomic/IType_DAtomicType.hpp b/.xo-type/include/xo/type/atomic/IType_DAtomicType.hpp deleted file mode 100644 index 54210946..00000000 --- a/.xo-type/include/xo/type/atomic/IType_DAtomicType.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/** @file IType_DAtomicType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DAtomicType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DAtomicType.json5] - **/ - -#pragma once - -#include "Type.hpp" -#include "DAtomicType.hpp" - -namespace xo { namespace scm { class IType_DAtomicType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::scm::IType_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IType_DAtomicType - **/ - class IType_DAtomicType { - public: - /** @defgroup scm-type-datomictype-type-traits **/ - ///@{ - using obj_AType = xo::scm::AType::obj_AType; - using TypeDescr = xo::scm::AType::TypeDescr; - using Copaque = xo::scm::AType::Copaque; - using Opaque = xo::scm::AType::Opaque; - ///@} - /** @defgroup scm-type-datomictype-methods **/ - ///@{ - // const methods - /** category for this type **/ - static Metatype metatype(const DAtomicType & self) noexcept; - /** reflected representation for instances of this type **/ - static TypeDescr repr_td(const DAtomicType & self) noexcept; - /** true iff this type is equal to y **/ - static bool is_equal_to(const DAtomicType & self, const obj_AType & y); - /** true iff this is a subtype of y **/ - static bool is_subtype_of(const DAtomicType & self, const obj_AType & y); - - // non-const methods - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/function/IGCObject_DFunctionType.hpp b/.xo-type/include/xo/type/function/IGCObject_DFunctionType.hpp deleted file mode 100644 index 38d9f005..00000000 --- a/.xo-type/include/xo/type/function/IGCObject_DFunctionType.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/** @file IGCObject_DFunctionType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DFunctionType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DFunctionType.json5] - **/ - -#pragma once - -#include "GCObject.hpp" -#include "DFunctionType.hpp" - -namespace xo { namespace scm { class IGCObject_DFunctionType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::mm::IGCObject_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IGCObject_DFunctionType - **/ - class IGCObject_DFunctionType { - public: - /** @defgroup scm-gcobject-dfunctiontype-type-traits **/ - ///@{ - using size_type = xo::mm::AGCObject::size_type; - using AAllocator = xo::mm::AGCObject::AAllocator; - using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; - using VisitReason = xo::mm::AGCObject::VisitReason; - using Copaque = xo::mm::AGCObject::Copaque; - using Opaque = xo::mm::AGCObject::Opaque; - ///@} - /** @defgroup scm-gcobject-dfunctiontype-methods **/ - ///@{ - // const methods - - // non-const methods - /** move instance using object visitor. -Arguably abusing the word 'visitor' here **/ - static Opaque gco_shallow_move(DFunctionType & self, obj gc) noexcept; - /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. -Context: provides address of data pointer so it can be updated in place -when @p fn invokes garbage collector reentry point **/ - static void visit_gco_children(DFunctionType & self, VisitReason reason, obj fn) noexcept; - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/function/IType_DFunctionType.hpp b/.xo-type/include/xo/type/function/IType_DFunctionType.hpp deleted file mode 100644 index 3dba4572..00000000 --- a/.xo-type/include/xo/type/function/IType_DFunctionType.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/** @file IType_DFunctionType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DFunctionType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DFunctionType.json5] - **/ - -#pragma once - -#include "Type.hpp" -#include "DFunctionType.hpp" - -namespace xo { namespace scm { class IType_DFunctionType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::scm::IType_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IType_DFunctionType - **/ - class IType_DFunctionType { - public: - /** @defgroup scm-type-dfunctiontype-type-traits **/ - ///@{ - using obj_AType = xo::scm::AType::obj_AType; - using TypeDescr = xo::scm::AType::TypeDescr; - using Copaque = xo::scm::AType::Copaque; - using Opaque = xo::scm::AType::Opaque; - ///@} - /** @defgroup scm-type-dfunctiontype-methods **/ - ///@{ - // const methods - /** category for this type **/ - static Metatype metatype(const DFunctionType & self) noexcept; - /** reflected representation for instances of this type **/ - static TypeDescr repr_td(const DFunctionType & self) noexcept; - /** true iff this type is equal to y **/ - static bool is_equal_to(const DFunctionType & self, const obj_AType & y); - /** true iff this is a subtype of y **/ - static bool is_subtype_of(const DFunctionType & self, const obj_AType & y); - - // non-const methods - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/init_type.hpp b/.xo-type/include/xo/type/init_type.hpp deleted file mode 100644 index d06f33f8..00000000 --- a/.xo-type/include/xo/type/init_type.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/** @file init_type.hpp - * - * @author Roland Conybeare, Jan 2026 - **/ - -#pragma once - -#include - -namespace xo { - /* tag to represent the xo-expression2/ subsystem within ordered initialization */ - enum S_type_tag {}; - - template <> - struct InitSubsys { - static void init(); - static InitEvidence require(); - }; -} /*namespace xo*/ - -/* end init_type.hpp */ diff --git a/.xo-type/include/xo/type/list/IGCObject_DListType.hpp b/.xo-type/include/xo/type/list/IGCObject_DListType.hpp deleted file mode 100644 index 5d5c5fb8..00000000 --- a/.xo-type/include/xo/type/list/IGCObject_DListType.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/** @file IGCObject_DListType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DListType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DListType.json5] - **/ - -#pragma once - -#include "GCObject.hpp" -#include "DListType.hpp" - -namespace xo { namespace scm { class IGCObject_DListType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::mm::IGCObject_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IGCObject_DListType - **/ - class IGCObject_DListType { - public: - /** @defgroup scm-gcobject-dlisttype-type-traits **/ - ///@{ - using size_type = xo::mm::AGCObject::size_type; - using AAllocator = xo::mm::AGCObject::AAllocator; - using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; - using VisitReason = xo::mm::AGCObject::VisitReason; - using Copaque = xo::mm::AGCObject::Copaque; - using Opaque = xo::mm::AGCObject::Opaque; - ///@} - /** @defgroup scm-gcobject-dlisttype-methods **/ - ///@{ - // const methods - - // non-const methods - /** move instance using object visitor. -Arguably abusing the word 'visitor' here **/ - static Opaque gco_shallow_move(DListType & self, obj gc) noexcept; - /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. -Context: provides address of data pointer so it can be updated in place -when @p fn invokes garbage collector reentry point **/ - static void visit_gco_children(DListType & self, VisitReason reason, obj fn) noexcept; - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/list/IType_DListType.hpp b/.xo-type/include/xo/type/list/IType_DListType.hpp deleted file mode 100644 index 658348fe..00000000 --- a/.xo-type/include/xo/type/list/IType_DListType.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/** @file IType_DListType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DListType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DListType.json5] - **/ - -#pragma once - -#include "Type.hpp" -#include "DListType.hpp" - -namespace xo { namespace scm { class IType_DListType; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::scm::IType_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IType_DListType - **/ - class IType_DListType { - public: - /** @defgroup scm-type-dlisttype-type-traits **/ - ///@{ - using obj_AType = xo::scm::AType::obj_AType; - using TypeDescr = xo::scm::AType::TypeDescr; - using Copaque = xo::scm::AType::Copaque; - using Opaque = xo::scm::AType::Opaque; - ///@} - /** @defgroup scm-type-dlisttype-methods **/ - ///@{ - // const methods - /** category for this type **/ - static Metatype metatype(const DListType & self) noexcept; - /** reflected representation for instances of this type **/ - static TypeDescr repr_td(const DListType & self) noexcept; - /** true iff this type is equal to y **/ - static bool is_equal_to(const DListType & self, const obj_AType & y); - /** true iff this is a subtype of y **/ - static bool is_subtype_of(const DListType & self, const obj_AType & y); - - // non-const methods - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/type/AType.hpp b/.xo-type/include/xo/type/type/AType.hpp deleted file mode 100644 index 018c0f54..00000000 --- a/.xo-type/include/xo/type/type/AType.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/** @file AType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/Type.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [abstract_facet.hpp.j2] - * 3. idl for facet methods - * [idl/Type.json5] - **/ - -#pragma once - -// includes (via {facet_includes}) -#include -#include -#include -#include -#include - -// pretext if any - -namespace xo { -namespace scm { - -using Copaque = const void *; -using Opaque = void *; - -/** -1. Ability to compare types as members of partial order -2. ... -**/ -class AType { -public: - /** @defgroup scm-type-type-traits **/ - ///@{ - // types - /** integer identifying a type **/ - using typeseq = xo::facet::typeseq; - using Copaque = const void *; - using Opaque = void *; - /** **/ - using obj_AType = xo::facet::obj; - /** **/ - using TypeDescr = xo::reflect::TypeDescr; - ///@} - - /** @defgroup scm-type-methods **/ - ///@{ - // const methods - /** An uninitialized AType instance will have zero vtable pointer (per {linux,osx} abi). - * Use case for this is narrow. We go to some lengths to avoid null vtable pointers. For example - * obj will have non-null vtable (via IFacet_Any) with all methods terminating. - **/ - bool _has_null_vptr() const noexcept { return *reinterpret_cast(this) == nullptr; } - /** RTTI: unique id# for actual runtime data representation **/ - virtual typeseq _typeseq() const noexcept = 0; - /** destroy instance @p d; calls c++ dtor only for actual runtime type; does not recover memory **/ - virtual void _drop(Opaque d) const noexcept = 0; - /** category for this type **/ - virtual Metatype metatype(Copaque data) const noexcept = 0; - /** reflected representation for instances of this type **/ - virtual TypeDescr repr_td(Copaque data) const noexcept = 0; - /** true iff this type is equal to y **/ - virtual bool is_equal_to(Copaque data, const obj_AType & y) const = 0; - /** true iff this is a subtype of y **/ - virtual bool is_subtype_of(Copaque data, const obj_AType & y) const = 0; - - // nonconst methods - ///@} -}; /*AType*/ - -/** Implementation IType_DRepr of AType for state DRepr - * should provide a specialization: - * - * template <> - * struct xo::facet::FacetImplementation { - * using Impltype = IType_DRepr; - * }; - * - * then IType_ImplType --> IType_DRepr - **/ -template -using IType_ImplType = xo::facet::FacetImplType; - -} /*namespace scm*/ -} /*namespace xo*/ - -/* AType.hpp */ diff --git a/.xo-type/include/xo/type/type/IType_Any.hpp b/.xo-type/include/xo/type/type/IType_Any.hpp deleted file mode 100644 index 624db20a..00000000 --- a/.xo-type/include/xo/type/type/IType_Any.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/** @file IType_Any.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/Type.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/Type.json5] - **/ - -#pragma once - -#include "AType.hpp" -#include - -namespace xo { namespace scm { class IType_Any; } } - -namespace xo { -namespace facet { - -template <> -struct FacetImplementation -{ - using ImplType = xo::scm::IType_Any; -}; - -} -} - -namespace xo { -namespace scm { - - /** @class IType_Any - * @brief AType implementation for empty variant instance - **/ - class IType_Any : public AType { - public: - /** @defgroup scm-type-any-type-traits **/ - ///@{ - - /** integer identifying a type **/ - using typeseq = xo::facet::typeseq; - using obj_AType = AType::obj_AType; - using TypeDescr = AType::TypeDescr; - - ///@} - /** @defgroup scm-type-any-methods **/ - ///@{ - - const AType * iface() const { return std::launder(this); } - - // from AType - - // builtin methods - typeseq _typeseq() const noexcept override { return s_typeseq; } - [[noreturn]] void _drop(Opaque) const noexcept override { _fatal(); } - - // const methods - [[noreturn]] Metatype metatype(Copaque) const noexcept override { _fatal(); } - [[noreturn]] TypeDescr repr_td(Copaque) const noexcept override { _fatal(); } - [[noreturn]] bool is_equal_to(Copaque, const obj_AType &) const override { _fatal(); } - [[noreturn]] bool is_subtype_of(Copaque, const obj_AType &) const override { _fatal(); } - - // nonconst methods - - ///@} - - private: - /** @defgraoup scm-type-any-private-methods **/ - ///@{ - - [[noreturn]] static void _fatal(); - - ///@} - - public: - /** @defgroup scm-type-any-member-vars **/ - ///@{ - - static typeseq s_typeseq; - static bool _valid; - - ///@} - }; - -} /*namespace scm */ -} /*namespace xo */ - -/* IType_Any.hpp */ diff --git a/.xo-type/include/xo/type/type/IType_Xfer.hpp b/.xo-type/include/xo/type/type/IType_Xfer.hpp deleted file mode 100644 index 7e5ab5ea..00000000 --- a/.xo-type/include/xo/type/type/IType_Xfer.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/** @file IType_Xfer.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/Type.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/Type.json5] - * - * variables: - * {facet_hpp_fname} -> Type.hpp - * {impl_hpp_subdir} -> type - * {facet_ns1} -> xo - * {facet_detail_subdir} -> type - * {abstract_facet_fname} -> AType.hpp - **/ - -#pragma once - -#include "AType.hpp" -#include -#include - -namespace xo { -namespace scm { - /** @class IType_Xfer - **/ - template - class IType_Xfer : public AType { - public: - /** @defgroup scm-type-xfer-type-traits **/ - ///@{ - /** actual implementation (not generated; often delegates to DRepr) **/ - using Impl = IType_DRepr; - /** integer identifying a type **/ - using typeseq = AType::typeseq; - using obj_AType = AType::obj_AType; - using TypeDescr = AType::TypeDescr; - ///@} - - /** @defgroup scm-type-xfer-methods **/ - ///@{ - - static const DRepr & _dcast(Copaque d) { return *(const DRepr *)d; } - static DRepr & _dcast(Opaque d) { return *(DRepr *)d; } - - // from AType - - // builtin methods - typeseq _typeseq() const noexcept override { return s_typeseq; } - void _drop(Opaque d) const noexcept override { _dcast(d).~DRepr(); } - - // const methods - Metatype metatype(Copaque data) const noexcept override { - return I::metatype(_dcast(data)); - } - TypeDescr repr_td(Copaque data) const noexcept override { - return I::repr_td(_dcast(data)); - } - bool is_equal_to(Copaque data, const obj_AType & y) const override { - return I::is_equal_to(_dcast(data), y); - } - bool is_subtype_of(Copaque data, const obj_AType & y) const override { - return I::is_subtype_of(_dcast(data), y); - } - - // non-const methods - - ///@} - - private: - using I = Impl; - - public: - /** @defgroup scm-type-xfer-member-vars **/ - ///@{ - - /** typeseq for template parameter DRepr **/ - static typeseq s_typeseq; - /** true iff satisfies facet implementation **/ - static bool _valid; - - ///@} - }; - - template - xo::facet::typeseq - IType_Xfer::s_typeseq - = xo::facet::typeseq::id(); - - template - bool - IType_Xfer::_valid - = xo::facet::valid_facet_implementation(); - -} /*namespace scm */ -} /*namespace xo*/ - -/* end IType_Xfer.hpp */ diff --git a/.xo-type/include/xo/type/type/RType.hpp b/.xo-type/include/xo/type/type/RType.hpp deleted file mode 100644 index 648749bf..00000000 --- a/.xo-type/include/xo/type/type/RType.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/** @file RType.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/Type.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/Type.json5] - **/ - -#pragma once - -#include "AType.hpp" - -namespace xo { -namespace scm { - -/** @class RType - **/ -template -class RType : public Object { -private: - using O = Object; - -public: - /** @defgroup scm-type-router-type-traits **/ - ///@{ - using ObjectType = Object; - using DataPtr = Object::DataPtr; - using typeseq = xo::reflect::typeseq; - using obj_AType = AType::obj_AType; - using TypeDescr = AType::TypeDescr; - ///@} - - /** @defgroup scm-type-router-ctors **/ - ///@{ - RType() {} - RType(Object::DataPtr data) : Object{std::move(data)} {} - RType(const AType * iface, void * data) - requires std::is_same_v - : Object(iface, data) {} - - ///@} - /** @defgroup scm-type-router-methods **/ - ///@{ - - // explicit injected content - - // builtin methods - typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); } - void _drop() const noexcept { O::iface()->_drop(O::data()); } - - // const methods - Metatype metatype() const noexcept { - return O::iface()->metatype(O::data()); - } - TypeDescr repr_td() const noexcept { - return O::iface()->repr_td(O::data()); - } - bool is_equal_to(const obj_AType & y) const { - return O::iface()->is_equal_to(O::data(), y); - } - bool is_subtype_of(const obj_AType & y) const { - return O::iface()->is_subtype_of(O::data(), y); - } - - // non-const methods (still const in router!) - - ///@} - /** @defgroup scm-type-member-vars **/ - ///@{ - - static bool _valid; - - ///@} -}; - -template -bool -RType::_valid = xo::facet::valid_object_router(); - -} /*namespace scm*/ -} /*namespace xo*/ - -namespace xo { namespace facet { - template - struct RoutingFor { - using RoutingType = xo::scm::RType; - }; -} } - -/* end RType.hpp */ diff --git a/.xo-type/include/xo/type/typevar/DTypeVarRef.hpp b/.xo-type/include/xo/type/typevar/DTypeVarRef.hpp deleted file mode 100644 index 36a86a70..00000000 --- a/.xo-type/include/xo/type/typevar/DTypeVarRef.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/** @file DTypeVarRef.hpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#pragma once - -#include "Type.hpp" -#include "Metatype.hpp" -#include -#include - -namespace xo { - namespace scm { - /** @brief An atomic schematika type - * - * Types that are not parameterized by types or values. - * For example - * unit, bool, i64, f64 - * are atomic in this sense. - **/ - class DTypeVarRef { - public: - using AGCObjectVisitor = xo::mm::AGCObjectVisitor; - using VisitReason = xo::mm::VisitReason; - using AAllocator = xo::mm::AAllocator; - using TypeDescr = xo::reflect::TypeDescr; - - public: - /** @defgroup xo-scm-typevarref-ctors constructors **/ - ///@{ - - explicit DTypeVarRef(const DUniqueString * name) : name_{name} {} - - /** create instance using memory from @p mm with metatype @p mtype **/ - static DTypeVarRef * _make(obj mm, const DUniqueString * name); - /** create instance **/ - static obj make(obj mm, const DUniqueString * name); - - ///@} - /** @defgroup xo-scm-typevarref-general-methods general methods **/ - ///@{ - - const DUniqueString * name() const noexcept { return name_; } - - ///@} - /** @defgroup xo-scm-atomictype-type-facet **/ - ///@{ - Metatype metatype() const noexcept; - TypeDescr repr_td() const noexcept; - bool is_equal_to(const obj & y) const noexcept; - bool is_subtype_of(const obj & y) const noexcept; - ///@} - /** @defgroup xo-scm-atomictype-gcobject-facet **/ - ///@{ - DTypeVarRef * gco_shallow_move(obj gc) noexcept; - void visit_gco_children(VisitReason reason, obj gc) noexcept; - ///@} - - private: - /** unique type-variable name **/ - const DUniqueString * name_ = nullptr; - - /** resolved type (if/when established) **/ - obj type_; - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DTypeVarRef.hpp */ diff --git a/.xo-type/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp b/.xo-type/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp deleted file mode 100644 index 8b6b382b..00000000 --- a/.xo-type/include/xo/type/typevar/IGCObject_DTypeVarRef.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/** @file IGCObject_DTypeVarRef.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DTypeVarRef.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DTypeVarRef.json5] - **/ - -#pragma once - -#include "GCObject.hpp" -#include "DTypeVarRef.hpp" - -namespace xo { namespace scm { class IGCObject_DTypeVarRef; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::mm::IGCObject_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IGCObject_DTypeVarRef - **/ - class IGCObject_DTypeVarRef { - public: - /** @defgroup scm-gcobject-dtypevarref-type-traits **/ - ///@{ - using size_type = xo::mm::AGCObject::size_type; - using AAllocator = xo::mm::AGCObject::AAllocator; - using AGCObjectVisitor = xo::mm::AGCObject::AGCObjectVisitor; - using VisitReason = xo::mm::AGCObject::VisitReason; - using Copaque = xo::mm::AGCObject::Copaque; - using Opaque = xo::mm::AGCObject::Opaque; - ///@} - /** @defgroup scm-gcobject-dtypevarref-methods **/ - ///@{ - // const methods - - // non-const methods - /** move instance using object visitor. -Arguably abusing the word 'visitor' here **/ - static Opaque gco_shallow_move(DTypeVarRef & self, obj gc) noexcept; - /** Invoke fn.visit_child(iface,data) for each child GCObject pointer. -Context: provides address of data pointer so it can be updated in place -when @p fn invokes garbage collector reentry point **/ - static void visit_gco_children(DTypeVarRef & self, VisitReason reason, obj fn) noexcept; - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/include/xo/type/typevar/IType_DTypeVarRef.hpp b/.xo-type/include/xo/type/typevar/IType_DTypeVarRef.hpp deleted file mode 100644 index 5386a284..00000000 --- a/.xo-type/include/xo/type/typevar/IType_DTypeVarRef.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/** @file IType_DTypeVarRef.hpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DTypeVarRef.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_repr.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DTypeVarRef.json5] - **/ - -#pragma once - -#include "Type.hpp" -#include "DTypeVarRef.hpp" - -namespace xo { namespace scm { class IType_DTypeVarRef; } } - -namespace xo { - namespace facet { - template <> - struct FacetImplementation - { - using ImplType = xo::scm::IType_Xfer - ; - }; - } -} - -namespace xo { - namespace scm { - /** @class IType_DTypeVarRef - **/ - class IType_DTypeVarRef { - public: - /** @defgroup scm-type-dtypevarref-type-traits **/ - ///@{ - using obj_AType = xo::scm::AType::obj_AType; - using TypeDescr = xo::scm::AType::TypeDescr; - using Copaque = xo::scm::AType::Copaque; - using Opaque = xo::scm::AType::Opaque; - ///@} - /** @defgroup scm-type-dtypevarref-methods **/ - ///@{ - // const methods - /** category for this type **/ - static Metatype metatype(const DTypeVarRef & self) noexcept; - /** reflected representation for instances of this type **/ - static TypeDescr repr_td(const DTypeVarRef & self) noexcept; - /** true iff this type is equal to y **/ - static bool is_equal_to(const DTypeVarRef & self, const obj_AType & y); - /** true iff this is a subtype of y **/ - static bool is_subtype_of(const DTypeVarRef & self, const obj_AType & y); - - // non-const methods - ///@} - }; - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end */ \ No newline at end of file diff --git a/.xo-type/src/type/CMakeLists.txt b/.xo-type/src/type/CMakeLists.txt deleted file mode 100644 index 59f2b9ff..00000000 --- a/.xo-type/src/type/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# xo-type/src/type/CMakeLists.txt - -set(SELF_LIB xo_type) -set(SELF_SRCS - init_type.cpp - SetupType.cpp - TypeOps.cpp - Metatype.cpp - DAtomicType.cpp - DListType.cpp - DArrayType.cpp - DFunctionType.cpp - DTypeVarRef.cpp - IType_Any.cpp - IType_DAtomicType.cpp - IType_DListType.cpp - IType_DArrayType.cpp - IType_DFunctionType.cpp - IType_DTypeVarRef.cpp - IGCObject_DAtomicType.cpp - IGCObject_DListType.cpp - IGCObject_DArrayType.cpp - IGCObject_DFunctionType.cpp - IGCObject_DTypeVarRef.cpp -) - -xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS}) - -# ---------------------------------------------------------------- -# input dependencies -# -# NOTE: dependency set here must be kept consistent with -# xo-type/cmake/xo_typeConfig.cmake.in - -xo_dependency(${SELF_LIB} xo_object2) -xo_dependency(${SELF_LIB} reflect) -xo_dependency(${SELF_LIB} xo_alloc2) -xo_dependency(${SELF_LIB} xo_facet) -xo_dependency(${SELF_LIB} subsys) - -# end src/type/CMakeLists.txt diff --git a/.xo-type/src/type/DArrayType.cpp b/.xo-type/src/type/DArrayType.cpp deleted file mode 100644 index 6fad352d..00000000 --- a/.xo-type/src/type/DArrayType.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/** @file DArrayType.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "Type.hpp" -#include "ArrayType.hpp" -#include "TypeDescr.hpp" -#include -#include -#include - -namespace xo { - using xo::reflect::Reflect; - using xo::reflect::TypeDescr; - using xo::mm::AGCObject; - using xo::mm::AAllocator; - using xo::facet::FacetRegistry; - - namespace scm { - - DArrayType::DArrayType(obj elt) - : elt_type_{elt} - {} - - DArrayType * - DArrayType::_make(obj mm, - obj elt_type) - { - void * mem = mm.alloc_for(); - - return new (mem) DArrayType(elt_type); - } - - // ----- type facet ----- - - TypeDescr - DArrayType::repr_td() const noexcept - { - return Reflect::require(); - } - - bool - DArrayType::is_equal_to(const obj & y_arg) const noexcept - { - Metatype y_mtype = y_arg.metatype(); - - if (y_mtype != Metatype::t_array()) - return false; - - auto y = obj::from(y_arg); - - obj e = elt_type_; - - return (e.is_equal_to(y->elt_type_)); - } - - bool - DArrayType::is_subtype_of(const obj & y_arg) const noexcept - { - Metatype y_mtype = y_arg.metatype(); - - if (y_mtype == Metatype::t_any()) - return true; - - if (y_mtype != Metatype::t_array()) - return false; - - auto y = obj::from(y_arg); - - obj e = elt_type_; - - return (e.is_subtype_of(y->elt_type_)); - } - - // ----- gcobject facet ----- - - DArrayType * - DArrayType::gco_shallow_move(obj gc) noexcept - { - return gc.std_move_for(this); - } - - void - DArrayType::visit_gco_children(VisitReason reason, obj gc) noexcept - { - gc.visit_poly_child(reason, &elt_type_); - } - } -} - -/* end DArrayType.cpp */ diff --git a/.xo-type/src/type/DAtomicType.cpp b/.xo-type/src/type/DAtomicType.cpp deleted file mode 100644 index 833d19d1..00000000 --- a/.xo-type/src/type/DAtomicType.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/** @file DAtomicType.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "AtomicType.hpp" -#include - -namespace xo { - using xo::reflect::Reflect; - using xo::reflect::TypeDescr; - - namespace scm { - - DAtomicType * - DAtomicType::_make(obj mm, Metatype mtype) - { - void * mem = mm.alloc_for(); - - return new (mem) DAtomicType(mtype); - } - - obj - DAtomicType::make(obj mm, Metatype mtype) - { - return obj(_make(mm, mtype)); - } - - // ----- Type facet ----- - - TypeDescr - DAtomicType::repr_td() const noexcept - { - return Reflect::require(); - } - - bool - DAtomicType::is_equal_to(const obj & y) const noexcept - { - return (metatype_.code() == y.metatype().code()); - } - - bool - DAtomicType::is_subtype_of(const obj & y) const noexcept - { - Metatype x_mtype = metatype_; - Metatype y_mtype = y.metatype(); - - if (y_mtype.code() == Metatype::code::t_any) - return true; - - return (x_mtype.code() == y_mtype.code()); - } - - // ----- GCObject facet ----- - - DAtomicType * - DAtomicType::gco_shallow_move(obj gc) noexcept - { - return gc.std_move_for(this); - } - - void - DAtomicType::visit_gco_children(VisitReason, obj) noexcept - { - // no-op. no children - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DAtomicType.cpp */ diff --git a/.xo-type/src/type/DFunctionType.cpp b/.xo-type/src/type/DFunctionType.cpp deleted file mode 100644 index 2b4b8f7c..00000000 --- a/.xo-type/src/type/DFunctionType.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** @file DFunctionType.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "FunctionType.hpp" -#include -#include - -namespace xo { - using xo::reflect::Reflect; - using xo::reflect::TypeDescr; - using xo::facet::FacetRegistry; - - namespace scm { - - // ----- type facet ----- - - TypeDescr - DFunctionType::repr_td() const noexcept - { - return Reflect::require(); - } - - bool - DFunctionType::is_equal_to(obj y_arg) const noexcept - { - Metatype y_mtype = y_arg.metatype(); - - if (y_mtype != Metatype::t_function()) - return false; - - auto y = obj::from(y_arg); - assert(y); - - if (arg_types_->size() != y->arg_types_->size()) - return false; - - if (obj(return_type_).is_equal_to(y->return_type_)) - return false; - - for (size_t i = 0, n = arg_types_->size(); i < n; ++i) { - auto argtype1 - = FacetRegistry::instance().variant((*arg_types_)[i]); - auto argtype2 - = FacetRegistry::instance().variant((*(y->arg_types_))[i]); - - if (argtype1.is_equal_to(argtype2)) - return false; - } - - return true; - } - - bool - DFunctionType::is_subtype_of(const obj & y_arg) const noexcept - { - Metatype y_mtype = y_arg.metatype(); - - if (y_mtype == Metatype::t_any()) - return true; - - if (y_mtype != Metatype::t_function()) - return false; - - auto y = obj::from(y_arg); - assert(y); - - if (arg_types_->size() != y->arg_types_->size()) - return false; - - if (!obj(return_type_).is_subtype_of(y->return_type_)) - return false; - - for (size_t i = 0, n = arg_types_->size(); i < n; ++i) { - auto x_argtype - = FacetRegistry::instance().variant((*arg_types_)[i]); - auto y_argtype - = FacetRegistry::instance().variant((*(y->arg_types_))[i]); - - if (!y_argtype.is_subtype_of(x_argtype)) - return false; - } - - return true; - } - - // ----- gcobject facet ----- - - DFunctionType * - DFunctionType::gco_shallow_move(obj gc) noexcept - { - return gc.std_move_for(this); - } - - void - DFunctionType::visit_gco_children(VisitReason reason, obj gc) noexcept - { - gc.visit_poly_child(reason, &return_type_); - gc.visit_child(reason, &arg_types_); - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DFunctionType.cpp */ diff --git a/.xo-type/src/type/DListType.cpp b/.xo-type/src/type/DListType.cpp deleted file mode 100644 index 0647d8b2..00000000 --- a/.xo-type/src/type/DListType.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/** @file DListType.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "Type.hpp" -#include "ListType.hpp" -#include "TypeDescr.hpp" -#include -#include -#include -#include - -namespace xo { - using xo::reflect::Reflect; - using xo::reflect::TypeDescr; - using xo::mm::AGCObject; - using xo::mm::AAllocator; - using xo::facet::FacetRegistry; - - namespace scm { - - DListType::DListType(obj elt) : elt_type_{elt} {} - - DListType * - DListType::_make(obj mm, - obj elt_type) - { - void * mem = mm.alloc_for(); - - return new (mem) DListType(elt_type); - } - - obj - DListType::make(obj mm, - obj elt_type) - { - return obj(_make(mm, elt_type)); - } - - // ----- type facet ----- - - TypeDescr - DListType::repr_td() const noexcept - { - return Reflect::require(); - } - - bool - DListType::is_equal_to(const obj & y_arg) const noexcept - { - Metatype y_mtype = y_arg.metatype(); - - if (y_mtype != Metatype::t_list()) - return false; - - auto y = obj::from(y_arg); - - obj e = elt_type_; - - return (e.is_equal_to(y->elt_type_)); - } - - bool - DListType::is_subtype_of(const obj & y_arg) const noexcept - { - Metatype y_mtype = y_arg.metatype(); - - if (y_mtype == Metatype::t_any()) - return true; - - if (y_mtype != Metatype::t_list()) - return false; - - auto y = obj::from(y_arg); - - obj e = elt_type_; - - return (e.is_subtype_of(y->elt_type_)); - } - - // ----- gcobject facet ----- - - DListType * - DListType::gco_shallow_move(obj gc) noexcept - { - return gc.std_move_for(this); - } - - void - DListType::visit_gco_children(VisitReason reason, - obj gc) noexcept - { - gc.visit_poly_child(reason, &elt_type_); - //{ - // auto e = FacetRegistry::instance().variant(elt_type_); - // gc.forward_inplace(e.iface(), (void **)&(elt_type_.data_)); - //} - } - } -} - -/* end DListType.cpp */ diff --git a/.xo-type/src/type/DTypeVarRef.cpp b/.xo-type/src/type/DTypeVarRef.cpp deleted file mode 100644 index 86691122..00000000 --- a/.xo-type/src/type/DTypeVarRef.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/** @file DTypeVarRef.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "Metatype.hpp" -#include "TypeVarRef.hpp" -#include -#include -#include - -namespace xo { - using xo::mm::AGCObject; - using xo::reflect::Reflect; - using xo::reflect::TypeDescr; - using xo::facet::FacetRegistry; - - namespace scm { - - DTypeVarRef * - DTypeVarRef::_make(obj mm, const DUniqueString * name) - { - void * mem = mm.alloc_for(); - - return new (mem) DTypeVarRef(name); - } - - obj - DTypeVarRef::make(obj mm, const DUniqueString * name) - { - return obj(_make(mm, name)); - } - - // ----- Type facet ----- - - Metatype - DTypeVarRef::metatype() const noexcept - { - if (type_) { - // resolved typevar reference - - return type_.metatype(); - } else { - // type var reference, not yet resolved - - return Metatype::t_any(); - } - } - - TypeDescr - DTypeVarRef::repr_td() const noexcept - { - return Reflect::require(); - } - - bool - DTypeVarRef::is_equal_to(const obj & y) const noexcept - { - // not really well-defined until types are resolved - - return (this->metatype().code() == y.metatype().code()); - } - - bool - DTypeVarRef::is_subtype_of(const obj & y) const noexcept - { - Metatype x_mtype = this->metatype(); - Metatype y_mtype = y.metatype(); - - if (y_mtype.code() == Metatype::code::t_any) - return true; - - return (x_mtype.code() == y_mtype.code()); - } - - // ----- GCObject facet ----- - - DTypeVarRef * - DTypeVarRef::gco_shallow_move(obj gc) noexcept - { - return gc.std_move_for(this); - } - - void - DTypeVarRef::visit_gco_children(VisitReason reason, obj gc) noexcept - { - gc.visit_poly_child(reason, &type_); - - //{ - // auto e = FacetRegistry::instance().variant(type_); - // gc.forward_inplace(e.iface(), (void **)&type_.data_); - //} - - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end DTypeVarRef.cpp */ diff --git a/.xo-type/src/type/IGCObject_DArrayType.cpp b/.xo-type/src/type/IGCObject_DArrayType.cpp deleted file mode 100644 index 76b9c550..00000000 --- a/.xo-type/src/type/IGCObject_DArrayType.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** @file IGCObject_DArrayType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DArrayType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DArrayType.json5] -**/ - -#include "array/IGCObject_DArrayType.hpp" - -namespace xo { - namespace scm { - auto - IGCObject_DArrayType::gco_shallow_move(DArrayType & self, obj gc) noexcept -> Opaque - { - return self.gco_shallow_move(gc); - } - auto - IGCObject_DArrayType::visit_gco_children(DArrayType & self, VisitReason reason, obj fn) noexcept -> void - { - self.visit_gco_children(reason, fn); - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IGCObject_DArrayType.cpp */ diff --git a/.xo-type/src/type/IGCObject_DAtomicType.cpp b/.xo-type/src/type/IGCObject_DAtomicType.cpp deleted file mode 100644 index 7c4a27e0..00000000 --- a/.xo-type/src/type/IGCObject_DAtomicType.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** @file IGCObject_DAtomicType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DAtomicType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DAtomicType.json5] -**/ - -#include "atomic/IGCObject_DAtomicType.hpp" - -namespace xo { - namespace scm { - auto - IGCObject_DAtomicType::gco_shallow_move(DAtomicType & self, obj gc) noexcept -> Opaque - { - return self.gco_shallow_move(gc); - } - auto - IGCObject_DAtomicType::visit_gco_children(DAtomicType & self, VisitReason reason, obj fn) noexcept -> void - { - self.visit_gco_children(reason, fn); - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IGCObject_DAtomicType.cpp */ diff --git a/.xo-type/src/type/IGCObject_DFunctionType.cpp b/.xo-type/src/type/IGCObject_DFunctionType.cpp deleted file mode 100644 index 25e5e3a7..00000000 --- a/.xo-type/src/type/IGCObject_DFunctionType.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** @file IGCObject_DFunctionType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DFunctionType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DFunctionType.json5] -**/ - -#include "function/IGCObject_DFunctionType.hpp" - -namespace xo { - namespace scm { - auto - IGCObject_DFunctionType::gco_shallow_move(DFunctionType & self, obj gc) noexcept -> Opaque - { - return self.gco_shallow_move(gc); - } - auto - IGCObject_DFunctionType::visit_gco_children(DFunctionType & self, VisitReason reason, obj fn) noexcept -> void - { - self.visit_gco_children(reason, fn); - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IGCObject_DFunctionType.cpp */ diff --git a/.xo-type/src/type/IGCObject_DListType.cpp b/.xo-type/src/type/IGCObject_DListType.cpp deleted file mode 100644 index 43a02911..00000000 --- a/.xo-type/src/type/IGCObject_DListType.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** @file IGCObject_DListType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DListType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DListType.json5] -**/ - -#include "list/IGCObject_DListType.hpp" - -namespace xo { - namespace scm { - auto - IGCObject_DListType::gco_shallow_move(DListType & self, obj gc) noexcept -> Opaque - { - return self.gco_shallow_move(gc); - } - auto - IGCObject_DListType::visit_gco_children(DListType & self, VisitReason reason, obj fn) noexcept -> void - { - self.visit_gco_children(reason, fn); - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IGCObject_DListType.cpp */ diff --git a/.xo-type/src/type/IGCObject_DTypeVar.cpp b/.xo-type/src/type/IGCObject_DTypeVar.cpp deleted file mode 100644 index 799cf663..00000000 --- a/.xo-type/src/type/IGCObject_DTypeVar.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/** @file IGCObject_DTypeVar.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DTypeVar.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DTypeVar.json5] -**/ - -#include "typevar/IGCObject_DTypeVar.hpp" - -namespace xo { - namespace scm { - auto - IGCObject_DTypeVar::shallow_size(const DTypeVar & self) noexcept -> size_type - { - return self.shallow_size(); - } - - auto - IGCObject_DTypeVar::shallow_copy(const DTypeVar & self, obj mm) noexcept -> Opaque - { - return self.shallow_copy(mm); - } - - auto - IGCObject_DTypeVar::forward_children(DTypeVar & self, obj gc) noexcept -> size_type - { - return self.forward_children(gc); - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IGCObject_DTypeVar.cpp */ diff --git a/.xo-type/src/type/IGCObject_DTypeVarRef.cpp b/.xo-type/src/type/IGCObject_DTypeVarRef.cpp deleted file mode 100644 index 2169b1e3..00000000 --- a/.xo-type/src/type/IGCObject_DTypeVarRef.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/** @file IGCObject_DTypeVarRef.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IGCObject_DTypeVarRef.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IGCObject_DTypeVarRef.json5] -**/ - -#include "typevar/IGCObject_DTypeVarRef.hpp" - -namespace xo { - namespace scm { - auto - IGCObject_DTypeVarRef::gco_shallow_move(DTypeVarRef & self, obj gc) noexcept -> Opaque - { - return self.gco_shallow_move(gc); - } - auto - IGCObject_DTypeVarRef::visit_gco_children(DTypeVarRef & self, VisitReason reason, obj fn) noexcept -> void - { - self.visit_gco_children(reason, fn); - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IGCObject_DTypeVarRef.cpp */ diff --git a/.xo-type/src/type/IType_Any.cpp b/.xo-type/src/type/IType_Any.cpp deleted file mode 100644 index bb9690fb..00000000 --- a/.xo-type/src/type/IType_Any.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** @file IType_Any.cpp - * - **/ - -#include "type/IType_Any.hpp" -#include -#include - -namespace xo { -namespace scm { - -using xo::facet::DVariantPlaceholder; -using xo::facet::typeseq; -using xo::facet::valid_facet_implementation; - -void -IType_Any::_fatal() -{ - /* control here on uninitialized IAllocator_Any. - * Initialized instance will have specific implementation type - */ - std::cerr << "fatal" - << ": attempt to call uninitialized" - << " IType_Any method" - << std::endl; - std::terminate(); -} - -typeseq -IType_Any::s_typeseq = typeseq::id(); - -bool -IType_Any::_valid - = valid_facet_implementation(); - -// nonconst methods - - -} /*namespace scm*/ -} /*namespace xo*/ - -/* end IType_Any.cpp */ diff --git a/.xo-type/src/type/IType_DArrayType.cpp b/.xo-type/src/type/IType_DArrayType.cpp deleted file mode 100644 index 363e79c1..00000000 --- a/.xo-type/src/type/IType_DArrayType.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** @file IType_DArrayType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DArrayType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DArrayType.json5] -**/ - -#include "array/IType_DArrayType.hpp" - -namespace xo { - namespace scm { - auto - IType_DArrayType::metatype(const DArrayType & self) noexcept -> Metatype - { - return self.metatype(); - } - - auto - IType_DArrayType::repr_td(const DArrayType & self) noexcept -> TypeDescr - { - return self.repr_td(); - } - - auto - IType_DArrayType::is_equal_to(const DArrayType & self, const obj_AType & y) -> bool - { - return self.is_equal_to(y); - } - - auto - IType_DArrayType::is_subtype_of(const DArrayType & self, const obj_AType & y) -> bool - { - return self.is_subtype_of(y); - } - - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IType_DArrayType.cpp */ diff --git a/.xo-type/src/type/IType_DAtomicType.cpp b/.xo-type/src/type/IType_DAtomicType.cpp deleted file mode 100644 index fd137cbb..00000000 --- a/.xo-type/src/type/IType_DAtomicType.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** @file IType_DAtomicType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DAtomicType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DAtomicType.json5] -**/ - -#include "atomic/IType_DAtomicType.hpp" - -namespace xo { - namespace scm { - auto - IType_DAtomicType::metatype(const DAtomicType & self) noexcept -> Metatype - { - return self.metatype(); - } - - auto - IType_DAtomicType::repr_td(const DAtomicType & self) noexcept -> TypeDescr - { - return self.repr_td(); - } - - auto - IType_DAtomicType::is_equal_to(const DAtomicType & self, const obj_AType & y) -> bool - { - return self.is_equal_to(y); - } - - auto - IType_DAtomicType::is_subtype_of(const DAtomicType & self, const obj_AType & y) -> bool - { - return self.is_subtype_of(y); - } - - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IType_DAtomicType.cpp */ diff --git a/.xo-type/src/type/IType_DFunctionType.cpp b/.xo-type/src/type/IType_DFunctionType.cpp deleted file mode 100644 index 6e77a152..00000000 --- a/.xo-type/src/type/IType_DFunctionType.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** @file IType_DFunctionType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DFunctionType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DFunctionType.json5] -**/ - -#include "function/IType_DFunctionType.hpp" - -namespace xo { - namespace scm { - auto - IType_DFunctionType::metatype(const DFunctionType & self) noexcept -> Metatype - { - return self.metatype(); - } - - auto - IType_DFunctionType::repr_td(const DFunctionType & self) noexcept -> TypeDescr - { - return self.repr_td(); - } - - auto - IType_DFunctionType::is_equal_to(const DFunctionType & self, const obj_AType & y) -> bool - { - return self.is_equal_to(y); - } - - auto - IType_DFunctionType::is_subtype_of(const DFunctionType & self, const obj_AType & y) -> bool - { - return self.is_subtype_of(y); - } - - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IType_DFunctionType.cpp */ diff --git a/.xo-type/src/type/IType_DListType.cpp b/.xo-type/src/type/IType_DListType.cpp deleted file mode 100644 index 9632f403..00000000 --- a/.xo-type/src/type/IType_DListType.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** @file IType_DListType.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DListType.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DListType.json5] -**/ - -#include "list/IType_DListType.hpp" - -namespace xo { - namespace scm { - auto - IType_DListType::metatype(const DListType & self) noexcept -> Metatype - { - return self.metatype(); - } - - auto - IType_DListType::repr_td(const DListType & self) noexcept -> TypeDescr - { - return self.repr_td(); - } - - auto - IType_DListType::is_equal_to(const DListType & self, const obj_AType & y) -> bool - { - return self.is_equal_to(y); - } - - auto - IType_DListType::is_subtype_of(const DListType & self, const obj_AType & y) -> bool - { - return self.is_subtype_of(y); - } - - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IType_DListType.cpp */ diff --git a/.xo-type/src/type/IType_DTypeVar.cpp b/.xo-type/src/type/IType_DTypeVar.cpp deleted file mode 100644 index 16397beb..00000000 --- a/.xo-type/src/type/IType_DTypeVar.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** @file IType_DTypeVar.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DTypeVar.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DTypeVar.json5] -**/ - -#include "typevar/IType_DTypeVar.hpp" - -namespace xo { - namespace scm { - auto - IType_DTypeVar::metatype(const DTypeVar & self) noexcept -> Metatype - { - return self.metatype(); - } - - auto - IType_DTypeVar::repr_td(const DTypeVar & self) noexcept -> TypeDescr - { - return self.repr_td(); - } - - auto - IType_DTypeVar::is_equal_to(const DTypeVar & self, const obj_AType & y) -> bool - { - return self.is_equal_to(y); - } - - auto - IType_DTypeVar::is_subtype_of(const DTypeVar & self, const obj_AType & y) -> bool - { - return self.is_subtype_of(y); - } - - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IType_DTypeVar.cpp */ diff --git a/.xo-type/src/type/IType_DTypeVarRef.cpp b/.xo-type/src/type/IType_DTypeVarRef.cpp deleted file mode 100644 index f1ce54ce..00000000 --- a/.xo-type/src/type/IType_DTypeVarRef.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** @file IType_DTypeVarRef.cpp - * - * Generated automagically from ingredients: - * 1. code generator: - * [xo-facet/codegen/genfacet] - * arguments: - * --input [idl/IType_DTypeVarRef.json5] - * 2. jinja2 template for abstract facet .hpp file: - * [iface_facet_any.hpp.j2] - * 3. idl for facet methods - * [idl/IType_DTypeVarRef.json5] -**/ - -#include "typevar/IType_DTypeVarRef.hpp" - -namespace xo { - namespace scm { - auto - IType_DTypeVarRef::metatype(const DTypeVarRef & self) noexcept -> Metatype - { - return self.metatype(); - } - - auto - IType_DTypeVarRef::repr_td(const DTypeVarRef & self) noexcept -> TypeDescr - { - return self.repr_td(); - } - - auto - IType_DTypeVarRef::is_equal_to(const DTypeVarRef & self, const obj_AType & y) -> bool - { - return self.is_equal_to(y); - } - - auto - IType_DTypeVarRef::is_subtype_of(const DTypeVarRef & self, const obj_AType & y) -> bool - { - return self.is_subtype_of(y); - } - - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end IType_DTypeVarRef.cpp */ diff --git a/.xo-type/src/type/Metatype.cpp b/.xo-type/src/type/Metatype.cpp deleted file mode 100644 index 1eb0138e..00000000 --- a/.xo-type/src/type/Metatype.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/** @file Metatype.cpp - * - * @author Roland Conybeare, Nar 2026 - **/ - -#include "Metatype.hpp" -#include - -namespace xo { - namespace scm { - - const char * - Metatype::_descr() const noexcept - { - switch (code_) { - case code::t_unit: return "unit"; - case code::t_bool: return "bool"; - case code::t_str: return "str"; - - case code::t_i16: return "i16"; - case code::t_i32: return "i32"; - case code::t_i64: return "i64"; - - case code::t_f32: return "f32"; - case code::t_f64: return "f64"; - - case code::t_sum: return "sum"; - case code::t_list: return "list"; - case code::t_array: return "array"; - case code::t_function: return "function"; - case code::t_struct: return "struct"; - case code::t_dict: return "dict"; - - case code::t_integer: return "integer"; - case code::t_booleic: return "booleic"; - case code::t_numeric: return "numeric"; - case code::t_callable: return "callable"; - case code::t_any: return "any"; - } - - assert(false); - return "?metatype"; - } - - bool - Metatype::is_atomic() const noexcept - { - switch (code_) { - case code::t_unit: - return false; - - case code::t_bool: - return true; - case code::t_str: - return true; - - case code::t_i16: - return true; - case code::t_i32: - return true; - case code::t_i64: - return true; - - case code::t_f32: - return true; - case code::t_f64: - return true; - - case code::t_sum: - return false; - case code::t_list: - return false; - case code::t_array: - return false; - case code::t_function: - return false; - case code::t_struct: - return false; - case code::t_dict: - return true; - - case code::t_integer: - return true; - case code::t_booleic: - return true; - case code::t_numeric: - return true; - case code::t_callable: - return true; - case code::t_any: - return true; - } - - assert(false); - return false; - } - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end Metatype.cpp */ diff --git a/.xo-type/src/type/SetupType.cpp b/.xo-type/src/type/SetupType.cpp deleted file mode 100644 index ff5f4988..00000000 --- a/.xo-type/src/type/SetupType.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** @file SetupType.cpp - * - * @author Roland Conybeare, Feb 2026 - **/ - -#include "SetupType.hpp" -#include "AtomicType.hpp" -#include "ListType.hpp" -#include "ArrayType.hpp" -#include "FunctionType.hpp" -#include "TypeVarRef.hpp" - -#include -#include - -namespace xo { - using xo::mm::AGCObject; - using xo::facet::FacetRegistry; - using xo::facet::impl_for; - using xo::reflect::typeseq; - - namespace scm { - - bool - SetupType::register_facets() - { - scope log(XO_DEBUG(true)); - - FacetRegistry::register_impl(); - FacetRegistry::register_impl(); - - FacetRegistry::register_impl(); - FacetRegistry::register_impl(); - - FacetRegistry::register_impl(); - FacetRegistry::register_impl(); - - FacetRegistry::register_impl(); - FacetRegistry::register_impl(); - - FacetRegistry::register_impl(); - FacetRegistry::register_impl(); - - log && log(xtag("DAtomicType.tseq", typeseq::id())); - log && log(xtag("DListType.tseq", typeseq::id())); - log && log(xtag("DArrayType.tseq", typeseq::id())); - log && log(xtag("DFunctionType.tseq", typeseq::id())); - log && log(xtag("DTypeVarRef.tseq", typeseq::id())); - - return true; - } - - bool - SetupType::register_types(obj gc) - { - scope log(XO_DEBUG(true)); - - bool ok = true; - - ok &= gc.install_type(impl_for()); - ok &= gc.install_type(impl_for()); - ok &= gc.install_type(impl_for()); - ok &= gc.install_type(impl_for()); - ok &= gc.install_type(impl_for()); - - return ok; - } - } /*namespace scm*/ -} /*namespace xo*/ - -/* end SetupType.cpp */ diff --git a/.xo-type/src/type/TypeOps.cpp b/.xo-type/src/type/TypeOps.cpp deleted file mode 100644 index f344fb5b..00000000 --- a/.xo-type/src/type/TypeOps.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/** @file TypeOps.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "TypeOps.hpp" - -namespace xo { - namespace scm { - - - } /*namespace scm*/ -} /*namespace xo*/ - -/* end TypeOps.cpp */ diff --git a/.xo-type/src/type/init_type.cpp b/.xo-type/src/type/init_type.cpp deleted file mode 100644 index 6a544396..00000000 --- a/.xo-type/src/type/init_type.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/** @file init_type.cpp - * - * @author Roland Conybeare, Jan 2026 - **/ - -#include "init_type.hpp" -#include "SetupType.hpp" -#include -#include - -namespace xo { - using xo::scm::SetupType; - using xo::mm::CollectorTypeRegistry; - - void - InitSubsys::init() - { - SetupType::register_facets(); - - CollectorTypeRegistry::instance().register_types(&SetupType::register_types); - } - - InitEvidence - InitSubsys::require() - { - InitEvidence retval; - - /* direct subsystem deps for xo-type/ */ - retval ^= InitSubsys::require(); - - /* xo-type/'s own initialization code */ - retval ^= Subsystem::provide("type", &init); - - return retval; - } -} /*namespace xo*/ - -/* end init_type.cpp */ diff --git a/.xo-type/utest/CMakeLists.txt b/.xo-type/utest/CMakeLists.txt deleted file mode 100644 index 6ddf4ce4..00000000 --- a/.xo-type/utest/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -# built unittest xo-type/utest - -set(UTEST_EXE utest.type) -set(UTEST_SRCS - type_utest_main.cpp - DAtomicType.test.cpp - DListType.test.cpp - DArrayType.test.cpp -# DString.test.cpp -# StringOps.test.cpp -# X1Collector.test.cpp -# Printable.test.cpp -) - -xo_add_utest_executable(${UTEST_EXE} ${UTEST_SRCS}) -xo_self_dependency(${UTEST_EXE} xo_type) -#xo_dependency(${UTEST_EXE} xo_alloc2) -xo_external_target_dependency(${UTEST_EXE} Catch2 Catch2::Catch2) diff --git a/.xo-type/utest/DArrayType.test.cpp b/.xo-type/utest/DArrayType.test.cpp deleted file mode 100644 index 5947eb3a..00000000 --- a/.xo-type/utest/DArrayType.test.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/** @file DArrayType.test.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "init_type.hpp" -#include "TypeOps.hpp" -#include "ArrayType.hpp" -#include "ListType.hpp" -#include "AtomicType.hpp" -#include -#include -#include -#include - -namespace xo { - using xo::scm::TypeOps; - using xo::scm::AType; - using xo::scm::Metatype; - using xo::mm::AAllocator; - using xo::mm::DArena; - using xo::mm::ArenaConfig; - - namespace ut { - static InitEvidence s_init = (InitSubsys::require()); - - TEST_CASE("DArrayType-make", "[type][DArrayType]") - { - ArenaConfig cfg { .name_ = "testarena", - .size_ = 4*1024 }; - DArena arena = DArena::map(cfg); - auto alloc = obj(&arena); - - auto i64_type = TypeOps::atomic_type(alloc, Metatype::t_i64()); - auto array_i64_type = TypeOps::array_type(alloc, i64_type); - - REQUIRE(array_i64_type); - REQUIRE(array_i64_type.is_equal_to(array_i64_type)); - - auto bool_type = TypeOps::atomic_type(alloc, Metatype::t_bool()); - auto array_bool_type = TypeOps::array_type(alloc, bool_type); - - REQUIRE(array_bool_type); - REQUIRE(array_bool_type.is_equal_to(array_bool_type)); - - auto any_type = TypeOps::atomic_type(alloc, Metatype::t_any()); - auto array_any_type = TypeOps::array_type(alloc, any_type); - - REQUIRE(array_any_type); - REQUIRE(array_any_type.is_equal_to(array_any_type)); - - REQUIRE(array_bool_type.is_subtype_of(array_any_type)); - REQUIRE(array_i64_type.is_subtype_of(array_any_type)); - - REQUIRE(!array_i64_type.is_subtype_of(array_bool_type)); - REQUIRE(!array_any_type.is_subtype_of(array_bool_type)); - REQUIRE(!array_bool_type.is_subtype_of(array_i64_type)); - REQUIRE(!array_any_type.is_subtype_of(array_i64_type)); - - // array and list are unrelated - auto list_i64_type = TypeOps::list_type(alloc, i64_type); - REQUIRE(!array_i64_type.is_equal_to(list_i64_type)); - REQUIRE(!array_i64_type.is_subtype_of(list_i64_type)); - REQUIRE(!list_i64_type.is_subtype_of(array_i64_type)); - } - } -} - - -/* end DArrayType.test.cpp */ diff --git a/.xo-type/utest/DAtomicType.test.cpp b/.xo-type/utest/DAtomicType.test.cpp deleted file mode 100644 index 54557010..00000000 --- a/.xo-type/utest/DAtomicType.test.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/** @file DAtomicType.test.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "init_type.hpp" -#include "AtomicType.hpp" -#include -#include -#include -#include - -namespace xo { - using xo::scm::AType; - using xo::scm::DAtomicType; - using xo::scm::Metatype; - using xo::mm::AAllocator; - using xo::mm::DArena; - using xo::mm::ArenaConfig; - - namespace ut { - static InitEvidence s_init = (InitSubsys::require()); - - TEST_CASE("DAtomicType-make", "[type][DAtomicType]") - { - ArenaConfig cfg { .name_ = "testarena", - .size_ = 4*1024 }; - DArena arena = DArena::map(cfg); - auto alloc = obj(&arena); - - auto unit_type = obj(DAtomicType::_make(alloc, Metatype::t_unit())); - auto i64_type = obj(DAtomicType::_make(alloc, Metatype::t_i64())); - auto f64_type = obj(DAtomicType::_make(alloc, Metatype::t_f64())); - auto str_type = obj(DAtomicType::_make(alloc, Metatype::t_str())); - auto any_type = obj(DAtomicType::_make(alloc, Metatype::t_any())); - { - REQUIRE(unit_type); - REQUIRE(unit_type.metatype().code() == Metatype::t_unit().code()); - - REQUIRE(unit_type.is_equal_to(unit_type)); - REQUIRE(unit_type.is_subtype_of(unit_type)); - } - - { - REQUIRE(i64_type); - REQUIRE(i64_type.metatype().code() == Metatype::t_i64().code()); - - REQUIRE(i64_type.is_equal_to(i64_type)); - REQUIRE(i64_type.is_subtype_of(i64_type)); - - REQUIRE(!i64_type.is_subtype_of(unit_type)); - REQUIRE(!unit_type.is_subtype_of(i64_type)); - } - - { - REQUIRE(f64_type); - REQUIRE(f64_type.metatype().code() == Metatype::t_f64().code()); - - REQUIRE(f64_type.is_equal_to(f64_type)); - REQUIRE(f64_type.is_subtype_of(f64_type)); - - REQUIRE(!f64_type.is_subtype_of(unit_type)); - REQUIRE(!f64_type.is_subtype_of(i64_type)); - REQUIRE(!unit_type.is_subtype_of(f64_type)); - REQUIRE(!i64_type.is_subtype_of(f64_type)); - } - - { - REQUIRE(str_type); - REQUIRE(str_type.metatype().code() == Metatype::t_str().code()); - - REQUIRE(str_type.is_equal_to(str_type)); - REQUIRE(str_type.is_subtype_of(str_type)); - - REQUIRE(!str_type.is_subtype_of(unit_type)); - REQUIRE(!str_type.is_subtype_of(i64_type)); - REQUIRE(!str_type.is_subtype_of(f64_type)); - - REQUIRE(!unit_type.is_subtype_of(str_type)); - REQUIRE(!i64_type.is_subtype_of(str_type)); - REQUIRE(!f64_type.is_subtype_of(str_type)); - } - - { - REQUIRE(any_type); - REQUIRE(any_type.metatype().code() == Metatype::t_any().code()); - - REQUIRE(any_type.is_equal_to(any_type)); - REQUIRE(any_type.is_subtype_of(any_type)); - - REQUIRE(!any_type.is_subtype_of(unit_type)); - REQUIRE(!any_type.is_subtype_of(i64_type)); - REQUIRE(!any_type.is_subtype_of(f64_type)); - REQUIRE(!any_type.is_subtype_of(str_type)); - - REQUIRE(unit_type.is_subtype_of(any_type)); - REQUIRE(i64_type.is_subtype_of(any_type)); - REQUIRE(f64_type.is_subtype_of(any_type)); - REQUIRE(str_type.is_subtype_of(any_type)); - } - } - - } /*namespace ut*/ -} /*namespace xo*/ - -/* end DAtomicType.test.cpp */ diff --git a/.xo-type/utest/DListType.test.cpp b/.xo-type/utest/DListType.test.cpp deleted file mode 100644 index 1eace386..00000000 --- a/.xo-type/utest/DListType.test.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/** @file DListType.test.cpp - * - * @author Roland Conybeare, Mar 2026 - **/ - -#include "init_type.hpp" -#include "TypeOps.hpp" -#include "ListType.hpp" -#include "AtomicType.hpp" -#include -#include -#include -#include - -namespace xo { - using xo::scm::TypeOps; - using xo::scm::AType; - //using xo::scm::DListType; - //using xo::scm::DAtomicType; - using xo::scm::Metatype; - using xo::mm::AAllocator; - using xo::mm::DArena; - using xo::mm::ArenaConfig; - - namespace ut { - static InitEvidence s_init = (InitSubsys::require()); - - TEST_CASE("DListType-make", "[type][DListType]") - { - ArenaConfig cfg { .name_ = "testarena", - .size_ = 4*1024 }; - DArena arena = DArena::map(cfg); - auto alloc = obj(&arena); - - auto i64_type = TypeOps::atomic_type(alloc, Metatype::t_i64()); - auto list_i64_type = TypeOps::list_type(alloc, i64_type); - - REQUIRE(list_i64_type); - REQUIRE(list_i64_type.is_equal_to(list_i64_type)); - - auto bool_type = TypeOps::atomic_type(alloc, Metatype::t_bool()); - auto list_bool_type = TypeOps::list_type(alloc, bool_type); - - REQUIRE(list_bool_type); - REQUIRE(list_bool_type.is_equal_to(list_bool_type)); - - auto any_type = TypeOps::atomic_type(alloc, Metatype::t_any()); - auto list_any_type = TypeOps::list_type(alloc, any_type); - - REQUIRE(list_any_type); - REQUIRE(list_any_type.is_equal_to(list_any_type)); - - REQUIRE(list_bool_type.is_subtype_of(list_any_type)); - REQUIRE(list_i64_type.is_subtype_of(list_any_type)); - - REQUIRE(!list_i64_type.is_subtype_of(list_bool_type)); - REQUIRE(!list_any_type.is_subtype_of(list_bool_type)); - REQUIRE(!list_bool_type.is_subtype_of(list_i64_type)); - REQUIRE(!list_any_type.is_subtype_of(list_i64_type)); - } - } -} - - -/* end DListType.cpp */ diff --git a/.xo-type/utest/type_utest_main.cpp b/.xo-type/utest/type_utest_main.cpp deleted file mode 100644 index d4615d40..00000000 --- a/.xo-type/utest/type_utest_main.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* file type_utest_main.cpp */ - -#include - -#define CATCH_CONFIG_RUNNER -#include "catch2/catch.hpp" - -int -main(int argc, char* argv[]) -{ - using xo::Subsystem; - - // Your custom initialization code here - Subsystem::initialize_all(); - - // Run Catch2's test session - int result = Catch::Session().run(argc, argv); - - // cleanup here, if any - - return result; -} - -/* end type_utest_main.cpp */