diff options
author | Marc Laukien <marc@zeroc.com> | 2002-07-17 23:12:29 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-07-17 23:12:29 +0000 |
commit | 694f735a9d58ddd967e8665e1689cd33174eb93f (patch) | |
tree | 44ad795e2d8ca3096f82ba46481d3489c20bb223 /cpp | |
parent | Added YellowS and basicYellowC (diff) | |
download | ice-694f735a9d58ddd967e8665e1689cd33174eb93f.tar.bz2 ice-694f735a9d58ddd967e8665e1689cd33174eb93f.tar.xz ice-694f735a9d58ddd967e8665e1689cd33174eb93f.zip |
facet path
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/include/Ice/Object.h | 1 | ||||
-rw-r--r-- | cpp/src/Ice/Direct.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Incoming.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Object.cpp | 24 |
4 files changed, 27 insertions, 2 deletions
diff --git a/cpp/include/Ice/Object.h b/cpp/include/Ice/Object.h index 567a24370f4..e9eab76ae46 100644 --- a/cpp/include/Ice/Object.h +++ b/cpp/include/Ice/Object.h @@ -102,6 +102,7 @@ public: void ice_removeFacet(const ::std::string&); void ice_removeAllFacets(); ObjectPtr ice_findFacet(const ::std::string&); + ObjectPtr ice_findFacet(const ::std::vector< ::std::string>&, int = 0); private: diff --git a/cpp/src/Ice/Direct.cpp b/cpp/src/Ice/Direct.cpp index e45be7463be..ae9bc3e7959 100644 --- a/cpp/src/Ice/Direct.cpp +++ b/cpp/src/Ice/Direct.cpp @@ -47,7 +47,7 @@ IceInternal::Direct::Direct(const ObjectAdapterPtr& adapter, const Current& curr if(_servant && !_current.facet.empty()) { - _facetServant = _servant->ice_findFacet(_current.facet.front()); + _facetServant = _servant->ice_findFacet(_current.facet); if(!_facetServant) { FacetNotExistException ex(__FILE__, __LINE__); diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 62f6028595b..6b44306c703 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -100,7 +100,7 @@ IceInternal::Incoming::invoke(bool response) { if(!current.facet.empty()) { - ObjectPtr facetServant = servant->ice_findFacet(current.facet.front()); + ObjectPtr facetServant = servant->ice_findFacet(current.facet); if(!facetServant) { status = DispatchFacetNotExist; diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp index 6f54fc4768b..7bad13a59da 100644 --- a/cpp/src/Ice/Object.cpp +++ b/cpp/src/Ice/Object.cpp @@ -373,6 +373,30 @@ Ice::Object::ice_findFacet(const string& name) } } +ObjectPtr +Ice::Object::ice_findFacet(const vector<string>& path, int start) +{ + int sz = path.size(); + + if(start > sz) + { + return 0; + } + + if(start == sz) + { + return this; + } + + ObjectPtr facet = ice_findFacet(path[start]); + if(!facet) + { + return 0; + } + + return facet->ice_findFacet(path, start + 1); +} + DispatchStatus Ice::Blobject::__dispatch(Incoming& in, const Current& current) { |