diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2006-05-02 17:54:37 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2006-05-02 17:54:37 +0000 |
commit | fc39e42505a8ffd72ce942dcc3e95c05e8c6d9b2 (patch) | |
tree | 18b8689b8fd5ad29c46281dee27ad3cc7faffefe /cppe/src | |
parent | removing client/server separation (diff) | |
download | ice-fc39e42505a8ffd72ce942dcc3e95c05e8c6d9b2.tar.bz2 ice-fc39e42505a8ffd72ce942dcc3e95c05e8c6d9b2.tar.xz ice-fc39e42505a8ffd72ce942dcc3e95c05e8c6d9b2.zip |
More string converter optimizations
Diffstat (limited to 'cppe/src')
-rw-r--r-- | cppe/src/IceE/BasicStream.cpp | 8 | ||||
-rw-r--r-- | cppe/src/IceE/Incoming.cpp | 20 | ||||
-rw-r--r-- | cppe/src/IceE/Object.cpp | 2 | ||||
-rw-r--r-- | cppe/src/IceE/Outgoing.cpp | 9 | ||||
-rw-r--r-- | cppe/src/IceE/Proxy.cpp | 2 | ||||
-rw-r--r-- | cppe/src/IceE/ProxyFactory.cpp | 10 | ||||
-rw-r--r-- | cppe/src/IceE/Reference.cpp | 4 | ||||
-rw-r--r-- | cppe/src/IceE/ReferenceFactory.cpp | 2 | ||||
-rw-r--r-- | cppe/src/IceE/TraceUtil.cpp | 5 |
9 files changed, 34 insertions, 28 deletions
diff --git a/cppe/src/IceE/BasicStream.cpp b/cppe/src/IceE/BasicStream.cpp index 53eb8e89c94..efd4036ceb7 100644 --- a/cppe/src/IceE/BasicStream.cpp +++ b/cppe/src/IceE/BasicStream.cpp @@ -1349,7 +1349,7 @@ IceInternal::BasicStream::writeConverted(const string& v) } void -IceInternal::BasicStream::write(const string* begin, const string* end) +IceInternal::BasicStream::write(const string* begin, const string* end, bool convert) { Int sz = static_cast<Int>(end - begin); writeSize(sz); @@ -1357,13 +1357,13 @@ IceInternal::BasicStream::write(const string* begin, const string* end) { for(int i = 0; i < sz; ++i) { - write(begin[i]); + write(begin[i], convert); } } } void -IceInternal::BasicStream::read(vector<string>& v) +IceInternal::BasicStream::read(vector<string>& v, bool convert) { Int sz; readSize(sz); @@ -1373,7 +1373,7 @@ IceInternal::BasicStream::read(vector<string>& v) v.resize(sz); for(int i = 0; i < sz; ++i) { - read(v[i]); + read(v[i], convert); checkSeq(); endElement(); } diff --git a/cppe/src/IceE/Incoming.cpp b/cppe/src/IceE/Incoming.cpp index 881a7721873..ffa43b42165 100644 --- a/cppe/src/IceE/Incoming.cpp +++ b/cppe/src/IceE/Incoming.cpp @@ -97,7 +97,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) { throw MarshalException(__FILE__, __LINE__); } - _is.read(_current.facet); + _is.read(_current.facet, false); } else { @@ -114,8 +114,8 @@ IceInternal::Incoming::invoke(bool response, Int requestId) while(sz--) { pair<const string, string> pr; - _is.read(const_cast<string&>(pr.first)); - _is.read(pr.second); + _is.read(const_cast<string&>(pr.first), false); + _is.read(pr.second, false); _current.ctx.insert(_current.ctx.end(), pr); } @@ -206,18 +206,19 @@ IceInternal::Incoming::invoke(bool response, Int requestId) assert(false); } - ex.id.__write(&_os); + _os.write(ex.id.name, false); + _os.write(ex.id.category, false); // // For compatibility with the old FacetPath. // if(ex.facet.empty()) { - _os.write(static_cast<string*>(0), static_cast<string*>(0)); + _os.write(static_cast<string*>(0), static_cast<string*>(0), false); } else { - _os.write(&ex.facet, &ex.facet + 1); + _os.write(&ex.facet, &ex.facet + 1, false); } _os.write(ex.operation, false); @@ -446,18 +447,19 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(status)); - _current.id.__write(&_os); + _os.write(_current.id.name, false); + _os.write(_current.id.category, false); // // For compatibility with the old FacetPath. // if(_current.facet.empty()) { - _os.write(static_cast<string*>(0), static_cast<string*>(0)); + _os.write(static_cast<string*>(0), static_cast<string*>(0), false); } else { - _os.write(&_current.facet, &_current.facet + 1); + _os.write(&_current.facet, &_current.facet + 1, false); } _os.write(_current.operation, false); diff --git a/cppe/src/IceE/Object.cpp b/cppe/src/IceE/Object.cpp index 94f8c1b628a..7d9aeff9764 100644 --- a/cppe/src/IceE/Object.cpp +++ b/cppe/src/IceE/Object.cpp @@ -108,7 +108,7 @@ Ice::Object::___ice_ids(Incoming& __inS, const Current& __current) { BasicStream* __os = __inS.os(); vector<string> __ret = ice_ids(__current); - __os->write(&__ret[0], &__ret[0] + __ret.size()); + __os->write(&__ret[0], &__ret[0] + __ret.size(), false); return DispatchOK; } diff --git a/cppe/src/IceE/Outgoing.cpp b/cppe/src/IceE/Outgoing.cpp index dbc5b355577..d9a4c1bf69d 100644 --- a/cppe/src/IceE/Outgoing.cpp +++ b/cppe/src/IceE/Outgoing.cpp @@ -104,8 +104,8 @@ IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const st Context::const_iterator p; for(p = context.begin(); p != context.end(); ++p) { - _stream.write(p->first); - _stream.write(p->second); + _stream.write(p->first, false); + _stream.write(p->second, false); } // @@ -291,13 +291,14 @@ IceInternal::Outgoing::finished(BasicStream& is) // exception, you will have a memory leak. // Identity ident; - ident.__read(&_stream); + _stream.read(ident.name, false); + _stream.read(ident.category, false); // // For compatibility with the old FacetPath. // vector<string> facetPath; - _stream.read(facetPath); + _stream.read(facetPath, false); string facet; if(!facetPath.empty()) { diff --git a/cppe/src/IceE/Proxy.cpp b/cppe/src/IceE/Proxy.cpp index b9794b49b3c..3d5aceb24e8 100644 --- a/cppe/src/IceE/Proxy.cpp +++ b/cppe/src/IceE/Proxy.cpp @@ -331,7 +331,7 @@ IceProxy::Ice::Object::ice_ids(const Context& __context) throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); } } - __is->read(__ret); + __is->read(__ret, false); } catch(const ::Ice::LocalException& __ex) { diff --git a/cppe/src/IceE/ProxyFactory.cpp b/cppe/src/IceE/ProxyFactory.cpp index e0b11a8a4b9..819714945be 100644 --- a/cppe/src/IceE/ProxyFactory.cpp +++ b/cppe/src/IceE/ProxyFactory.cpp @@ -52,7 +52,8 @@ ObjectPrx IceInternal::ProxyFactory::streamToProxy(BasicStream* s) const { Identity ident; - ident.__read(s); + s->read(ident.name, false); + s->read(ident.category, false); ReferencePtr ref = _instance->referenceFactory()->create(ident, s); return referenceToProxy(ref); @@ -63,13 +64,14 @@ IceInternal::ProxyFactory::proxyToStream(const ObjectPrx& proxy, BasicStream* s) { if(proxy) { - proxy->__reference()->getIdentity().__write(s); + s->write(proxy->__reference()->getIdentity().name, false); + s->write(proxy->__reference()->getIdentity().category, false); proxy->__reference()->streamWrite(s); } else { - Identity ident; - ident.__write(s); + s->write("", false); // name + s->write("", false); // category } } diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp index 166703586f0..a09ba20b997 100644 --- a/cppe/src/IceE/Reference.cpp +++ b/cppe/src/IceE/Reference.cpp @@ -160,11 +160,11 @@ IceInternal::Reference::streamWrite(BasicStream* s) const // if(_facet.empty()) { - s->write(static_cast<string*>(0), static_cast<string*>(0)); + s->write(static_cast<string*>(0), static_cast<string*>(0), false); } else { - s->write(&_facet, &_facet + 1); + s->write(&_facet, &_facet + 1, false); } s->write(static_cast<Byte>(_mode)); diff --git a/cppe/src/IceE/ReferenceFactory.cpp b/cppe/src/IceE/ReferenceFactory.cpp index d7ce7e8457f..13b5cc55e2e 100644 --- a/cppe/src/IceE/ReferenceFactory.cpp +++ b/cppe/src/IceE/ReferenceFactory.cpp @@ -579,7 +579,7 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s) // For compatibility with the old FacetPath. // vector<string> facetPath; - s->read(facetPath); + s->read(facetPath, false); string facet; if(!facetPath.empty()) { diff --git a/cppe/src/IceE/TraceUtil.cpp b/cppe/src/IceE/TraceUtil.cpp index 1146686af13..a69b8271a14 100644 --- a/cppe/src/IceE/TraceUtil.cpp +++ b/cppe/src/IceE/TraceUtil.cpp @@ -26,12 +26,13 @@ static void printIdentityFacetOperation(string& s, BasicStream& stream) { Identity identity; - identity.__read(&stream); + stream.read(identity.name, false); + stream.read(identity.category, false); s += "\nidentity = "; s += identityToString(identity); vector<string> facet; - stream.read(facet); + stream.read(facet, false); s += "\nfacet = "; if(!facet.empty()) { |