xo-facet: support facet files in separate subdir
This commit is contained in:
parent
aa7cb8cacf
commit
25de1e30ef
3 changed files with 14 additions and 83 deletions
|
|
@ -13,9 +13,9 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "{{abstract_facet_fname}}"
|
||||
#include "{{iface_facet_any_hpp_fname}}"
|
||||
#include "{{iface_facet_xfer_hpp_fname}}"
|
||||
#include "{{router_facet_hpp_fname}}"
|
||||
#include "{{impl_hpp_subdir}}/{{abstract_facet_fname}}"
|
||||
#include "{{impl_hpp_subdir}}/{{iface_facet_any_hpp_fname}}"
|
||||
#include "{{impl_hpp_subdir}}/{{iface_facet_xfer_hpp_fname}}"
|
||||
#include "{{impl_hpp_subdir}}/{{router_facet_hpp_fname}}"
|
||||
|
||||
/* end {{facet_hpp_fname}} */
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ def format_args_routing(args):
|
|||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--input', required=True, help='input IDL JSON5 file')
|
||||
parser.add_argument('--output-impl-hpp', required=True, help='.hpp detail subdir')
|
||||
parser.add_argument('--output-hpp', required=True, help='.hpp output directory')
|
||||
parser.add_argument('--output-cpp', required=True, help='.cpp output directory')
|
||||
|
||||
|
|
@ -66,6 +67,10 @@ def main():
|
|||
output_hpp_dir = Path(args.output_hpp)
|
||||
output_hpp_dir.mkdir(parents=False, exist_ok=True)
|
||||
#
|
||||
output_impl_hpp_subdir = Path(args.output_impl_hpp)
|
||||
output_impl_hpp_dir = Path(args.output_hpp) / output_impl_hpp_subdir
|
||||
output_impl_hpp_dir.mkdir(parents=False, exist_ok=True)
|
||||
#
|
||||
output_cpp_dir = Path(args.output_cpp)
|
||||
output_cpp_dir.mkdir(parents=False, exist_ok=True)
|
||||
|
||||
|
|
@ -147,6 +152,7 @@ def main():
|
|||
'genfacet': __file__,
|
||||
'genfacet_input': args.input,
|
||||
'using_dox': using_dox,
|
||||
'impl_hpp_subdir': output_impl_hpp_subdir,
|
||||
#
|
||||
'facet_hpp_j2': 'facet.hpp.j2',
|
||||
'facet_includes': facet_includes,
|
||||
|
|
@ -193,15 +199,15 @@ def main():
|
|||
templates = {}
|
||||
templates[facet_hpp_fname] = [output_hpp_dir,
|
||||
context['facet_hpp_j2']]
|
||||
templates[abstract_facet_fname] = [output_hpp_dir,
|
||||
templates[abstract_facet_fname] = [output_impl_hpp_dir,
|
||||
context['abstract_facet_hpp_j2']]
|
||||
templates[iface_facet_any_hpp_fname] = [output_hpp_dir,
|
||||
templates[iface_facet_any_hpp_fname] = [output_impl_hpp_dir,
|
||||
context['iface_facet_any_hpp_j2']]
|
||||
templates[iface_facet_any_cpp_fname] = [output_cpp_dir,
|
||||
context['iface_facet_any_cpp_j2']]
|
||||
templates[iface_facet_xfer_hpp_fname] = [output_hpp_dir,
|
||||
templates[iface_facet_xfer_hpp_fname] = [output_impl_hpp_dir,
|
||||
context['iface_facet_xfer_hpp_j2']]
|
||||
templates[router_facet_hpp_fname] = [output_hpp_dir,
|
||||
templates[router_facet_hpp_fname] = [output_impl_hpp_dir,
|
||||
context['router_facet_hpp_j2']]
|
||||
|
||||
for out_file, record in templates.items():
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
/** @file ASequence.hpp
|
||||
*
|
||||
* Generated automagically from ingredients:
|
||||
* 1. code generator:
|
||||
* [/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:
|
||||
* [abstract_facet.hpp.j2]
|
||||
* 3. idl for facet methods
|
||||
* [./idl/Sequence.json5]
|
||||
**/
|
||||
|
||||
#pragma once
|
||||
|
||||
// includes (via {facet_includes})
|
||||
#include <xo/gc/GCObject.hpp>
|
||||
#include <xo/facet/obj.hpp>
|
||||
#include <xo/facet/facet_implementation.hpp>
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
|
||||
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(Copaque data) const noexcept = 0;
|
||||
/** true iff sequence is finite **/
|
||||
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;
|
||||
|
||||
// nonconst methods
|
||||
///@}
|
||||
}; /*ASequence*/
|
||||
|
||||
/** Implementation ISequence_DRepr of ASequence for state DRepr
|
||||
* should provide a specialization:
|
||||
*
|
||||
* template <>
|
||||
* struct xo::facet::FacetImplementation<ASequence, DRepr> {
|
||||
* using Impltype = ISequence_DRepr;
|
||||
* };
|
||||
*
|
||||
* then ISequence_ImplType<DRepr> --> ISequence_DRepr
|
||||
**/
|
||||
template <typename DRepr>
|
||||
using ISequence_ImplType = xo::facet::FacetImplType<ASequence, DRepr>;
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* */
|
||||
Loading…
Add table
Add a link
Reference in a new issue