+ xo-object2

This commit is contained in:
Roland Conybeare 2025-12-14 11:29:54 -05:00
commit ae8b4348b3
10 changed files with 262 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# object2/CMakeLists.txt
set(SELF_LIB xo_object2)
set(SELF_SRCS
IGCObject_DFloat.cpp
IGCObject_DInteger.cpp
)
xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS})
# note: deps here must also appear in cmake/xo_alloc2Config.cmake.in
xo_dependency(${SELF_LIB} xo_alloc2)
#xo_dependency(${SELF_LIB} indentlog)

View file

@ -0,0 +1,44 @@
/** @file IGCObject_DFloat.cpp
*
* @author Roland Conybeare, Dec 2025
**/
#include "IGCObject_DFloat.hpp"
#include "AAllocator.hpp"
#include "xo/facet/obj.hpp"
#include <cstddef>
namespace xo {
using xo::mm::AAllocator;
using xo::facet::obj;
using std::size_t;
namespace scm {
size_t
IGCObject_DFloat::shallow_size(const DFloat &) noexcept
{
return sizeof(DFloat);
}
DFloat *
IGCObject_DFloat::shallow_copy(const DFloat & src,
obj<AAllocator> mm) noexcept
{
DFloat * copy = (DFloat *)mm.alloc(sizeof(DFloat));
if (copy)
*copy = src;
return copy;
}
size_t
IGCObject_DFloat::forward_children(DFloat &) noexcept
{
return sizeof(DFloat);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IGCObject_DFloat.cpp */

View file

@ -0,0 +1,44 @@
/** @file IGCObject_DInteger.cpp
*
* @author Roland Conybeare, Dec 2025
**/
#include "IGCObject_DInteger.hpp"
#include "AAllocator.hpp"
#include "xo/facet/obj.hpp"
#include <cstddef>
namespace xo {
using xo::mm::AAllocator;
using xo::facet::obj;
using std::size_t;
namespace scm {
size_t
IGCObject_DInteger::shallow_size(const DInteger &) noexcept
{
return sizeof(DInteger);
}
DInteger *
IGCObject_DInteger::shallow_copy(const DInteger & src,
obj<AAllocator> mm) noexcept
{
DInteger * copy = (DInteger *)mm.alloc(sizeof(DInteger));
if (copy)
*copy = src;
return copy;
}
size_t
IGCObject_DInteger::forward_children(DInteger &) noexcept
{
return sizeof(DInteger);
}
} /*namespace scm*/
} /*namespace xo*/
/* end IGCObject_DInteger.cpp */