summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2012-09-24 17:01:05 -0400
committerBernard Normier <bernard@zeroc.com>2012-09-24 17:01:05 -0400
commitcc15ebed97ad43d9f2b04e73c8555ac4b2a3a0a3 (patch)
treeccf84d02fe6defae4995259028d4bacd4a403ee4 /cpp/src/slice2cpp/Gen.cpp
parentPartial fix for ICE-3393: (diff)
downloadice-cc15ebed97ad43d9f2b04e73c8555ac4b2a3a0a3.tar.bz2
ice-cc15ebed97ad43d9f2b04e73c8555ac4b2a3a0a3.tar.xz
ice-cc15ebed97ad43d9f2b04e73c8555ac4b2a3a0a3.zip
Replaced optionalType in StreamTrait<> by a bool fixedLength member
and updated slice2cpp accordingly No longer rely on assert / static_assert to detect incorrect use of base StreamOptionalHelper: now, the code no longer compiles vector<bool> is now handled like a built-in type: InputStream and OutputStream have now read / write vector<bool>& functions. The default implementation (StreamI) simply delegates to the same functions on BasicStream.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rw-r--r--cpp/src/slice2cpp/Gen.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index d67d8aa3256..e46b5aeae43 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -6096,20 +6096,20 @@ Slice::Gen::StreamVisitor::visitStructStart(const StructPtr& p)
H << sb;
if(classMetaData)
{
- H << nl << "static const ::Ice::StreamTraitType type = ::Ice::StreamTraitTypeStructClass;";
+ H << nl << "static const StreamTraitType type = StreamTraitTypeStructClass;";
}
else
{
- H << nl << "static const ::Ice::StreamTraitType type = ::Ice::StreamTraitTypeStruct;";
+ H << nl << "static const StreamTraitType type = StreamTraitTypeStruct;";
}
H << nl << "static const int minWireSize = " << p->minWireSize() << ";";
if(p->isVariableLength())
{
- H << nl << "static const ::Ice::OptionalType optionalType = ::Ice::OptionalTypeFSize;";
+ H << nl << "static const bool fixedLength = false;";
}
else
{
- H << nl << "static const ::Ice::OptionalType optionalType = ::Ice::OptionalTypeVSize;";
+ H << nl << "static const bool fixedLength = true;";
}
H << eb << ";" << nl;
}
@@ -6123,10 +6123,10 @@ Slice::Gen::StreamVisitor::visitEnum(const EnumPtr& p)
H << nl << "template<>";
H << nl << "struct StreamTrait< " << scoped << ">";
H << sb;
- H << nl << "static const ::Ice::StreamTraitType type = ::Ice::StreamTraitTypeEnum;";
+ H << nl << "static const StreamTraitType type = StreamTraitTypeEnum;";
H << nl << "static const int enumLimit = " << p->getEnumerators().size() << ";";
H << nl << "static const int minWireSize = " << p->minWireSize() << ";";
- H << nl << "static const ::Ice::OptionalType optionalType = ::Ice::OptionalTypeSize;";
+ H << nl << "static const bool fixedLength = false;";
H << eb << ";" << nl;
}