summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Reference.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-11-23 06:41:43 +0000
committerMichi Henning <michi@zeroc.com>2004-11-23 06:41:43 +0000
commit4b1677236d069083ff06db22d5d54f598a318b19 (patch)
tree1fd61c97723efc698955aee76f28adc0813c222c /cpp/src/Ice/Reference.cpp
parentFixed icecs path (diff)
downloadice-4b1677236d069083ff06db22d5d54f598a318b19.tar.bz2
ice-4b1677236d069083ff06db22d5d54f598a318b19.tar.xz
ice-4b1677236d069083ff06db22d5d54f598a318b19.zip
Minor cleanup of the Reference refactoring.
Diffstat (limited to 'cpp/src/Ice/Reference.cpp')
-rw-r--r--cpp/src/Ice/Reference.cpp287
1 files changed, 150 insertions, 137 deletions
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index fd065f46f40..ef804c1b5f7 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -35,89 +35,89 @@ void IceInternal::decRef(IceInternal::Reference* p) { p->__decRef(); }
ReferencePtr
IceInternal::Reference::changeMode(Mode newMode) const
{
- if(newMode == mode)
+ if(newMode == _mode)
{
return ReferencePtr(const_cast<Reference*>(this));
}
- ReferencePtr r = instance->referenceFactory()->clone(this);
- r->mode = newMode;
+ ReferencePtr r = _instance->referenceFactory()->copy(this);
+ r->_mode = newMode;
return r;
}
ReferencePtr
IceInternal::Reference::changeIdentity(const Identity& newIdentity) const
{
- if(newIdentity == identity)
+ if(newIdentity == _identity)
{
return ReferencePtr(const_cast<Reference*>(this));
}
- ReferencePtr r = instance->referenceFactory()->clone(this);
- r->identity = newIdentity;
+ ReferencePtr r = _instance->referenceFactory()->copy(this);
+ r->_identity = newIdentity;
return r;
}
ReferencePtr
IceInternal::Reference::changeContext(const Context& newContext) const
{
- if(newContext == context)
+ if(newContext == _context)
{
return ReferencePtr(const_cast<Reference*>(this));
}
- ReferencePtr r = instance->referenceFactory()->clone(this);
- r->context = newContext;
+ ReferencePtr r = _instance->referenceFactory()->copy(this);
+ r->_context = newContext;
return r;
}
ReferencePtr
IceInternal::Reference::changeFacet(const string& newFacet) const
{
- if(newFacet == facet)
+ if(newFacet == _facet)
{
return ReferencePtr(const_cast<Reference*>(this));
}
- ReferencePtr r = instance->referenceFactory()->clone(this);
- r->facet = newFacet;
+ ReferencePtr r = _instance->referenceFactory()->copy(this);
+ r->_facet = newFacet;
return r;
}
ReferencePtr
IceInternal::Reference::changeSecure(bool newSecure) const
{
- if(newSecure == secure)
+ if(newSecure == _secure)
{
return ReferencePtr(const_cast<Reference*>(this));
}
- ReferencePtr r = instance->referenceFactory()->clone(this);
- r->secure = newSecure;
+ ReferencePtr r = _instance->referenceFactory()->copy(this);
+ r->_secure = newSecure;
return r;
}
Int
Reference::hash() const
{
- IceUtil::Mutex::Lock sync(hashMutex);
+ IceUtil::Mutex::Lock sync(_hashMutex);
- if(hashInitialized)
+ if(_hashInitialized)
{
- return hashValue;
+ return _hashValue;
}
string::const_iterator p;
Context::const_iterator q;
- Int h = static_cast<Int>(mode);
+ Int h = static_cast<Int>(_mode);
- for(p = identity.name.begin(); p != identity.name.end(); ++p)
+ for(p = _identity.name.begin(); p != _identity.name.end(); ++p)
{
h = 5 * h + *p;
}
- for(p = identity.category.begin(); p != identity.category.end(); ++p)
+ for(p = _identity.category.begin(); p != _identity.category.end(); ++p)
{
h = 5 * h + *p;
}
- for(q = context.begin(); q != context.end(); ++q)
+ for(q = _context.begin(); q != _context.end(); ++q)
{
for(p = q->first.begin(); p != q->first.end(); ++p)
{
@@ -129,15 +129,15 @@ Reference::hash() const
}
}
- for(p = facet.begin(); p != facet.end(); ++p)
+ for(p = _facet.begin(); p != _facet.end(); ++p)
{
h = 5 * h + *p;
}
- h = 5 * h + static_cast<Int>(secure);
+ h = 5 * h + static_cast<Int>(_secure);
- hashValue = h;
- hashInitialized = true;
+ _hashValue = h;
+ _hashInitialized = true;
return h;
}
@@ -153,20 +153,20 @@ IceInternal::Reference::streamWrite(BasicStream* s) const
//
// For compatibility with the old FacetPath.
//
- if(facet.empty())
+ if(_facet.empty())
{
s->write(vector<string>());
}
else
{
vector<string> facetPath;
- facetPath.push_back(facet);
+ facetPath.push_back(_facet);
s->write(facetPath);
}
- s->write(static_cast<Byte>(mode));
+ s->write(static_cast<Byte>(_mode));
- s->write(secure);
+ s->write(_secure);
// Derived class writes the remainder of the reference.
}
@@ -181,7 +181,7 @@ IceInternal::Reference::toString() const
// the reference parser uses as separators, then we enclose
// the identity string in quotes.
//
- string id = identityToString(identity);
+ string id = identityToString(_identity);
if(id.find_first_of(" \t\n\r:@") != string::npos)
{
s << '"' << id << '"';
@@ -191,7 +191,7 @@ IceInternal::Reference::toString() const
s << id;
}
- if(!facet.empty())
+ if(!_facet.empty())
{
s << " -f ";
@@ -200,7 +200,7 @@ IceInternal::Reference::toString() const
// the reference parser uses as separators, then we enclose
// the facet string in quotes.
//
- string fs = IceUtil::escapeString(facet, "");
+ string fs = IceUtil::escapeString(_facet, "");
if(fs.find_first_of(" \t\n\r:@") != string::npos)
{
s << '"' << fs << '"';
@@ -211,7 +211,7 @@ IceInternal::Reference::toString() const
}
}
- switch(mode)
+ switch(_mode)
{
case ModeTwoway:
{
@@ -244,7 +244,7 @@ IceInternal::Reference::toString() const
}
}
- if(secure)
+ if(_secure)
{
s << " -s";
}
@@ -261,27 +261,27 @@ IceInternal::Reference::operator==(const Reference& r) const
// Note: if(this == &r) test is performed by each non-abstract derived class.
//
- if(mode != r.mode)
+ if(_mode != r._mode)
{
return false;
}
- if(identity != r.identity)
+ if(_identity != r._identity)
{
return false;
}
- if(context != r.context)
+ if(_context != r._context)
{
return false;
}
- if(facet != r.facet)
+ if(_facet != r._facet)
{
return false;
}
- if(secure != r.secure)
+ if(_secure != r._secure)
{
return false;
}
@@ -302,47 +302,47 @@ IceInternal::Reference::operator<(const Reference& r) const
// Note: if(this == &r) test is performed by each non-abstract derived class.
//
- if(mode < r.mode)
+ if(_mode < r._mode)
{
return true;
}
- else if(r.mode < mode)
+ else if(r._mode < _mode)
{
return false;
}
- if(identity < r.identity)
+ if(_identity < r._identity)
{
return true;
}
- else if(r.identity < identity)
+ else if(r._identity < _identity)
{
return false;
}
- if(context < r.context)
+ if(_context < r._context)
{
return true;
}
- else if(r.context < context)
+ else if(r._context < _context)
{
return false;
}
- if(facet < r.facet)
+ if(_facet < r._facet)
{
return true;
}
- else if(r.facet < facet)
+ else if(r._facet < _facet)
{
return false;
}
- if(!secure && r.secure)
+ if(!_secure && r._secure)
{
return true;
}
- else if(r.secure < secure)
+ else if(r._secure < _secure)
{
return false;
}
@@ -374,24 +374,24 @@ public:
IceInternal::Reference::Reference(const InstancePtr& inst, const Ice::Identity& ident, const Ice::Context& ctx,
const std::string& fs, Mode md, bool sec)
- : instance(inst),
- mode(md),
- identity(ident),
- context(ctx),
- facet(fs),
- secure(sec),
- hashInitialized(false)
+ : _instance(inst),
+ _mode(md),
+ _identity(ident),
+ _context(ctx),
+ _facet(fs),
+ _secure(sec),
+ _hashInitialized(false)
{
}
IceInternal::Reference::Reference(const Reference& r)
- : instance(r.instance),
- mode(r.mode),
- identity(r.identity),
- context(r.context),
- facet(r.facet),
- secure(r.secure),
- hashInitialized(false)
+ : _instance(r._instance),
+ _mode(r._mode),
+ _identity(r._identity),
+ _context(r._context),
+ _facet(r._facet),
+ _secure(r._secure),
+ _hashInitialized(false)
{
}
@@ -402,7 +402,7 @@ IceInternal::FixedReference::FixedReference(const InstancePtr& inst, const Ice::
const Ice::Context& ctx, const std::string& fs, Mode md,
bool sec, const vector<Ice::ConnectionIPtr>& fixedConns)
: Reference(inst, ident, ctx, fs, md, sec),
- fixedConnections(fixedConns)
+ _fixedConnections(fixedConns)
{
}
@@ -412,6 +412,12 @@ IceInternal::FixedReference::getEndpoints() const
return vector<EndpointPtr>();
}
+bool
+IceInternal::FixedReference::getCollocationOptimization() const
+{
+ return false;
+}
+
void
IceInternal::FixedReference::streamWrite(BasicStream* s) const
{
@@ -423,7 +429,7 @@ IceInternal::FixedReference::streamWrite(BasicStream* s) const
ConnectionIPtr
IceInternal::FixedReference::getConnection(bool& compress) const
{
- vector<ConnectionIPtr> filteredConns = filterConnections(fixedConnections, getMode(), getSecure());
+ vector<ConnectionIPtr> filteredConns = filterConnections(_fixedConnections, getMode(), getSecure());
if(filteredConns.empty())
{
NoEndpointException ex(__FILE__, __LINE__);
@@ -486,7 +492,7 @@ IceInternal::FixedReference::operator==(const Reference& r) const
{
return false;
}
- return fixedConnections == rhs->fixedConnections;
+ return _fixedConnections == rhs->_fixedConnections;
}
bool
@@ -511,7 +517,7 @@ IceInternal::FixedReference::operator<(const Reference& r) const
const FixedReference* rhs = dynamic_cast<const FixedReference*>(&r);
if(rhs)
{
- return fixedConnections < rhs->fixedConnections;
+ return _fixedConnections < rhs->_fixedConnections;
}
}
return false;
@@ -525,7 +531,7 @@ IceInternal::FixedReference::clone() const
IceInternal::FixedReference::FixedReference(const FixedReference& r)
: Reference(r),
- fixedConnections(r.fixedConnections)
+ _fixedConnections(r._fixedConnections)
{
}
@@ -535,48 +541,54 @@ void IceInternal::decRef(IceInternal::RoutableReference* p) { p->__decRef(); }
std::vector<EndpointPtr>
IceInternal::RoutableReference::getRoutedEndpoints() const
{
- if(routerInfo)
+ if(_routerInfo)
{
//
// If we route, we send everything to the router's client
// proxy endpoints.
//
- ObjectPrx clientProxy = routerInfo->getClientProxy();
+ ObjectPrx clientProxy = _routerInfo->getClientProxy();
return clientProxy->__reference()->getEndpoints();
}
return vector<EndpointPtr>();
}
+bool
+IceInternal::RoutableReference::getCollocationOptimization() const
+{
+ return _collocationOptimization;
+}
+
ReferencePtr
IceInternal::RoutableReference::changeRouter(const RouterPrx& newRouter) const
{
RouterInfoPtr newRouterInfo = getInstance()->routerManager()->get(newRouter);
- if(newRouterInfo == routerInfo)
+ if(newRouterInfo == _routerInfo)
{
return RoutableReferencePtr(const_cast<RoutableReference*>(this));
}
- RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
- r->routerInfo = newRouterInfo;
+ RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
+ r->_routerInfo = newRouterInfo;
return r;
}
ReferencePtr
IceInternal::RoutableReference::changeDefault() const
{
- RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
- r->routerInfo = getInstance()->routerManager()->get(getInstance()->referenceFactory()->getDefaultRouter());
+ RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
+ r->_routerInfo = getInstance()->routerManager()->get(getInstance()->referenceFactory()->getDefaultRouter());
return r;
}
ReferencePtr
IceInternal::RoutableReference::changeCollocationOptimization(bool newCollocationOptimization) const
{
- if(newCollocationOptimization == collocationOptimization)
+ if(newCollocationOptimization == _collocationOptimization)
{
return RoutableReferencePtr(const_cast<RoutableReference*>(this));
}
- RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
- r->collocationOptimization = newCollocationOptimization;
+ RoutableReferencePtr r = RoutableReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
+ r->_collocationOptimization = newCollocationOptimization;
return r;
}
@@ -592,11 +604,11 @@ IceInternal::RoutableReference::operator==(const Reference& r) const
{
return false;
}
- if(collocationOptimization != rhs->collocationOptimization)
+ if(_collocationOptimization != rhs->_collocationOptimization)
{
return false;
}
- return routerInfo == rhs->routerInfo;
+ return _routerInfo == rhs->_routerInfo;
}
bool
@@ -621,15 +633,15 @@ IceInternal::RoutableReference::operator<(const Reference& r) const
const RoutableReference* rhs = dynamic_cast<const RoutableReference*>(&r);
if(rhs)
{
- if(!collocationOptimization && rhs->collocationOptimization)
+ if(!_collocationOptimization && rhs->_collocationOptimization)
{
return true;
}
- else if(rhs->collocationOptimization < collocationOptimization)
+ else if(rhs->_collocationOptimization < _collocationOptimization)
{
return false;
}
- return routerInfo < rhs->routerInfo;
+ return _routerInfo < rhs->_routerInfo;
}
}
return false;
@@ -639,15 +651,15 @@ IceInternal::RoutableReference::RoutableReference(const InstancePtr& inst, const
const Ice::Context& ctx, const std::string& fs, Mode md,
bool sec, const RouterInfoPtr& rtrInfo, bool collocationOpt)
: Reference(inst, ident, ctx, fs, md, sec),
- routerInfo(rtrInfo),
- collocationOptimization(collocationOpt)
+ _routerInfo(rtrInfo),
+ _collocationOptimization(collocationOpt)
{
}
IceInternal::RoutableReference::RoutableReference(const RoutableReference& r)
: Reference(r),
- routerInfo(r.routerInfo),
- collocationOptimization(r.collocationOptimization)
+ _routerInfo(r._routerInfo),
+ _collocationOptimization(r._collocationOptimization)
{
}
@@ -659,25 +671,25 @@ IceInternal::DirectReference::DirectReference(const InstancePtr& inst, const Ice
bool sec, const std::vector<EndpointPtr>& endpts,
const RouterInfoPtr& rtrInfo, bool collocationOpt)
: RoutableReference(inst, ident, ctx, fs, md, sec, rtrInfo, collocationOpt),
- endpoints(endpts)
+ _endpoints(endpts)
{
}
vector<EndpointPtr>
IceInternal::DirectReference::getEndpoints() const
{
- return endpoints;
+ return _endpoints;
}
DirectReferencePtr
IceInternal::DirectReference::changeEndpoints(const vector<EndpointPtr>& newEndpoints) const
{
- if(newEndpoints == endpoints)
+ if(newEndpoints == _endpoints)
{
return DirectReferencePtr(const_cast<DirectReference*>(this));
}
- DirectReferencePtr r = DirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
- r->endpoints = newEndpoints;
+ DirectReferencePtr r = DirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
+ r->_endpoints = newEndpoints;
return r;
}
@@ -696,28 +708,28 @@ IceInternal::DirectReference::changeDefault() const
ReferencePtr
IceInternal::DirectReference::changeCompress(bool newCompress) const
{
- DirectReferencePtr r = DirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
+ DirectReferencePtr r = DirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
vector<EndpointPtr> newEndpoints;
vector<EndpointPtr>::const_iterator p;
- for(p = endpoints.begin(); p != endpoints.end(); ++p)
+ for(p = _endpoints.begin(); p != _endpoints.end(); ++p)
{
newEndpoints.push_back((*p)->compress(newCompress));
}
- r->endpoints = newEndpoints;
+ r->_endpoints = newEndpoints;
return r;
}
ReferencePtr
IceInternal::DirectReference::changeTimeout(int newTimeout) const
{
- DirectReferencePtr r = DirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
+ DirectReferencePtr r = DirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
vector<EndpointPtr> newEndpoints;
vector<EndpointPtr>::const_iterator p;
- for(p = endpoints.begin(); p != endpoints.end(); ++p)
+ for(p = _endpoints.begin(); p != _endpoints.end(); ++p)
{
newEndpoints.push_back((*p)->timeout(newTimeout));
}
- r->endpoints = newEndpoints;
+ r->_endpoints = newEndpoints;
return r;
}
@@ -726,9 +738,9 @@ IceInternal::DirectReference::streamWrite(BasicStream* s) const
{
RoutableReference::streamWrite(s);
- s->writeSize(Ice::Int(endpoints.size()));
+ s->writeSize(Ice::Int(_endpoints.size()));
vector<EndpointPtr>::const_iterator p;
- for(p = endpoints.begin(); p != endpoints.end(); ++p)
+ for(p = _endpoints.begin(); p != _endpoints.end(); ++p)
{
(*p)->streamWrite(s);
}
@@ -740,7 +752,7 @@ IceInternal::DirectReference::toString() const
string result = RoutableReference::toString();
vector<EndpointPtr>::const_iterator p;
- for(p = endpoints.begin(); p != endpoints.end(); ++p)
+ for(p = _endpoints.begin(); p != _endpoints.end(); ++p)
{
string endp = (*p)->toString();
if(!endp.empty())
@@ -758,7 +770,7 @@ IceInternal::DirectReference::getConnection(bool& comp) const
vector<EndpointPtr> endpts = RoutableReference::getRoutedEndpoints();
if(endpts.empty())
{
- endpts = endpoints;
+ endpts = _endpoints;
}
vector<EndpointPtr> filteredEndpoints = filterEndpoints(endpts, getMode(), getSecure());
if(filteredEndpoints.empty())
@@ -798,7 +810,7 @@ IceInternal::DirectReference::operator==(const Reference& r) const
{
return false;
}
- return endpoints == rhs->endpoints;
+ return _endpoints == rhs->_endpoints;
}
bool
@@ -823,7 +835,7 @@ IceInternal::DirectReference::operator<(const Reference& r) const
const DirectReference* rhs = dynamic_cast<const DirectReference*>(&r);
if(rhs)
{
- return endpoints < rhs->endpoints;
+ return _endpoints < rhs->_endpoints;
}
}
return false;
@@ -837,7 +849,7 @@ IceInternal::DirectReference::clone() const
IceInternal::DirectReference::DirectReference(const DirectReference& r)
: RoutableReference(r),
- endpoints(r.endpoints)
+ _endpoints(r._endpoints)
{
}
@@ -850,8 +862,8 @@ IceInternal::IndirectReference::IndirectReference(const InstancePtr& inst, const
bool sec, const string& adptid, const RouterInfoPtr& rtrInfo,
const LocatorInfoPtr& locInfo, bool collocationOpt)
: RoutableReference(inst, ident, ctx, fs, md, sec, rtrInfo, collocationOpt),
- adapterId(adptid),
- locatorInfo(locInfo)
+ _adapterId(adptid),
+ _locatorInfo(locInfo)
{
}
@@ -864,14 +876,16 @@ IceInternal::IndirectReference::getEndpoints() const
ReferencePtr
IceInternal::IndirectReference::changeLocator(const LocatorPrx& newLocator) const
{
+ assert(newLocator);
+
LocatorInfoPtr newLocatorInfo = getInstance()->locatorManager()->get(newLocator);
- if(newLocatorInfo == locatorInfo)
+ if(newLocatorInfo == _locatorInfo)
{
return IndirectReferencePtr(const_cast<IndirectReference*>(this));
}
- IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
- r->locatorInfo = newLocatorInfo;
+ IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
+ r->_locatorInfo = newLocatorInfo;
return r;
}
@@ -879,18 +893,18 @@ ReferencePtr
IceInternal::IndirectReference::changeDefault() const
{
IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(RoutableReference::changeDefault());
- r->locatorInfo = getInstance()->locatorManager()->get(getInstance()->referenceFactory()->getDefaultLocator());
+ r->_locatorInfo = getInstance()->locatorManager()->get(getInstance()->referenceFactory()->getDefaultLocator());
return r;
}
ReferencePtr
IceInternal::IndirectReference::changeCompress(bool newCompress) const
{
- IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
- if(locatorInfo)
+ IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
+ if(_locatorInfo)
{
- LocatorPrx newLocator = LocatorPrx::uncheckedCast(locatorInfo->getLocator()->ice_compress(newCompress));
- r->locatorInfo = getInstance()->locatorManager()->get(newLocator);
+ LocatorPrx newLocator = LocatorPrx::uncheckedCast(_locatorInfo->getLocator()->ice_compress(newCompress));
+ r->_locatorInfo = getInstance()->locatorManager()->get(newLocator);
}
return r;
}
@@ -898,12 +912,11 @@ IceInternal::IndirectReference::changeCompress(bool newCompress) const
ReferencePtr
IceInternal::IndirectReference::changeTimeout(int newTimeout) const
{
- IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->clone(this));
- LocatorInfoPtr newLocatorInfo;
- if(locatorInfo)
+ IndirectReferencePtr r = IndirectReferencePtr::dynamicCast(getInstance()->referenceFactory()->copy(this));
+ if(_locatorInfo)
{
- LocatorPrx newLocator = LocatorPrx::uncheckedCast(locatorInfo->getLocator()->ice_timeout(newTimeout));
- r->locatorInfo = getInstance()->locatorManager()->get(newLocator);
+ LocatorPrx newLocator = LocatorPrx::uncheckedCast(_locatorInfo->getLocator()->ice_timeout(newTimeout));
+ r->_locatorInfo = getInstance()->locatorManager()->get(newLocator);
}
return r;
}
@@ -914,14 +927,14 @@ IceInternal::IndirectReference::streamWrite(BasicStream* s) const
RoutableReference::streamWrite(s);
s->writeSize(0);
- s->write(adapterId);
+ s->write(_adapterId);
}
string
IceInternal::IndirectReference::toString() const
{
string result = RoutableReference::toString();
- if(adapterId.empty())
+ if(_adapterId.empty())
{
return result;
}
@@ -933,7 +946,7 @@ IceInternal::IndirectReference::toString() const
// reference parser uses as separators, then we enclose the
// adapter id string in quotes.
//
- string a = IceUtil::escapeString(adapterId, "");
+ string a = IceUtil::escapeString(_adapterId, "");
if(a.find_first_of(" \t\n\r") != string::npos)
{
result.append("\"");
@@ -942,7 +955,7 @@ IceInternal::IndirectReference::toString() const
}
else
{
- result.append(adapterId);
+ result.append(_adapterId);
}
return result;
}
@@ -955,11 +968,11 @@ IceInternal::IndirectReference::getConnection(bool& comp) const
while(true)
{
vector<EndpointPtr> endpts = RoutableReference::getRoutedEndpoints();
- bool cached;
- if(endpts.empty() && locatorInfo)
+ bool cached = false;
+ if(endpts.empty() && _locatorInfo)
{
const IndirectReferencePtr self = const_cast<IndirectReference*>(this);
- endpts = locatorInfo->getEndpoints(self, cached);
+ endpts = _locatorInfo->getEndpoints(self, cached);
}
vector<EndpointPtr> filteredEndpoints = filterEndpoints(endpts, getMode(), getSecure());
if(filteredEndpoints.empty())
@@ -979,15 +992,15 @@ IceInternal::IndirectReference::getConnection(bool& comp) const
{
if(!getRouterInfo())
{
- assert(locatorInfo);
+ assert(_locatorInfo);
const IndirectReferencePtr self = const_cast<IndirectReference*>(this);
- locatorInfo->clearCache(self);
+ _locatorInfo->clearCache(self);
if(cached)
{
TraceLevelsPtr traceLevels = getInstance()->traceLevels();
LoggerPtr logger = getInstance()->logger();
- if(traceLevels->retry >=2)
+ if(traceLevels->retry >= 2)
{
Trace out(logger, traceLevels->retryCat);
out << "connection to cached endpoints failed\n"
@@ -1029,7 +1042,7 @@ IceInternal::IndirectReference::operator==(const Reference& r) const
{
return false;
}
- return adapterId == rhs->adapterId && locatorInfo == rhs->locatorInfo;
+ return _adapterId == rhs->_adapterId && _locatorInfo == rhs->_locatorInfo;
}
bool
@@ -1054,15 +1067,15 @@ IceInternal::IndirectReference::operator<(const Reference& r) const
const IndirectReference* rhs = dynamic_cast<const IndirectReference*>(&r);
if(rhs)
{
- if(adapterId < rhs->adapterId)
+ if(_adapterId < rhs->_adapterId)
{
return true;
}
- else if(rhs->adapterId < adapterId)
+ else if(rhs->_adapterId < _adapterId)
{
return false;
}
- return locatorInfo < rhs->locatorInfo;
+ return _locatorInfo < rhs->_locatorInfo;
}
}
return false;
@@ -1076,8 +1089,8 @@ IceInternal::IndirectReference::clone() const
IceInternal::IndirectReference::IndirectReference(const IndirectReference& r)
: RoutableReference(r),
- adapterId(r.adapterId),
- locatorInfo(r.locatorInfo)
+ _adapterId(r._adapterId),
+ _locatorInfo(r._locatorInfo)
{
}