summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2007-02-14 19:20:52 +0000
committerDwayne Boone <dwayne@zeroc.com>2007-02-14 19:20:52 +0000
commitc3ceb1274f8b7a370d09750c639dc4b6abb6a935 (patch)
treef9c9e3770d9f311398d47cfd4d10b12ec87c6c91 /cpp/src
parentupdate file specs for demo list, generated code should be excluded from the (diff)
downloadice-c3ceb1274f8b7a370d09750c639dc4b6abb6a935.tar.bz2
ice-c3ceb1274f8b7a370d09750c639dc4b6abb6a935.tar.xz
ice-c3ceb1274f8b7a370d09750c639dc4b6abb6a935.zip
Minor refactor
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ObjectAdapterI.cpp14
-rw-r--r--cpp/src/Ice/ObjectAdapterI.h2
2 files changed, 9 insertions, 7 deletions
diff --git a/cpp/src/Ice/ObjectAdapterI.cpp b/cpp/src/Ice/ObjectAdapterI.cpp
index daae55cc367..9ce57cf1142 100644
--- a/cpp/src/Ice/ObjectAdapterI.cpp
+++ b/cpp/src/Ice/ObjectAdapterI.cpp
@@ -754,9 +754,8 @@ Ice::ObjectAdapterI::ObjectAdapterI(const InstancePtr& instance, const Communica
}
PropertiesPtr properties = instance->initializationData().properties;
- StringSeq props;
StringSeq unknownProps;
- filterProperties(props, unknownProps);
+ bool noProps = filterProperties(unknownProps);
//
// Warn about unknown object adapter properties.
@@ -774,7 +773,7 @@ Ice::ObjectAdapterI::ObjectAdapterI(const InstancePtr& instance, const Communica
//
// Make sure named adapter has some configuration
//
- if(endpointInfo.empty() && router == 0 && props.size() == 0)
+ if(endpointInfo.empty() && router == 0 && noProps)
{
InitializationException ex(__FILE__, __LINE__);
ex.reason = "object adapter \"" + _name + "\" requires configuration.";
@@ -1188,8 +1187,8 @@ ObjectAdapterI::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locator
}
}
-void
-Ice::ObjectAdapterI::filterProperties(StringSeq& oaProps, StringSeq& unknownProps)
+bool
+Ice::ObjectAdapterI::filterProperties(StringSeq& unknownProps)
{
static const string suffixes[] =
{
@@ -1223,6 +1222,7 @@ Ice::ObjectAdapterI::filterProperties(StringSeq& oaProps, StringSeq& unknownProp
}
}
+ bool noProps = true;
PropertyDict props = _instance->initializationData().properties->getPropertiesForPrefix(prefix);
PropertyDict::const_iterator p;
for(p = props.begin(); p != props.end(); ++p)
@@ -1233,7 +1233,7 @@ Ice::ObjectAdapterI::filterProperties(StringSeq& oaProps, StringSeq& unknownProp
string prop = prefix + suffixes[i];
if(p->first == prop)
{
- oaProps.push_back(p->first);
+ noProps = false;
valid = true;
break;
}
@@ -1244,6 +1244,8 @@ Ice::ObjectAdapterI::filterProperties(StringSeq& oaProps, StringSeq& unknownProp
unknownProps.push_back(p->first);
}
}
+
+ return noProps;
}
Ice::ObjectAdapterI::ProcessI::ProcessI(const CommunicatorPtr& communicator) :
diff --git a/cpp/src/Ice/ObjectAdapterI.h b/cpp/src/Ice/ObjectAdapterI.h
index 1cd8eff2a75..89fa481a659 100644
--- a/cpp/src/Ice/ObjectAdapterI.h
+++ b/cpp/src/Ice/ObjectAdapterI.h
@@ -101,7 +101,7 @@ private:
static void checkIdentity(const Identity&);
std::vector<IceInternal::EndpointIPtr> parseEndpoints(const std::string&) const;
void updateLocatorRegistry(const IceInternal::LocatorInfoPtr&, const Ice::ObjectPrx&, bool);
- void filterProperties(Ice::StringSeq&, Ice::StringSeq&);
+ bool filterProperties(Ice::StringSeq&);
bool _deactivated;
IceInternal::InstancePtr _instance;