[xsde-users] using same TypeNames in different NameSpaces in inheritance chain

Песоцкий Максим aazmp at yandex.ru
Mon Dec 17 13:27:38 EST 2018


Hi

12.12.2018, 18:15, "Boris Kolpackov" <boris at codesynthesis.com>:
> One thing you may want to
> try is switch to the mix-in reuse and see if that makes any
> difference.

with MIXIN there is a similar error, derived element tries to call <BaseClass>::pre(), but calls its own (because its name has overriden base) and recursion begins


if i understood correctly
it is not a bug in compiler, just probably unfortunate "choice" of C++ constructions to call to sskel elements

in case of TIEIN version

this->{ElemType}_impl overrides base one with the same name

to generate example from previous message
int ElemType_sskel::
a1 ()
{
  assert (this->ElemType_impl_); // <---- here this->ElemType_impl_ == 0x0
  return this->ElemType_impl_->a1 ();
}

code from cxx/serializer/serializer-source.cxx : starting around line 150 is used

if (ret != L"void")
{
  String const& name (ename (e));

   os << ret << " " << scope_ << "::" << endl
        << name << " ()"
       << "{"
         << "assert (this->" << impl << ");"
        << "return this->" << impl << "->" << name << " ();"
        << "}";
   }

Probably replacing "assert (this->" << impl << ");"
with something like
"assert (" << SCOPE_UNROLL(e.scope()) << impl << ");"
where SCOPE_UNROLLED is formed through series of calls

String SCOPE_UNROLL(Node e) {
 if (e.scope().named_p()) {
   return SCOPE_UNROLL(e.scope()) + "::" + e.scope().name();
 } 
 else {
   return "";
 }
}

will try to test this

  










More information about the xsde-users mailing list