summaryrefslogtreecommitdiff
path: root/cpp/src/slice2matlab/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/slice2matlab/Main.cpp')
-rw-r--r--cpp/src/slice2matlab/Main.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/cpp/src/slice2matlab/Main.cpp b/cpp/src/slice2matlab/Main.cpp
index 798808fdfab..ed242dfbcb5 100644
--- a/cpp/src/slice2matlab/Main.cpp
+++ b/cpp/src/slice2matlab/Main.cpp
@@ -696,7 +696,12 @@ CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
IceUtilInternal::Output out;
openClass(abs, out);
- out << nl << "classdef " << name;
+ out << nl << "classdef ";
+ if(p->isLocal() && !p->allOperations().empty())
+ {
+ out << "(Abstract) ";
+ }
+ out << name;
if(base)
{
out << " < " << getAbsolute(base);
@@ -705,6 +710,10 @@ CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
out << " < Ice.Value";
}
+ else
+ {
+ out << " < matlab.mixin.Copyable";
+ }
out.inc();
@@ -1017,6 +1026,47 @@ CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
out << nl << "end";
}
}
+ else
+ {
+ const OperationList ops = p->operations();
+ if(!ops.empty())
+ {
+ out << nl << "methods(Abstract)";
+ out.inc();
+ for(OperationList::const_iterator q = ops.begin(); q != ops.end(); ++q)
+ {
+ OperationPtr op = *q;
+ const ParamInfoList outParams = getAllOutParams(op);
+ out << nl;
+ if(outParams.size() > 1)
+ {
+ out << "[";
+ for(ParamInfoList::const_iterator r = outParams.begin(); r != outParams.end(); ++r)
+ {
+ if(r != outParams.begin())
+ {
+ out << ", ";
+ }
+ out << r->fixedName;
+ }
+ out << "] = ";
+ }
+ else if(outParams.size() == 1)
+ {
+ out << outParams.begin()->fixedName << " = ";
+ }
+ out << fixIdent(op->name()) << spar << "obj_";
+ const ParamInfoList inParams = getAllInParams(op);
+ for(ParamInfoList::const_iterator r = inParams.begin(); r != inParams.end(); ++r)
+ {
+ out << r->fixedName;
+ }
+ out << epar;
+ }
+ out.dec();
+ out << nl << "end";
+ }
+ }
out.dec();
out << nl << "end";