summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/RubyUtil.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2007-04-24 10:38:43 +0000
committerBenoit Foucher <benoit@zeroc.com>2007-04-24 10:38:43 +0000
commitebda7237e5347463bd9011aa5b70774015484d33 (patch)
tree802b0193c7c8bb39afd26a5e2b47d3e600e0b5fd /cpp/src/Slice/RubyUtil.cpp
parentAdded test for marshalling/unmarshalling interfaces (diff)
downloadice-ebda7237e5347463bd9011aa5b70774015484d33.tar.bz2
ice-ebda7237e5347463bd9011aa5b70774015484d33.tar.xz
ice-ebda7237e5347463bd9011aa5b70774015484d33.zip
Generate class in addition to mixin for interface definition
Diffstat (limited to 'cpp/src/Slice/RubyUtil.cpp')
-rw-r--r--cpp/src/Slice/RubyUtil.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index 839c04a370c..3a91b2b9184 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -367,7 +367,18 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out.dec();
_out << nl << "end"; // End of mix-in module for class.
- if(!p->isInterface())
+ if(p->isInterface())
+ {
+ //
+ // Class.
+ //
+ _out << nl << "class " << name;
+ _out.inc();
+ _out << nl << "include " << name << "_mixin";
+ _out.dec();
+ _out << nl << "end";
+ }
+ else
{
//
// Class.
@@ -535,7 +546,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "end";
_classHistory.insert(scoped); // Avoid redundant declarations.
- _out << sp << nl << "T_" << name << ".defineClass(" << (p->isInterface() ? string("nil") : name) << ", "
+ _out << sp << nl << "T_" << name << ".defineClass(" << name << ", "
<< (p->isAbstract() ? "true" : "false") << ", ";
if(!base)
{