diff --git a/idl/Sequence.json5 b/idl/Sequence.json5 index 7ec535c..433d3ca 100644 --- a/idl/Sequence.json5 +++ b/idl/Sequence.json5 @@ -4,6 +4,7 @@ namespace2: "scm", facet: "Sequence", brief: "an ordered collection of variants", + using_doxygen: true, doc: [ "Elements appear in some determinstic order.", "Sequence is GC-aware --> elements must be GC-aware" diff --git a/include/xo/object2/ASequence.hpp b/include/xo/object2/ASequence.hpp index db12e6b..4c4c806 100644 --- a/include/xo/object2/ASequence.hpp +++ b/include/xo/object2/ASequence.hpp @@ -2,7 +2,7 @@ * * Generated automagically from ingredients: * 1. code generator: - * [/home/roland/proj/xo-umbrella2/xo-object2/../xo-facet/codegen/genfacet.py] + * [/Users/roland/proj/xo-umbrella2/xo-object2/../xo-facet/codegen/genfacet.py] * arguments: * --input [./idl/Sequence.json5] * 2. jinja2 template for abstract facet .hpp file: @@ -15,29 +15,61 @@ // includes (via {facet_includes}) #include +#include +#include +#include namespace xo { namespace scm { +using Copaque = const void *; +using Opaque = void *; + /** Elements appear in some determinstic order. Sequence is GC-aware --> elements must be GC-aware **/ class ASequence { public: + /** @defgroup scm-sequence-type-traits **/ + ///@{ + // types + /** type for length of a sequence **/ + using size_type = std::size_t; + /** facet for types with GC support **/ + using AGCObject = xo::mm::AGCObject; + ///@} + /** @defgroup scm-sequence-methods **/ + ///@{ + // const methods + /** RTTI: unique id# for actual runtime data representation **/ + virtual int32_t _typeseq() const noexcept = 0; /** true iff sequence is empty **/ - virtual bool is_empty() const noexcept = 0; - - + virtual bool is_empty(Copaque data) const noexcept = 0; /** true iff sequence is finite **/ - virtual bool is_finite() const noexcept = 0; - - + virtual bool is_finite(Copaque data) const noexcept = 0; /** return element @p index of this sequence **/ - virtual obj at(size_type index) const = 0; + virtual obj at(Copaque data, size_type index) const = 0; + // nonconst methods + ///@} }; /*ASequence*/ +/** Implementation ISequence_DRepr of ASequence for state DRepr + * should provide a specialization: + * + * template <> + * struct xo::facet::FacetImplementation { + * using Impltype = ISequence_DRepr; + * }; + * + * then ISequence_ImplType --> ISequence_DRepr + **/ +template +using ISequence_ImplType = xo::facet::FacetImplType; + } /*namespace scm*/ -} /*namespace xo*/ \ No newline at end of file +} /*namespace xo*/ + +/* */ \ No newline at end of file diff --git a/src/object2/CMakeLists.txt b/src/object2/CMakeLists.txt index 644216a..d7df723 100644 --- a/src/object2/CMakeLists.txt +++ b/src/object2/CMakeLists.txt @@ -5,6 +5,7 @@ set(SELF_SRCS IGCObject_DFloat.cpp IGCObject_DInteger.cpp IGCObject_DList.cpp + ISequence_Any.cpp ) xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS})