diff options
author | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2016-10-21 15:18:54 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-10-22 12:45:17 +0100 |
commit | 4e92cf4e335fc97d830c4a7272ab143de0859f46 (patch) | |
tree | 8220eb246edece5a652258c02d3cd6af3860b261 | |
parent | Remove a layer of templating from hooks (diff) | |
download | slicer-4e92cf4e335fc97d830c4a7272ab143de0859f46.tar.bz2 slicer-4e92cf4e335fc97d830c4a7272ab143de0859f46.tar.xz slicer-4e92cf4e335fc97d830c4a7272ab143de0859f46.zip |
Neaten stream IO with typedefs
-rw-r--r-- | slicer/slicer/modelPartsTypes.impl.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index b3abc2c..259f642 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -46,10 +46,10 @@ namespace Slicer { typeWrite(::Ice::OutputStreamPtr & s, const ::IceUtil::Optional<T> & m) { typedef Ice::StreamableTraits<T> traits; + typedef Ice::StreamOptionalHelper<T, traits::helper, traits::fixedLength> SOH; s->startEncapsulation(); - if (m && s->writeOptional(0, - Ice::StreamOptionalHelper<T, traits::helper, traits::fixedLength>::optionalFormat)) { - Ice::StreamOptionalHelper<T, traits::helper, traits::fixedLength>::write(s.get(), *m); + if (m && s->writeOptional(0, SOH::optionalFormat)) { + SOH::write(s.get(), *m); } s->endEncapsulation(); } @@ -66,11 +66,11 @@ namespace Slicer { typeRead(::Ice::InputStreamPtr & s, ::IceUtil::Optional<T> & m) { typedef Ice::StreamableTraits<T> traits; + typedef Ice::StreamOptionalHelper<T, traits::helper, traits::fixedLength> SOH; s->startEncapsulation(); - if (s->readOptional(0, - Ice::StreamOptionalHelper<T, traits::helper, traits::fixedLength>::optionalFormat)) { + if (s->readOptional(0, SOH::optionalFormat)) { m.__setIsSet(); - Ice::StreamOptionalHelper<T, traits::helper, traits::fixedLength>::read(s.get(), *m); + SOH::read(s.get(), *m); } else { m = IceUtil::None; |