diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Endpoint.cpp | 18 | ||||
-rw-r--r-- | cpp/src/Ice/Makefile | 12 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 28 | ||||
-rw-r--r-- | cpp/src/Ice/ice.dsp | 53 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 25 |
5 files changed, 112 insertions, 24 deletions
diff --git a/cpp/src/Ice/Endpoint.cpp b/cpp/src/Ice/Endpoint.cpp index 83a35e0a535..260c1d0a9e6 100644 --- a/cpp/src/Ice/Endpoint.cpp +++ b/cpp/src/Ice/Endpoint.cpp @@ -228,7 +228,7 @@ IceInternal::UnknownEndpoint::operator<(const Endpoint& r) const { return true; } - else if (_rawBytes != p->_rawBytes) + else if (p->_rawBytes < _rawBytes) { return false; } @@ -536,7 +536,7 @@ IceInternal::TcpEndpoint::operator<(const Endpoint& r) const { return true; } - else if (laddr.sin_addr.s_addr != raddr.sin_addr.s_addr) + else if (raddr.sin_addr.s_addr < laddr.sin_addr.s_addr) { return false; } @@ -545,7 +545,7 @@ IceInternal::TcpEndpoint::operator<(const Endpoint& r) const { return true; } - else if (_port != p->_port) + else if (p->_port < _port) { return false; } @@ -554,7 +554,7 @@ IceInternal::TcpEndpoint::operator<(const Endpoint& r) const { return true; } - else if (_timeout != p->_timeout) + else if (p->_timeout < _timeout) { return false; } @@ -848,7 +848,7 @@ IceInternal::SslEndpoint::operator<(const Endpoint& r) const { return true; } - else if (laddr.sin_addr.s_addr != raddr.sin_addr.s_addr) + else if (raddr.sin_addr.s_addr < laddr.sin_addr.s_addr) { return false; } @@ -857,7 +857,7 @@ IceInternal::SslEndpoint::operator<(const Endpoint& r) const { return true; } - else if (_port != p->_port) + else if (p->_port < _port) { return false; } @@ -866,7 +866,7 @@ IceInternal::SslEndpoint::operator<(const Endpoint& r) const { return true; } - else if (_timeout != p->_timeout) + else if (p->_timeout < _timeout) { return false; } @@ -1133,7 +1133,7 @@ IceInternal::UdpEndpoint::operator<(const Endpoint& r) const { return true; } - else if (laddr.sin_addr.s_addr != raddr.sin_addr.s_addr) + else if (raddr.sin_addr.s_addr < laddr.sin_addr.s_addr) { return false; } @@ -1142,7 +1142,7 @@ IceInternal::UdpEndpoint::operator<(const Endpoint& r) const { return true; } - else if (_port != p->_port) + else if (p->_port < _port) { return false; } diff --git a/cpp/src/Ice/Makefile b/cpp/src/Ice/Makefile index b3f0ccfcf0e..3ddde21a4c7 100644 --- a/cpp/src/Ice/Makefile +++ b/cpp/src/Ice/Makefile @@ -44,6 +44,7 @@ OBJS = Application.o \ UserExceptionFactoryManager.o \ Endpoint.o \ Reference.o \ + Identity.o \ Current.o \ LocalObject.o \ Object.o \ @@ -255,9 +256,20 @@ $(HDIR)/UserExceptionFactoryF.h: $(SDIR)/UserExceptionFactoryF.ice $(SLICE2CPP) clean:: rm -f $(HDIR)/UserExceptionFactoryF.h +$(HDIR)/Identity.h Identity.cpp: $(SDIR)/Identity.ice $(SLICE2CPP) + rm -f $(HDIR)/Identity.h Identity.cpp + $(SLICECMD) $(SDIR)/Identity.ice + mv Identity.h $(HDIR) + +clean:: + rm -f $(HDIR)/Identity.h Identity.cpp + $(HDIR)/Current.h Current.cpp: $(SDIR)/Current.ice $(SLICE2CPP) rm -f $(HDIR)/Current.h Current.cpp $(SLICECMD) $(SDIR)/Current.ice mv Current.h $(HDIR) +clean:: + rm -f $(HDIR)/Current.h Current.cpp + include .depend diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 247ca30fab9..2dc35cb2b66 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -346,63 +346,63 @@ IceInternal::Reference::operator==(const Reference& r) const } bool -IceInternal::Reference::operator<(const Reference& r) const +IceInternal::Reference::operator<(const Reference& rhs) const { - if (this == &r) + if (this == &rhs) { return false; } - if (identity < r.identity) + if (identity < rhs.identity) { return true; } - else if (identity != r.identity) + else if (rhs.identity < identity) { return false; } - if (facet < r.facet) + if (facet < rhs.facet) { return true; } - else if (facet != r.facet) + else if (rhs.facet < facet) { return false; } - if (mode < r.mode) + if (mode < rhs.mode) { return true; } - else if (mode != r.mode) + else if (rhs.mode < mode) { return false; } - if (!secure && r.secure) + if (!secure && rhs.secure) { return true; } - else if (secure != r.secure) + else if (rhs.secure < secure) { return false; } - if (origEndpoints < r.origEndpoints) + if (origEndpoints < rhs.origEndpoints) { return true; } - else if (origEndpoints != r.origEndpoints) + else if (rhs.origEndpoints < origEndpoints) { return false; } - if (endpoints < r.endpoints) + if (endpoints < rhs.endpoints) { return true; } - else if (endpoints != r.endpoints) + else if (rhs.endpoints < endpoints) { return false; } diff --git a/cpp/src/Ice/ice.dsp b/cpp/src/Ice/ice.dsp index 88a92f545be..ec6fb03633c 100644 --- a/cpp/src/Ice/ice.dsp +++ b/cpp/src/Ice/ice.dsp @@ -136,6 +136,10 @@ SOURCE=.\Current.cpp # End Source File
# Begin Source File
+SOURCE=.\Identity.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Direct.cpp
# End Source File
# Begin Source File
@@ -416,6 +420,10 @@ SOURCE=..\..\include\Ice\Current.h # End Source File
# Begin Source File
+SOURCE=..\..\include\Ice\Identity.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\Ice\Direct.h
# End Source File
# Begin Source File
@@ -881,6 +889,51 @@ BuildCmds= \ # End Source File
# Begin Source File
+SOURCE=..\..\slice\Ice\Identity.ice
+
+!IF "$(CFG)" == "Ice - Win32 Release"
+
+USERDEP__CURRE="../../bin/slice2cpp.exe"
+# Begin Custom Build
+InputPath=..\..\slice\Ice\Identity.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\lib \
+ ..\..\bin\slice2cpp.exe --dll-export ICE_API --include-dir Ice -I../../slice ../../slice/Ice/Identity.ice \
+ move Identity.h ..\..\include\Ice \
+
+
+"..\..\include\Ice\Identity.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Identity.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "Ice - Win32 Debug"
+
+USERDEP__CURRE="../../bin/slice2cpp.exe"
+# Begin Custom Build
+InputPath=..\..\slice\Ice\Identity.ice
+
+BuildCmds= \
+ set PATH=%PATH%;..\..\lib \
+ ..\..\bin\slice2cpp.exe --dll-export ICE_API --include-dir Ice -I../../slice ../../slice/Ice/Identity.ice \
+ move Identity.h ..\..\include\Ice \
+
+
+"..\..\include\Ice\Identity.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+
+"Identity.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ $(BuildCmds)
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=..\..\slice\Ice\LocalException.ice
!IF "$(CFG)" == "Ice - Win32 Release"
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 5bca50ba89b..5010e1cc2f0 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -113,6 +113,8 @@ Slice::Gen::generate(const UnitPtr& unit) { H << "\n#include <Ice/LocalObject.h>"; C << "\n#include <Ice/BasicStream.h>"; + C << "\n#include <Ice/Proxy.h>"; + C << "\n#include <Ice/Object.h>"; } StringList includes = unit->includeFiles(); @@ -378,11 +380,13 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) H << sp << nl << _dllExport << "void __write(::IceInternal::BasicStream*) const;"; // NOT virtual! H << nl << _dllExport << "void __read(::IceInternal::BasicStream*);"; // NOT virtual! + H << nl << _dllExport << "bool operator<(const " << name << "&) const;"; H << eb << ';'; TypeStringList memberList; DataMemberList dataMembers = p->dataMembers(); - for (DataMemberList::const_iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) + DataMemberList::const_iterator q; + for (q = dataMembers.begin(); q != dataMembers.end(); ++q) { memberList.push_back(make_pair((*q)->type(), (*q)->name())); } @@ -394,6 +398,25 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) C << sb; writeUnmarshalCode(C, memberList, 0); C << eb; + C << sp << nl << "bool" << nl << scoped.substr(2) << "::operator<(const " << name << "& __rhs) const"; + C << sb; + C << nl << "if (this == &__rhs)"; + C << sb; + C << nl << "return false;"; + C << eb; + for (q = dataMembers.begin(); q != dataMembers.end(); ++q) + { + C << nl << "if (" << (*q)->name() << " < __rhs." << (*q)->name() << ')'; + C << sb; + C << nl << "return true;"; + C << eb; + C << nl << "else if (__rhs." << (*q)->name() << " < " << (*q)->name() << ')'; + C << sb; + C << nl << "return false;"; + C << eb; + } + C << nl << "return false;"; + C << eb; } void |