summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/PythonUtil.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2012-05-08 18:14:39 -0700
committerMark Spruiell <mes@zeroc.com>2012-05-08 18:14:39 -0700
commit7774bb92669779fd165a0510a360fdaecd69f0c3 (patch)
tree8ea8bba6cac4128cd3e511ff21534db130ff8e49 /cpp/src/Slice/PythonUtil.cpp
parentFixed ICE-4709, batch requests and UnmarshalOutOfBoundsException (diff)
downloadice-7774bb92669779fd165a0510a360fdaecd69f0c3.tar.bz2
ice-7774bb92669779fd165a0510a360fdaecd69f0c3.tar.xz
ice-7774bb92669779fd165a0510a360fdaecd69f0c3.zip
* C++ implementation for compact/sliced formats
* C++ implementation for "preserve-slice" metadata * C++ tests for compact/sliced/preserved types * Updated stream API * Python changes for stream API * Python tests for compact/sliced formats * Added Ice.Default.SlicedFormat property
Diffstat (limited to 'cpp/src/Slice/PythonUtil.cpp')
-rwxr-xr-xcpp/src/Slice/PythonUtil.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index 7bdffa8b2c6..fada4154502 100755
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -796,7 +796,8 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
DataMemberList members = p->dataMembers();
_out << sp << nl << "_M_" << type << " = IcePy.defineClass('" << scoped << "', " << name << ", ";
writeMetaData(p->getMetaData());
- _out << ", " << (isAbstract ? "True" : "False") << ", ";
+ _out << ", " << (isAbstract ? "True" : "False") << ", " << (p->hasMetaData("preserve-slice") ? "True" : "False")
+ << ", ";
if(!base)
{
_out << "None";
@@ -890,10 +891,24 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
ParamDeclList params = (*s)->parameters();
ParamDeclList::iterator t;
int count;
+ string format;
+ switch((*s)->format())
+ {
+ case DefaultFormat:
+ format = "None";
+ break;
+ case CompactFormat:
+ format = "Ice.FormatType.CompactFormat";
+ break;
+ case SlicedFormat:
+ format = "Ice.FormatType.SlicedFormat";
+ break;
+ }
_out << nl << name << "._op_" << (*s)->name() << " = IcePy.Operation('" << (*s)->name() << "', "
<< getOperationMode((*s)->mode()) << ", " << getOperationMode((*s)->sendMode()) << ", "
- << ((p->hasMetaData("amd") || (*s)->hasMetaData("amd")) ? "True" : "False") << ", ";
+ << ((p->hasMetaData("amd") || (*s)->hasMetaData("amd")) ? "True" : "False") << ", "
+ << format << ", ";
writeMetaData((*s)->getMetaData());
_out << ", (";
for(t = params.begin(), count = 0; t != params.end(); ++t)
@@ -1091,7 +1106,7 @@ Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
string type = getAbsolute(p, "_t_");
_out << sp << nl << "_M_" << type << " = IcePy.defineException('" << scoped << "', " << name << ", ";
writeMetaData(p->getMetaData());
- _out << ", ";
+ _out << ", " << (p->hasMetaData("preserve-slice") ? "True" : "False") << ", ";
if(!base)
{
_out << "None";