xo-alloc/xo-facet/codegen/iface_facet_any.cpp.j2

49 lines
1.1 KiB
Django/Jinja

/** @file {{iface_facet_any_cpp_fname}}
*
**/
#include "{{impl_hpp_subdir}}/{{iface_facet_any_hpp_fname}}"
#include <iostream>
namespace {{facet_ns1}} {
namespace {{facet_ns2}} {
using xo::facet::DVariantPlaceholder;
using xo::facet::typeseq;
using xo::facet::valid_facet_implementation;
void
{{iface_facet_any}}::_fatal()
{
/* control here on uninitialized IAllocator_Any.
* Initialized instance will have specific implementation type
*/
std::cerr << "fatal"
<< ": attempt to call uninitialized"
<< " {{iface_facet_any}} method"
<< std::endl;
std::terminate();
}
typeseq
{{iface_facet_any}}::s_typeseq = typeseq::id<DVariantPlaceholder>();
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}}*/
/* end {{iface_facet_any_cpp_fname}} */