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 /cpp/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 'cpp/src')
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 8 | ||||
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 23 | ||||
-rw-r--r-- | cpp/src/Ice/IncomingAsync.cpp | 7 | ||||
-rw-r--r-- | cpp/src/Ice/Object.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Outgoing.cpp | 16 | ||||
-rw-r--r-- | cpp/src/Ice/OutgoingAsync.cpp | 16 | ||||
-rw-r--r-- | cpp/src/Ice/Proxy.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/ProxyFactory.cpp | 10 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/ReferenceFactory.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/TraceUtil.cpp | 9 |
11 files changed, 55 insertions, 44 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index df79c5b2e4c..08cb2560e6b 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -1378,7 +1378,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); @@ -1386,13 +1386,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); @@ -1402,7 +1402,7 @@ IceInternal::BasicStream::read(vector<string>& v) v.resize(sz); for(int j = 0; j < sz; ++j) { - read(v[j]); + read(v[j], convert); checkSeq(); endElement(); } diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 3abcc951a6e..a4e9a31eb7b 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -84,7 +84,8 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) // // Read the current. // - _current.id.__read(&_is); + _is.read(_current.id.name, false); + _is.read(_current.id.category, false); // // For compatibility with the old FacetPath. @@ -92,7 +93,7 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) string facet; { vector<string> facetPath; - _is.read(facetPath); + _is.read(facetPath, false); if(!facetPath.empty()) { if(facetPath.size() > 1) @@ -115,8 +116,8 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) 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); } @@ -234,18 +235,19 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) 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); @@ -494,18 +496,19 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager) _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/cpp/src/Ice/IncomingAsync.cpp b/cpp/src/Ice/IncomingAsync.cpp index 701883b185a..d8c1f573a6a 100644 --- a/cpp/src/Ice/IncomingAsync.cpp +++ b/cpp/src/Ice/IncomingAsync.cpp @@ -142,18 +142,19 @@ IceInternal::IncomingAsync::__exception(const Exception& exc) 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); diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 01947c3112f..86795e52747 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -120,7 +120,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/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp index f14425f5a21..54bb64d61f6 100644 --- a/cpp/src/Ice/Outgoing.cpp +++ b/cpp/src/Ice/Outgoing.cpp @@ -73,19 +73,20 @@ IceInternal::Outgoing::Outgoing(ConnectionI* connection, Reference* ref, const s try { - _reference->getIdentity().__write(&_os); + _os.write(_reference->getIdentity().name, false); + _os.write(_reference->getIdentity().category, false); // // For compatibility with the old FacetPath. // if(_reference->getFacet().empty()) { - _os.write(static_cast<string*>(0), static_cast<string*>(0)); + _os.write(static_cast<string*>(0), static_cast<string*>(0), false); } else { string facet = _reference->getFacet(); - _os.write(&facet, &facet + 1); + _os.write(&facet, &facet + 1, false); } _os.write(operation, false); @@ -96,8 +97,8 @@ IceInternal::Outgoing::Outgoing(ConnectionI* connection, Reference* ref, const s Context::const_iterator p; for(p = context.begin(); p != context.end(); ++p) { - _os.write(p->first); - _os.write(p->second); + _os.write(p->first, false); + _os.write(p->second, false); } // @@ -340,13 +341,14 @@ IceInternal::Outgoing::finished(BasicStream& is) // exception, you will have a memory leak. // Identity ident; - ident.__read(&_is); + _is.read(ident.name, false); + _is.read(ident.category, false); // // For compatibility with the old FacetPath. // vector<string> facetPath; - _is.read(facetPath); + _is.read(facetPath, false); string facet; if(!facetPath.empty()) { diff --git a/cpp/src/Ice/OutgoingAsync.cpp b/cpp/src/Ice/OutgoingAsync.cpp index 2798bf41cb7..71a97a5ebf6 100644 --- a/cpp/src/Ice/OutgoingAsync.cpp +++ b/cpp/src/Ice/OutgoingAsync.cpp @@ -75,13 +75,14 @@ IceInternal::OutgoingAsync::__finished(BasicStream& is) case DispatchOperationNotExist: { Identity ident; - ident.__read(__is); + __is->read(ident.name, false); + __is->read(ident.category, false); // // For compatibility with the old FacetPath. // vector<string> facetPath; - __is->read(facetPath); + __is->read(facetPath, false); string facet; if(!facetPath.empty()) { @@ -289,19 +290,20 @@ IceInternal::OutgoingAsync::__prepare(const ObjectPrx& prx, const string& operat __os->writeBlob(requestHdr, sizeof(requestHdr)); - ref->getIdentity().__write(__os); + __os->write(ref->getIdentity().name, false); + __os->write(ref->getIdentity().category, false); // // For compatibility with the old FacetPath. // if(ref->getFacet().empty()) { - __os->write(static_cast<string*>(0), static_cast<string*>(0)); + __os->write(static_cast<string*>(0), static_cast<string*>(0), false); } else { string facet = ref->getFacet(); - __os->write(&facet, &facet + 1); + __os->write(&facet, &facet + 1, false); } __os->write(operation, false); @@ -312,8 +314,8 @@ IceInternal::OutgoingAsync::__prepare(const ObjectPrx& prx, const string& operat Context::const_iterator p; for(p = context.begin(); p != context.end(); ++p) { - __os->write(p->first); - __os->write(p->second); + __os->write(p->first, false); + __os->write(p->second, false); } __os->startWriteEncaps(); diff --git a/cpp/src/Ice/Proxy.cpp b/cpp/src/Ice/Proxy.cpp index c57f30d1e7b..1611c953f29 100644 --- a/cpp/src/Ice/Proxy.cpp +++ b/cpp/src/Ice/Proxy.cpp @@ -1170,7 +1170,7 @@ IceDelegateM::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/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp index 8bf47bd1952..7d106c1f99a 100644 --- a/cpp/src/Ice/ProxyFactory.cpp +++ b/cpp/src/Ice/ProxyFactory.cpp @@ -51,7 +51,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); @@ -62,13 +63,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/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 47349915519..30dbde018d3 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -157,11 +157,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/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index d22aa8b3717..734fb141d8c 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -537,7 +537,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/cpp/src/Ice/TraceUtil.cpp b/cpp/src/Ice/TraceUtil.cpp index 5e59d19fe5c..9d049caf56e 100644 --- a/cpp/src/Ice/TraceUtil.cpp +++ b/cpp/src/Ice/TraceUtil.cpp @@ -28,11 +28,12 @@ static void printIdentityFacetOperation(ostream& s, BasicStream& stream) { Identity identity; - identity.__read(&stream); + stream.read(identity.name, false); + stream.read(identity.category, false); s << "\nidentity = " << identity; vector<string> facet; - stream.read(facet); + stream.read(facet, false); s << "\nfacet = "; if(!facet.empty()) { @@ -85,8 +86,8 @@ printRequestHeader(ostream& s, BasicStream& stream) while(sz--) { pair<string, string> pair; - stream.read(pair.first); - stream.read(pair.second); + stream.read(pair.first, false); + stream.read(pair.second, false); s << pair.first << '/' << pair.second; if(sz) { |