xo-facet xo-object2 : tidy: ISequence_DList -> list/ subdir
This commit is contained in:
parent
71dcbe69f0
commit
e625a362a6
15 changed files with 73 additions and 51 deletions
|
|
@ -2,13 +2,13 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-object2/../xo-facet/codegen/genfacet]
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [./idl/Sequence.json5]
|
||||
* --input [idl/Sequence.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [abstract_facet.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [./idl/Sequence.json5]
|
||||
* [idl/Sequence.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
|
@ -19,6 +19,8 @@
|
|||
#include <xo/facet/facet_implementation.hpp>
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
|
||||
// {pretext} here
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
||||
|
|
@ -36,6 +38,8 @@ public:
|
|||
// types
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
using Copaque = const void *;
|
||||
using Opaque = void *;
|
||||
/** type for length of a sequence **/
|
||||
using size_type = std::size_t;
|
||||
/** facet for types with GC support **/
|
||||
|
|
@ -48,11 +52,11 @@ public:
|
|||
/** RTTI: unique id# for actual runtime data representation **/
|
||||
virtual typeseq _typeseq() const noexcept = 0;
|
||||
/** true iff sequence is empty **/
|
||||
virtual bool is_empty(Copaque data) const noexcept = 0;
|
||||
virtual bool is_empty(Copaque data) const noexcept = 0;
|
||||
/** true iff sequence is finite **/
|
||||
virtual bool is_finite(Copaque data) const noexcept = 0;
|
||||
virtual bool is_finite(Copaque data) const noexcept = 0;
|
||||
/** return element @p index of this sequence **/
|
||||
virtual obj<AGCObject> at(Copaque data, size_type index) const = 0;
|
||||
virtual obj<AGCObject> at(Copaque data, size_type index) const = 0;
|
||||
|
||||
// nonconst methods
|
||||
///@}
|
||||
|
|
@ -74,4 +78,4 @@ using ISequence_ImplType = xo::facet::FacetImplType<ASequence, DRepr>;
|
|||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* */
|
||||
/* ASequence.hpp */
|
||||
|
|
@ -2,19 +2,18 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-object2/../xo-facet/codegen/genfacet]
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [./idl/Sequence.json5]
|
||||
* --input [idl/Sequence.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [./idl/Sequence.json5]
|
||||
* [idl/Sequence.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ASequence.hpp"
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
|
||||
namespace xo { namespace scm { class ISequence_Any; } }
|
||||
|
|
@ -43,6 +42,7 @@ namespace scm {
|
|||
/** @defgroup scm-sequence-any-type-traits **/
|
||||
///@{
|
||||
|
||||
/** integer identifying a type **/
|
||||
using typeseq = xo::facet::typeseq;
|
||||
using size_type = ASequence::size_type;
|
||||
using AGCObject = ASequence::AGCObject;
|
||||
|
|
@ -57,16 +57,16 @@ namespace scm {
|
|||
|
||||
// const methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
[[noreturn]] bool is_empty(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] bool is_finite(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] obj<AGCObject> at(Copaque, size_type) const override { _fatal(); }
|
||||
[[noreturn]] bool is_empty(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] bool is_finite(Copaque) const noexcept override { _fatal(); }
|
||||
[[noreturn]] obj<AGCObject> at(Copaque, size_type) const override { _fatal(); }
|
||||
|
||||
// nonconst methods
|
||||
|
||||
///@}
|
||||
|
||||
private:
|
||||
/** @defgroup scm-sequence-any-private-methods **/
|
||||
/** @defgraoup scm-sequence-any-private-methods **/
|
||||
///@{
|
||||
|
||||
[[noreturn]] static void _fatal();
|
||||
|
|
@ -86,4 +86,4 @@ namespace scm {
|
|||
} /*namespace scm */
|
||||
} /*namespace xo */
|
||||
|
||||
/* ISequence_Any.hpp */
|
||||
/* ISequence_Any.hpp */
|
||||
|
|
@ -2,18 +2,18 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-object2/../xo-facet/codegen/genfacet]
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [./idl/Sequence.json5]
|
||||
* --input [idl/Sequence.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [./idl/Sequence.json5]
|
||||
* [idl/Sequence.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ASequence.hpp"
|
||||
#include <xo/gc/GCObject.hpp>
|
||||
|
||||
namespace xo {
|
||||
namespace scm {
|
||||
|
|
@ -24,7 +24,10 @@ namespace scm {
|
|||
public:
|
||||
/** @defgroup scm-sequence-xfer-type-traits **/
|
||||
///@{
|
||||
/** actual implementation (not generated; often delegates to DRepr) **/
|
||||
using Impl = ISequence_DRepr;
|
||||
/** integer identifying a type **/
|
||||
using typeseq = ASequence::typeseq;
|
||||
using size_type = ASequence::size_type;
|
||||
using AGCObject = ASequence::AGCObject;
|
||||
///@}
|
||||
|
|
@ -39,13 +42,13 @@ namespace scm {
|
|||
|
||||
// const methods
|
||||
typeseq _typeseq() const noexcept override { return s_typeseq; }
|
||||
bool is_empty(Copaque data) const noexcept override {
|
||||
bool is_empty(Copaque data) const noexcept override {
|
||||
return I::is_empty(_dcast(data));
|
||||
}
|
||||
bool is_finite(Copaque data) const noexcept override {
|
||||
bool is_finite(Copaque data) const noexcept override {
|
||||
return I::is_finite(_dcast(data));
|
||||
}
|
||||
obj<AGCObject> at(Copaque data, size_type index) const override {
|
||||
obj<AGCObject> at(Copaque data, size_type index) const override {
|
||||
return I::at(_dcast(data), index);
|
||||
}
|
||||
|
||||
|
|
@ -82,4 +85,4 @@ namespace scm {
|
|||
} /*namespace scm */
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end ISequence_Xfer.hpp */
|
||||
/* end ISequence_Xfer.hpp */
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-object2/../xo-facet/codegen/genfacet]
|
||||
* [/Users/roland/proj/xo-umbrella2/xo-facet/codegen/genfacet]
|
||||
* arguments:
|
||||
* --input [./idl/Sequence.json5]
|
||||
* --input [idl/Sequence.json5]
|
||||
* 2. jinja2 template for abstract facet .hpp file:
|
||||
* [iface_facet_any.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [./idl/Sequence.json5]
|
||||
* [idl/Sequence.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
|
@ -30,6 +30,7 @@ public:
|
|||
///@{
|
||||
using ObjectType = Object;
|
||||
using DataPtr = Object::DataPtr;
|
||||
using typeseq = xo::reflect::typeseq;
|
||||
using size_type = ASequence::size_type;
|
||||
using AGCObject = ASequence::AGCObject;
|
||||
///@}
|
||||
|
|
@ -38,26 +39,27 @@ public:
|
|||
///@{
|
||||
RSequence() {}
|
||||
RSequence(Object::DataPtr data) : Object{std::move(data)} {}
|
||||
RSequence(const ASequence * iface, void * data)
|
||||
requires std::is_same_v<typename Object::DataType, xo::facet::DVariantPlaceholder>
|
||||
: Object(iface, data) {}
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-sequence-router-methods **/
|
||||
///@{
|
||||
|
||||
// const methods
|
||||
int32_t _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||
bool is_empty() const noexcept override {
|
||||
typeseq _typeseq() const noexcept { return O::iface()->_typeseq(); }
|
||||
bool is_empty() const noexcept {
|
||||
return O::iface()->is_empty(O::data());
|
||||
}
|
||||
bool is_finite() const noexcept override {
|
||||
bool is_finite() const noexcept {
|
||||
return O::iface()->is_finite(O::data());
|
||||
}
|
||||
obj<AGCObject> at(size_type index) const override {
|
||||
obj<AGCObject> at(size_type index) const {
|
||||
return O::iface()->at(O::data(), index);
|
||||
}
|
||||
|
||||
// non-const methods
|
||||
// << do something for non-const methods >>
|
||||
//
|
||||
// non-const methods (still const in router!)
|
||||
|
||||
///@}
|
||||
/** @defgroup scm-sequence-member-vars **/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue