xo-facet xo-gc xo-alloc2: facet cleanup + use genfacet for GCObject
This commit is contained in:
parent
bf4f9c90ab
commit
acdb10b9b1
5 changed files with 26 additions and 5 deletions
|
|
@ -21,6 +21,10 @@
|
|||
#include <xo/facet/facet_implementation.hpp>
|
||||
#include <xo/facet/typeseq.hpp>
|
||||
|
||||
{% for line in facet_pretext %}
|
||||
{{line}}
|
||||
{% endfor %}
|
||||
|
||||
namespace {{facet_ns1}} {
|
||||
namespace {{facet_ns2}} {
|
||||
|
||||
|
|
@ -85,4 +89,4 @@ using {{iface_facet_impltype}} = xo::facet::FacetImplType<{{abstract_facet}}, DR
|
|||
} /*namespace {{facet_ns2}}*/
|
||||
} /*namespace {{facet_ns1}}*/
|
||||
|
||||
/* {{abstract_face_fname}} */
|
||||
/* {{abstract_facet_fname}} */
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ def format_method_qualifiers(method):
|
|||
return ' '.join(quals)
|
||||
|
||||
def format_method_staticqual(method):
|
||||
""" Build qualifier string for a static method: noexcet
|
||||
""" Build qualifier string for a static method: noexcept
|
||||
"""
|
||||
quals = []
|
||||
if method.get('noexcept', False):
|
||||
|
|
@ -93,6 +93,8 @@ def gen_facet(env,
|
|||
|
||||
# extra include files (or perhaps other definitions)
|
||||
facet_includes = idl['includes']
|
||||
# arbitrary text after includes, before opening namespaces
|
||||
facet_pretext = idl['pretext']
|
||||
# detail
|
||||
facet_detail_subdir = idl['detail_subdir']
|
||||
facet_ns1 = idl['namespace1']
|
||||
|
|
@ -156,6 +158,7 @@ def gen_facet(env,
|
|||
#
|
||||
'facet_hpp_j2': 'facet.hpp.j2',
|
||||
'facet_includes': facet_includes,
|
||||
'facet_pretext': facet_pretext,
|
||||
'facet_ns1': facet_ns1,
|
||||
'facet_ns2': facet_ns2,
|
||||
'facet_name_lc': facet_name_lc,
|
||||
|
|
|
|||
|
|
@ -32,6 +32,17 @@ bool
|
|||
{{iface_facet_any}}::_valid
|
||||
= valid_facet_implementation<{{abstract_facet}}, {{iface_facet_any}}>();
|
||||
|
||||
// nonconst methods
|
||||
|
||||
{% for md in nonconst_methods %}
|
||||
auto
|
||||
{{iface_facet_any}}::{{md.name}}({{md.args | argtypes}}) {{md | qualifiers}} -> {{md.return_type}}
|
||||
{
|
||||
_fatal();
|
||||
}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
} /*namespace {{facet_ns2}}*/
|
||||
} /*namespace {{facet_ns1}}*/
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace {{facet_ns2}} {
|
|||
|
||||
// nonconst methods
|
||||
{% for md in nonconst_methods %}
|
||||
[[noreturn]] {{md.return_type}} {{md.name}}({{md.args | argtypes}}) {{md | qualifiers}} override { _fatal(); }
|
||||
[[noreturn]] {{md.return_type}} {{md.name}}({{md.args | argtypes}}) {{md | qualifiers}} override;
|
||||
{% endfor %}
|
||||
|
||||
{% if using_dox %}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,11 @@ public:
|
|||
{% endfor %}
|
||||
|
||||
// non-const methods
|
||||
// << do something for non-const methods >>
|
||||
//
|
||||
{% for md in nonconst_methods %}
|
||||
{{md.return_type}} {{md.name}}({{md.args | argsnodata}}) {{md | staticqual}} {
|
||||
return O::iface()->{{md.name}}({{md.args | argrouting}});
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
{% if using_dox %}
|
||||
///@}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue