summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-07-17 23:53:29 +0000
committerMarc Laukien <marc@zeroc.com>2002-07-17 23:53:29 +0000
commit60f15d8532ffa9d7b727ea423f5fa7c2fec3021b (patch)
tree139ae55e07d67f043245cf604fddfe328b587eed /cpp/src
parentfile XMLTransform.h was initially added on branch freeze_xml. (diff)
downloadice-60f15d8532ffa9d7b727ea423f5fa7c2fec3021b.tar.bz2
ice-60f15d8532ffa9d7b727ea423f5fa7c2fec3021b.tar.xz
ice-60f15d8532ffa9d7b727ea423f5fa7c2fec3021b.zip
facet path
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Direct.cpp2
-rw-r--r--cpp/src/Ice/Incoming.cpp2
-rw-r--r--cpp/src/Ice/Object.cpp58
-rw-r--r--cpp/src/Ice/TraceUtil.cpp20
-rw-r--r--cpp/src/Ice/ice.dsp53
5 files changed, 94 insertions, 41 deletions
diff --git a/cpp/src/Ice/Direct.cpp b/cpp/src/Ice/Direct.cpp
index ae9bc3e7959..59d9ef67ff1 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);
+ _facetServant = _servant->ice_findFacet(_current.facet, 0);
if(!_facetServant)
{
FacetNotExistException ex(__FILE__, __LINE__);
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index 6b44306c703..4699e4b922f 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);
+ ObjectPtr facetServant = servant->ice_findFacet(current.facet, 0);
if(!facetServant)
{
status = DispatchFacetNotExist;
diff --git a/cpp/src/Ice/Object.cpp b/cpp/src/Ice/Object.cpp
index 7bad13a59da..c64a503760a 100644
--- a/cpp/src/Ice/Object.cpp
+++ b/cpp/src/Ice/Object.cpp
@@ -343,37 +343,6 @@ Ice::Object::ice_removeAllFacets()
}
ObjectPtr
-Ice::Object::ice_findFacet(const string& name)
-{
- IceUtil::Mutex::Lock sync(_activeFacetMapMutex);
-
- map<string, ObjectPtr>::iterator p = _activeFacetMap.end();
-
- if(_activeFacetMapHint != _activeFacetMap.end())
- {
- if(_activeFacetMapHint->first == name)
- {
- p = _activeFacetMapHint;
- }
- }
-
- if(p == _activeFacetMap.end())
- {
- p = _activeFacetMap.find(name);
- }
-
- if(p != _activeFacetMap.end())
- {
- _activeFacetMapHint = p;
- return p->second;
- }
- else
- {
- return 0;
- }
-}
-
-ObjectPtr
Ice::Object::ice_findFacet(const vector<string>& path, int start)
{
int sz = path.size();
@@ -388,13 +357,32 @@ Ice::Object::ice_findFacet(const vector<string>& path, int start)
return this;
}
- ObjectPtr facet = ice_findFacet(path[start]);
- if(!facet)
{
- return 0;
+ IceUtil::Mutex::Lock sync(_activeFacetMapMutex);
+
+ map<string, ObjectPtr>::iterator p = _activeFacetMap.end();
+
+ if(_activeFacetMapHint != _activeFacetMap.end())
+ {
+ if(_activeFacetMapHint->first == path[start])
+ {
+ p = _activeFacetMapHint;
+ }
+ }
+
+ if(p == _activeFacetMap.end())
+ {
+ p = _activeFacetMap.find(path[start]);
+ }
+
+ if(p != _activeFacetMap.end())
+ {
+ _activeFacetMapHint = p;
+ return p->second->ice_findFacet(path, start + 1);
+ }
}
- return facet->ice_findFacet(path, start + 1);
+ return 0;
}
DispatchStatus
diff --git a/cpp/src/Ice/TraceUtil.cpp b/cpp/src/Ice/TraceUtil.cpp
index 8c30a38c821..98243178f3a 100644
--- a/cpp/src/Ice/TraceUtil.cpp
+++ b/cpp/src/Ice/TraceUtil.cpp
@@ -27,10 +27,10 @@ printHeader(ostream& s, BasicStream& stream)
{
Byte protVer;
stream.read(protVer);
- s << "\nprotocol version = " << static_cast<int>(protVer);
+// s << "\nprotocol version = " << static_cast<int>(protVer);
Byte encVer;
stream.read(encVer);
- s << "\nencoding version = " << static_cast<int>(encVer);
+// s << "\nencoding version = " << static_cast<int>(encVer);
Byte type;
stream.read(type);
s << "\nmessage type = " << static_cast<int>(type) << ' ';
@@ -93,9 +93,21 @@ printRequestHeader(ostream& s, BasicStream& stream)
Identity identity;
identity.__read(&stream);
s << "\nidentity = " << identity;
- string facet;
+ vector<string> facet;
stream.read(facet);
- s << "\nfacet = " << facet;
+ s << "\nfacet = ";
+ vector<string>::const_iterator p = facet.begin();
+ while(p != facet.end())
+ {
+ //
+ // TODO: Escape for whitespace and slashes.
+ //
+ s << *p++;
+ if(p != facet.end())
+ {
+ s << '/';
+ }
+ }
string operation;
stream.read(operation);
s << "\noperation = " << operation;
diff --git a/cpp/src/Ice/ice.dsp b/cpp/src/Ice/ice.dsp
index 24b90832f1a..7dbe9bf33df 100644
--- a/cpp/src/Ice/ice.dsp
+++ b/cpp/src/Ice/ice.dsp
@@ -176,6 +176,10 @@ SOURCE=.\Exception.cpp
# End Source File
# Begin Source File
+SOURCE=.\Facet.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Identity.cpp
# End Source File
# Begin Source File
@@ -496,6 +500,10 @@ SOURCE=..\..\include\Ice\Ice.h
# End Source File
# Begin Source File
+SOURCE=..\..\include\Ice\Facet.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\Ice\Identity.h
# End Source File
# Begin Source File
@@ -988,6 +996,51 @@ BuildCmds= \
# End Source File
# Begin Source File
+SOURCE=..\..\slice\Ice\Facet.ice
+
+!IF "$(CFG)" == "Ice - Win32 Release"
+
+USERDEP__IDENT="../../bin/slice2cpp.exe"
+# Begin Custom Build
+InputPath=..\..\slice\Ice\Facet.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\lib \
+ ..\..\bin\slice2cpp.exe --dll-export ICE_API --include-dir Ice -I../../slice ../../slice/Ice/Facet.ice \
+ move Facet.h ..\..\include\Ice \
+
+
+"..\..\include\Ice\Facet.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Facet.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Ice - Win32 Debug"
+
+USERDEP__IDENT="../../bin/slice2cpp.exe"
+# Begin Custom Build
+InputPath=..\..\slice\Ice\Facet.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\lib \
+ ..\..\bin\slice2cpp.exe --dll-export ICE_API --include-dir Ice -I../../slice ../../slice/Ice/Facet.ice \
+ move Facet.h ..\..\include\Ice \
+
+
+"..\..\include\Ice\Facet.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Facet.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=..\..\slice\Ice\Identity.ice
!IF "$(CFG)" == "Ice - Win32 Release"