summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2002-09-12 05:56:24 +0000
committerMark Spruiell <mes@zeroc.com>2002-09-12 05:56:24 +0000
commit424fd1269fd9f1f8282d5747f87d9c429e5bd4e5 (patch)
tree049bce758bfe962bbcd4acb06297b4a189400bf5 /cpp
parentRe-enabled Slice tests. (diff)
downloadice-424fd1269fd9f1f8282d5747f87d9c429e5bd4e5.tar.bz2
ice-424fd1269fd9f1f8282d5747f87d9c429e5bd4e5.tar.xz
ice-424fd1269fd9f1f8282d5747f87d9c429e5bd4e5.zip
ice_removeFacet now returns ObjectPtr
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/Object.h2
-rw-r--r--cpp/src/Ice/Object.cpp8
2 files changed, 8 insertions, 2 deletions
diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h
index de1c3a87d71..977601f5162 100644
--- a/cpp/include/Ice/Object.h
+++ b/cpp/include/Ice/Object.h
@@ -99,7 +99,7 @@ public:
static void ice_unmarshal(const ::std::string&, const ::Ice::StreamPtr&, ObjectPtr&);
void ice_addFacet(const ObjectPtr&, const ::std::string&);
- void ice_removeFacet(const ::std::string&);
+ ObjectPtr ice_removeFacet(const ::std::string&);
void ice_removeAllFacets();
ObjectPtr ice_findFacet(const ::std::string&);
ObjectPtr ice_findFacetPath(const ::std::vector< ::std::string>&, int);
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp
index a8c63305076..ac923c7485a 100644
--- a/cpp/src/Ice/Object.cpp
+++ b/cpp/src/Ice/Object.cpp
@@ -299,11 +299,13 @@ Ice::Object::ice_addFacet(const ObjectPtr& facet, const string& name)
_activeFacetMapHint = _activeFacetMap.insert(_activeFacetMapHint, make_pair(name, facet));
}
-void
+ObjectPtr
Ice::Object::ice_removeFacet(const string& name)
{
IceUtil::Mutex::Lock sync(_activeFacetMapMutex);
+ ObjectPtr result;
+
map<string, ObjectPtr>::iterator p = _activeFacetMap.end();
if(_activeFacetMapHint != _activeFacetMap.end())
@@ -321,6 +323,8 @@ Ice::Object::ice_removeFacet(const string& name)
if(p != _activeFacetMap.end())
{
+ result = p->second;
+
if(p == _activeFacetMapHint)
{
_activeFacetMap.erase(p++);
@@ -331,6 +335,8 @@ Ice::Object::ice_removeFacet(const string& name)
_activeFacetMap.erase(p);
}
}
+
+ return result;
}
void