summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/PythonUtil.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2006-08-09 22:56:27 +0000
committerMark Spruiell <mes@zeroc.com>2006-08-09 22:56:27 +0000
commit672a123736533ef62ba958bf9ccee8d59a3b79fc (patch)
tree528f1025b3a6e5ed47af2df5813ef0e85057bb44 /cpp/src/Slice/PythonUtil.cpp
parentfixing bug in IceSSL.VerifyPeer description (diff)
downloadice-672a123736533ef62ba958bf9ccee8d59a3b79fc.tar.bz2
ice-672a123736533ef62ba958bf9ccee8d59a3b79fc.tar.xz
ice-672a123736533ef62ba958bf9ccee8d59a3b79fc.zip
bug 1257: deprecate nonmutating
Diffstat (limited to 'cpp/src/Slice/PythonUtil.cpp')
-rw-r--r--cpp/src/Slice/PythonUtil.cpp41
1 files changed, 27 insertions, 14 deletions
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index a45f817878c..7c15db5b4b4 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -121,6 +121,11 @@ private:
//
void writeHash(const string&, const TypePtr&, int&);
+ //
+ // Convert an operation mode into a string.
+ //
+ string getOperationMode(Slice::Operation::Mode);
+
struct MemberInfo
{
string fixedName;
@@ -764,20 +769,9 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
ParamDeclList::iterator t;
int count;
- _out << nl << name << "._op_" << (*s)->name() << " = IcePy.Operation('" << (*s)->name() << "', ";
- switch((*s)->mode())
- {
- case Operation::Normal:
- _out << "Ice.OperationMode.Normal";
- break;
- case Operation::Nonmutating:
- _out << "Ice.OperationMode.Nonmutating";
- break;
- case Operation::Idempotent:
- _out << "Ice.OperationMode.Idempotent";
- break;
- }
- _out << ", " << ((p->hasMetaData("amd") || (*s)->hasMetaData("amd")) ? "True" : "False") << ", (";
+ _out << nl << name << "._op_" << (*s)->name() << " = IcePy.Operation('" << (*s)->name() << "', "
+ << getOperationMode((*s)->mode()) << ", " << getOperationMode((*s)->sendMode()) << ", "
+ << ((p->hasMetaData("amd") || (*s)->hasMetaData("amd")) ? "True" : "False") << ", (";
for(t = params.begin(), count = 0; t != params.end(); ++t)
{
if(!(*t)->isOutParam())
@@ -1611,6 +1605,25 @@ Slice::Python::CodeVisitor::writeHash(const string& name, const TypePtr& p, int&
_out << nl << "_h = 5 * _h + __builtin__.hash(" << name << ")";
}
+string
+Slice::Python::CodeVisitor::getOperationMode(Slice::Operation::Mode mode)
+{
+ string result;
+ switch(mode)
+ {
+ case Operation::Normal:
+ result = "Ice.OperationMode.Normal";
+ break;
+ case Operation::Nonmutating:
+ result = "Ice.OperationMode.Nonmutating";
+ break;
+ case Operation::Idempotent:
+ result = "Ice.OperationMode.Idempotent";
+ break;
+ }
+ return result;
+}
+
void
Slice::Python::CodeVisitor::collectClassMembers(const ClassDefPtr& p, MemberInfoList& allMembers, bool inherited)
{