Skip to content

Commit

Permalink
Remove interface by value / operation on class leftovers (#2538)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier authored Jul 22, 2024
1 parent f21f6f4 commit 6bba3eb
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions cpp/src/slice2rb/RubyUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Slice::Ruby::CodeVisitor::visitInterfaceDecl(const InterfaceDeclPtr& p)
if (_classHistory.count(scoped) == 0)
{
string name = "T_" + fixIdent(p->name(), IdentToUpper);
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << "Prx)";
_out.inc();
_out << nl << name << "Prx = ::Ice::__declareProxy('" << scoped << "')";
_out.dec();
Expand All @@ -260,16 +260,9 @@ Slice::Ruby::CodeVisitor::visitInterfaceDecl(const InterfaceDeclPtr& p)
bool
Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << "_Mixin)";
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')';
_out.inc();

//
// Marker to avoid redefinitions, we don't use the actual class names at those might
// be defined by IceRuby for some internal classes
//
_out << sp << nl << "module " << getAbsolute(p, IdentToUpper) << "_Mixin";
_out << nl << "end";

string scoped = p->scoped();
string name = fixIdent(p->name(), IdentToUpper);
ClassDefPtr base = p->base();
Expand Down Expand Up @@ -442,16 +435,9 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
bool
Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
{
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << "_Mixin)";
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << "Prx)";
_out.inc();

//
// Marker to avoid redefinitions, we don't use the actual class names at those might
// be defined by IceRuby for some internal classes
//
_out << sp << nl << "module " << getAbsolute(p, IdentToUpper) << "_Mixin";
_out << nl << "end";

string scoped = p->scoped();
string name = fixIdent(p->name(), IdentToUpper);
InterfaceList bases = p->bases();
Expand Down Expand Up @@ -522,7 +508,6 @@ Slice::Ruby::CodeVisitor::visitInterfaceDefStart(const InterfaceDefPtr& p)
_out << "Prx";
_out << ')';
_out.inc();
_out << nl << "T_" << name << " = ::Ice::__declareClass('" << scoped << "')";
_out << nl << "T_" << name << "Prx = ::Ice::__declareProxy('" << scoped << "')";
_out.dec();
_out << nl << "end";
Expand Down

0 comments on commit 6bba3eb

Please sign in to comment.