[hydra-commits] hydra/ice branch, slice-translator-versioning, created.
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Fri Jun 25 08:39:31 CDT 2010
branch "slice-translator-versioning" has been created
at d62653452896c681c37cf40d2e38c33b2fd0d35e (commit)
- Log -----------------------------------------------------------------
commit d62653452896c681c37cf40d2e38c33b2fd0d35e
Author: Brent Eagles <beagles at digium.com>
Date: Fri Jun 25 10:59:41 2010 -0230
Fix C++ test script to deal with path issue
diff --git a/cpp/test/Ice/versioning/run.py b/cpp/test/Ice/versioning/run.py
index 722b0fe..8cb5bce 100755
--- a/cpp/test/Ice/versioning/run.py
+++ b/cpp/test/Ice/versioning/run.py
@@ -18,6 +18,7 @@ path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scri
if len(path) == 0:
raise "can't find toplevel directory!"
sys.path.append(os.path.join(path[0]))
+sys.path.append(os.path.join(os.path.dirname(sys.argv[0])))
from scripts import *
def runServer():
@@ -38,6 +39,10 @@ def runClient(suffix):
server = runServer()
client = runClient("1")
+client.waitTestSuccess()
+server.waitTestSuccess()
server = runServer()
client = runClient("2")
+client.waitTestSuccess()
+server.waitTestSuccess()
commit 9a0d91ac3c95cc6fd6658e253ec165eace62f478
Author: Brent Eagles <beagles at digium.com>
Date: Fri Jun 25 10:02:37 2010 -0230
Fix up the Windows build and test scripts.
diff --git a/cpp/test/Ice/Makefile.mak b/cpp/test/Ice/Makefile.mak
index a108997..af469f0 100644
--- a/cpp/test/Ice/Makefile.mak
+++ b/cpp/test/Ice/Makefile.mak
@@ -38,6 +38,7 @@ SUBDIRS = proxy \
defaultValue \
threadPoolPriority \
stream \
+ versioning \
!if "$(CPP_COMPILER)" != "VC60"
SUBDIRS = $(SUBDIRS) \
diff --git a/cpp/test/Ice/versioning/Makefile.mak b/cpp/test/Ice/versioning/Makefile.mak
index 2e08c24..6dd0652 100644
--- a/cpp/test/Ice/versioning/Makefile.mak
+++ b/cpp/test/Ice/versioning/Makefile.mak
@@ -30,6 +30,13 @@ CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
!endif
+SUBDIRS = version1 version2
+
+$(EVERYTHING)::
+ @for %i in ( $(SUBDIRS) ) do \
+ @echo "making $@ in %i" && \
+ cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $@" || exit 1
+
$(SERVER): $(SOBJS) $(OBJS)
$(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
@if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
diff --git a/cpp/test/Ice/versioning/version1/Makefile.mak b/cpp/test/Ice/versioning/version1/Makefile.mak
index 623a18e..380fc8d 100644
--- a/cpp/test/Ice/versioning/version1/Makefile.mak
+++ b/cpp/test/Ice/versioning/version1/Makefile.mak
@@ -19,22 +19,25 @@ OBJS = Client.obj \
!include $(top_srcdir)/config/Make.rules.mak
-SLICE2CPPFLAGS = $(SLICE2CPPFLAGS) -DVERSION1
-CPPFLAGS = -DVERSION1 -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+SLICE2CPPFLAGS = $(SLICE2CPPFLAGS) -DVERSION1 --suppress
+CPPFLAGS = -DVERSION1 -I. -I../../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
!if "$(GENERATE_PDB)" == "yes"
CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
!endif
Client.obj: ..\Client.cpp Test.h
+ $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) ..\Client.cpp
AllTests.obj: ..\AllTests.cpp Test.h
+ $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) ..\AllTests.cpp
Test.obj: Test.cpp Test.h
+ $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) Test.cpp
-Test.cpp: ..\Test.ice
+Test.cpp Test.h: ..\Test.ice
del /q Test.h Test.cpp
- $(SLICE2CPP) $(SLICE2CPPFLAGS) $^
+ $(SLICE2CPP) $(SLICE2CPPFLAGS) $?
$(CLIENT): $(OBJS)
$(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
diff --git a/cpp/test/Ice/versioning/version2/Makefile.mak b/cpp/test/Ice/versioning/version2/Makefile.mak
index 623a18e..b312ce6 100644
--- a/cpp/test/Ice/versioning/version2/Makefile.mak
+++ b/cpp/test/Ice/versioning/version2/Makefile.mak
@@ -9,7 +9,7 @@
top_srcdir = ..\..\..\..
-CLIENT = ..\client1.exe
+CLIENT = ..\client2.exe
TARGETS = $(CLIENT)
@@ -19,22 +19,25 @@ OBJS = Client.obj \
!include $(top_srcdir)/config/Make.rules.mak
-SLICE2CPPFLAGS = $(SLICE2CPPFLAGS) -DVERSION1
-CPPFLAGS = -DVERSION1 -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+SLICE2CPPFLAGS = $(SLICE2CPPFLAGS) -DVERSION2 --suppress
+CPPFLAGS = -DVERSION2 -I. -I../../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
!if "$(GENERATE_PDB)" == "yes"
CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
!endif
Client.obj: ..\Client.cpp Test.h
+ $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) ..\Client.cpp
AllTests.obj: ..\AllTests.cpp Test.h
+ $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) ..\AllTests.cpp
Test.obj: Test.cpp Test.h
+ $(CXX) /c $(CPPFLAGS) $(CXXFLAGS) Test.cpp
-Test.cpp: ..\Test.ice
+Test.cpp Test.h: ..\Test.ice
del /q Test.h Test.cpp
- $(SLICE2CPP) $(SLICE2CPPFLAGS) $^
+ $(SLICE2CPP) $(SLICE2CPPFLAGS) $?
$(CLIENT): $(OBJS)
$(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
diff --git a/cs/src/Ice/Makefile.mak b/cs/src/Ice/Makefile.mak
index 07e52c1..36ab4c9 100644
--- a/cs/src/Ice/Makefile.mak
+++ b/cs/src/Ice/Makefile.mak
@@ -55,6 +55,7 @@ SRCS = Acceptor.cs \
LocatorInfo.cs \
LoggerI.cs \
LoggerPlugin.cs \
+ MigrationProxy.cs \
Network.cs \
ObjectAdapterFactory.cs \
ObjectAdapterI.cs \
diff --git a/cs/test/Ice/Makefile.mak b/cs/test/Ice/Makefile.mak
index f3b1561..af9b3b3 100644
--- a/cs/test/Ice/Makefile.mak
+++ b/cs/test/Ice/Makefile.mak
@@ -40,7 +40,8 @@ SUBDIRS = application \
udp \
defaultServant \
defaultValue \
- threadPoolPriority
+ threadPoolPriority \
+ versioning
$(EVERYTHING)::
@for %i in ( $(SUBDIRS) ) do \
diff --git a/cs/test/Ice/versioning/Makefile.mak b/cs/test/Ice/versioning/Makefile.mak
index aa8a034..06516b5 100644
--- a/cs/test/Ice/versioning/Makefile.mak
+++ b/cs/test/Ice/versioning/Makefile.mak
@@ -7,21 +7,13 @@
#
# **********************************************************************
-top_srcdir = ..\..\..\..
+top_srcdir = ..\..\..
-TARGETS = client.exe server.exe serveramd.exe
+TARGETS = server.exe
-C_SRCS = AllTests.cs Client.cs
-S_SRCS = Server.cs TestI.cs
-SAMD_SRCS = Server.cs TestAMDI.cs
+SRCS = Server.cs InitialI.cs
-GEN_SRCS = $(GDIR)\Test.cs \
- $(GDIR)\Forward.cs
-CGEN_SRCS = $(GDIR)\ClientPrivate.cs
-SGEN_SRCS = $(GDIR)\ServerPrivate.cs
-GEN_AMD_SRCS = $(GDIR)\TestAMD.cs \
- $(GDIR)\Forward.cs
-SAMD_GEN_SRCS = $(GDIR)\ServerPrivateAMD.cs
+GEN_SRCS = $(GDIR)\Test.cs
SDIR = .
@@ -33,13 +25,7 @@ MCSFLAGS = $(MCSFLAGS) -target:exe
SLICE2CSFLAGS = $(SLICE2CSFLAGS) -I.
-client.exe: $(C_SRCS) $(GEN_SRCS) $(CGEN_SRCS)
- $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(C_SRCS) $(GEN_SRCS) $(CGEN_SRCS)
-
-server.exe: $(S_SRCS) $(GEN_SRCS) $(SGEN_SRCS)
- $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(S_SRCS) $(GEN_SRCS) $(SGEN_SRCS)
-
-serveramd.exe: $(SAMD_SRCS) $(GEN_AMD_SRCS) $(SAMD_GEN_SRCS)
- $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(SAMD_SRCS) $(GEN_AMD_SRCS) $(SAMD_GEN_SRCS)
+server.exe: $(SRCS) $(GEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(SRCS) $(GEN_SRCS)
!include .depend.mak
diff --git a/cs/test/Ice/versioning/generated/.gitignore b/cs/test/Ice/versioning/generated/.gitignore
new file mode 100644
index 0000000..8143e15
--- /dev/null
+++ b/cs/test/Ice/versioning/generated/.gitignore
@@ -0,0 +1 @@
+*.cs
diff --git a/cs/test/Ice/versioning/run.py b/cs/test/Ice/versioning/run.py
new file mode 100755
index 0000000..a0ba1ae
--- /dev/null
+++ b/cs/test/Ice/versioning/run.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys
+
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
+ raise "can't find toplevel directory!"
+sys.path.append(os.path.join(path[0]))
+from scripts import *
+
+def runServer():
+ server = "server"
+ driverConfig = TestUtil.DriverConfig("server")
+ driverConfig.lang = "cs"
+ cmd = TestUtil.getCommandLine(server, driverConfig)
+ proc = TestUtil.spawnServer(cmd)
+ return proc
+
+def runClient(suffix):
+ server = "client" + suffix
+ driverConfig = TestUtil.DriverConfig("client")
+ driverConfig.lang = "cs"
+ cmd = TestUtil.getCommandLine(server, driverConfig)
+ proc = TestUtil.spawnClient(cmd)
+ return proc
+
+server = runServer()
+client = runClient("1")
+client.waitTestSuccess()
+server.waitTestSuccess()
+
+server = runServer()
+client = runClient("2")
+client.waitTestSuccess()
+server.waitTestSuccess()
diff --git a/cs/test/Ice/versioning/version1/Makefile.mak b/cs/test/Ice/versioning/version1/Makefile.mak
new file mode 100755
index 0000000..7e7353d
--- /dev/null
+++ b/cs/test/Ice/versioning/version1/Makefile.mak
@@ -0,0 +1,31 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..\..
+
+TARGETS = ..\client1.exe
+
+SRCS = AllTests.cs Client.cs
+
+GEN_SRCS = $(GDIR)\Test.cs
+
+SDIR = ..
+
+GDIR = generated
+
+!include $(top_srcdir)\config\Make.rules.mak.cs
+
+MCSFLAGS = $(MCSFLAGS) -target:exe
+
+SLICE2CSFLAGS = $(SLICE2CSFLAGS) --suppress -DVERSION1 -I.
+
+..\client1.exe: $(SRCS) $(GEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(SRCS) $(GEN_SRCS)
+
+!include .depend.mak
diff --git a/cs/test/Ice/versioning/version1/generated/.gitignore b/cs/test/Ice/versioning/version1/generated/.gitignore
new file mode 100644
index 0000000..8143e15
--- /dev/null
+++ b/cs/test/Ice/versioning/version1/generated/.gitignore
@@ -0,0 +1 @@
+*.cs
diff --git a/cs/test/Ice/versioning/version2/AllTests.cs b/cs/test/Ice/versioning/version2/AllTests.cs
index 6b6c16d..e24403a 100644
--- a/cs/test/Ice/versioning/version2/AllTests.cs
+++ b/cs/test/Ice/versioning/version2/AllTests.cs
@@ -51,8 +51,8 @@ public class AllTests
Console.Out.Flush();
CA p = prx.getCA();
test(p.ice_id().Equals("::Test::Version2::CA"));
- test(p.message.Equals("version 1"));
- test(p.flag.Equals("1"));
+ test(p.message.Equals("version 2"));
+ test(p.flag == 1);
Console.Out.WriteLine("ok");
return initialPrx;
diff --git a/cs/test/Ice/versioning/version2/Makefile.mak b/cs/test/Ice/versioning/version2/Makefile.mak
new file mode 100755
index 0000000..9aec677
--- /dev/null
+++ b/cs/test/Ice/versioning/version2/Makefile.mak
@@ -0,0 +1,31 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..\..
+
+TARGETS = ..\client2.exe
+
+SRCS = AllTests.cs Client.cs
+
+GEN_SRCS = $(GDIR)\Test.cs
+
+SDIR = ..
+
+GDIR = generated
+
+!include $(top_srcdir)\config\Make.rules.mak.cs
+
+MCSFLAGS = $(MCSFLAGS) -target:exe
+
+SLICE2CSFLAGS = $(SLICE2CSFLAGS) --suppress -I. -DVERSION2
+
+..\client2.exe: $(SRCS) $(GEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(SRCS) $(GEN_SRCS)
+
+!include .depend.mak
diff --git a/cs/test/Ice/versioning/version2/generated/.gitignore b/cs/test/Ice/versioning/version2/generated/.gitignore
new file mode 100644
index 0000000..8143e15
--- /dev/null
+++ b/cs/test/Ice/versioning/version2/generated/.gitignore
@@ -0,0 +1 @@
+*.cs
diff --git a/java/test/Ice/versioning/run.py b/java/test/Ice/versioning/run.py
new file mode 100755
index 0000000..31c148f
--- /dev/null
+++ b/java/test/Ice/versioning/run.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys
+
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
+ raise "can't find toplevel directory!"
+sys.path.append(os.path.join(path[0]))
+from scripts import *
+
+def runServer():
+ server = "test.Ice.versioning.Server"
+ driverConfig = TestUtil.DriverConfig("server")
+ driverConfig.lang = "java"
+ cmd = TestUtil.getCommandLine(server, driverConfig)
+ proc = TestUtil.spawnServer(cmd)
+ return proc
+
+def runClient1():
+ server = "test.Ice.versioning.version1.Client"
+ driverConfig = TestUtil.DriverConfig("client")
+ driverConfig.lang = "java"
+ cmd = TestUtil.getCommandLine(server, driverConfig)
+ proc = TestUtil.spawnClient(cmd)
+ return proc
+
+def runClient2():
+ server = "test.Ice.versioning.version2.Client"
+ driverConfig = TestUtil.DriverConfig("client")
+ driverConfig.lang = "java"
+ cmd = TestUtil.getCommandLine(server, driverConfig)
+ proc = TestUtil.spawnClient(cmd)
+ return proc
+
+server = runServer()
+client = runClient1()
+client.waitTestSuccess()
+server.waitTestSuccess()
+
+server = runServer()
+client = runClient2()
+client.waitTestSuccess()
+server.waitTestSuccess()
commit c7e2f730ac1a1b4672510e135800d59675f3b771
Author: Brent Eagles <beagles at digium.com>
Date: Thu Jun 24 09:43:51 2010 -0230
(missed in last commit)
Added support for using scope suppressed types as arguments, etc.
Added support for keeping action type id in the suppressed scope types.
diff --git a/Makefile.mak b/Makefile.mak
index 79988f9..422ae85 100644
--- a/Makefile.mak
+++ b/Makefile.mak
@@ -75,6 +75,11 @@ php::
@echo "making all in php" && \
cmd /c "cd php && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1
+test::
+ @for %i in ( $(SUBDIRS) ) do \
+ @echo "making test in %i" && \
+ cmd /c "cd %i && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) test" || exit 1
+
vsplugin::
@echo "making all in vsplugin" && \
cmd /c "cd vsplugin && $(MAKE) -nologo -f Makefile.mak $(MAKEFLAGS) all" || exit 1
diff --git a/cpp/allTests.py b/cpp/allTests.py
index ef90e88..e3e692e 100755
--- a/cpp/allTests.py
+++ b/cpp/allTests.py
@@ -65,6 +65,7 @@ tests = [
("Ice/defaultServant", ["core"]),
("Ice/defaultValue", ["core"]),
("Ice/invoke", ["core", "novc6"]),
+ ("Ice/versioning", ["core"]),
("IceSSL/configuration", ["once", "novalgrind"]), # valgrind doesn't work well with openssl
("IceBox/configuration", ["core", "noipv6", "nobcc", "novc6"]),
("Freeze/dbmap", ["once", "novc6"]),
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules
index fffc4a5..cbaa291 100644
--- a/cpp/config/Make.rules
+++ b/cpp/config/Make.rules
@@ -24,7 +24,7 @@ embedded_runpath_prefix ?= /opt/Ice-$(VERSION_MAJOR).$(VERSION_MINOR)
# to automatically create a symbolic link for the embedded runpath
# directory. Only applies if embedded_runpath_prefix is also set.
#
-create_runpath_symlink ?= no
+create_runpath_symlink ?= yes
#
# Define OPTIMIZE as yes if you want to build with
diff --git a/cpp/include/Slice/JavaUtil.h b/cpp/include/Slice/JavaUtil.h
index c1fdd50..05257ff 100644
--- a/cpp/include/Slice/JavaUtil.h
+++ b/cpp/include/Slice/JavaUtil.h
@@ -90,6 +90,8 @@ protected:
//
std::string getPackage(const ContainedPtr&) const;
+ std::string getPackage(const ContainedPtr&, bool suppressScopes) const;
+
//
// Returns the Java name for a Contained entity. If the optional
// package argument matches the entity's package name, then the
@@ -100,6 +102,8 @@ protected:
const std::string& = std::string(),
const std::string& = std::string()) const;
+ std::string getAbsolute(const ContainedPtr&, bool suppressScopes) const;
+
//
// Get the Java name for a type. If an optional scope is provided,
// the scope will be removed from the result if possible.
diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h
index ad390b1..4ad5e56 100644
--- a/cpp/include/Slice/Parser.h
+++ b/cpp/include/Slice/Parser.h
@@ -332,6 +332,18 @@ protected:
// Contained
// ----------------------------------------------------------------------
+class SLICE_API ScopeGeneratorPolicy : public ::IceUtil::SimpleShared
+{
+public:
+ virtual ~ScopeGeneratorPolicy() {}
+ virtual std::string scopedName(ContainedPtr) const = 0;
+ virtual std::string scope(ContainedPtr) const = 0;
+};
+
+typedef ::IceUtil::Handle<ScopeGeneratorPolicy> ScopeGeneratorPolicyPtr;
+
+SLICE_API ScopeGeneratorPolicyPtr createSuppressorGenerator();
+
class SLICE_API Contained : virtual public SyntaxTreeBase
{
public:
@@ -341,10 +353,15 @@ public:
std::string scoped() const;
std::string scope() const;
std::string flattenedScope() const;
+ std::string scoped(bool) const;
+ std::string scope(bool) const;
+ std::string flattenedScope(bool) const;
std::string file() const;
std::string line() const;
std::string comment() const;
+ void setScopeGeneratorPolicy(const ScopeGeneratorPolicyPtr&);
+
int includeLevel() const;
void updateIncludeLevel();
@@ -391,6 +408,7 @@ protected:
std::string _comment;
int _includeLevel;
std::list<std::string> _metaData;
+ ScopeGeneratorPolicyPtr _scopeGeneratorPolicy;
};
// ----------------------------------------------------------------------
@@ -1003,6 +1021,8 @@ public:
BuiltinPtr builtin(Builtin::Kind); // Not const, as builtins are created on the fly. (Lazy initialization.)
+ void setScopeGeneratorPolicy(const ScopeGeneratorPolicyPtr&);
+
private:
Unit(bool, bool, bool, bool, const StringList&);
diff --git a/cpp/include/Slice/PythonUtil.h b/cpp/include/Slice/PythonUtil.h
index bd6bab1..6942e1d 100644
--- a/cpp/include/Slice/PythonUtil.h
+++ b/cpp/include/Slice/PythonUtil.h
@@ -21,7 +21,7 @@ namespace Python
//
// Generate Python code for a translation unit.
//
-SLICE_API void generate(const Slice::UnitPtr&, bool, bool, const std::vector<std::string>&, IceUtilInternal::Output&);
+SLICE_API void generate(const Slice::UnitPtr&, bool, bool, const std::vector<std::string>&, IceUtilInternal::Output&, bool);
//
// Convert a scoped name into a Python name.
@@ -49,7 +49,7 @@ SLICE_API std::string getPackageMetadata(const Slice::ContainedPtr&);
// COMPILERFIX: MSVC 6 seems to have a problem with const std::string
// = std::string(), const std::string = std::string().
//
-SLICE_API std::string getAbsolute(const Slice::ContainedPtr&, const std::string& = "", const std::string& = "");
+SLICE_API std::string getAbsolute(const Slice::ContainedPtr&, bool suppress, const std::string& = "", const std::string& = "");
//
// Emit a comment header.
diff --git a/cpp/include/Slice/RubyUtil.h b/cpp/include/Slice/RubyUtil.h
index fe9934a..574d370 100644
--- a/cpp/include/Slice/RubyUtil.h
+++ b/cpp/include/Slice/RubyUtil.h
@@ -21,7 +21,7 @@ namespace Ruby
//
// Generate Ruby code for a translation unit.
//
-SLICE_API void generate(const Slice::UnitPtr&, bool, bool, const std::vector<std::string>&, IceUtilInternal::Output&);
+SLICE_API void generate(const Slice::UnitPtr&, bool, bool, const std::vector<std::string>&, IceUtilInternal::Output&, bool);
//
// Check the given identifier against Ruby's list of reserved words. If it matches
@@ -39,7 +39,7 @@ SLICE_API std::string fixIdent(const std::string&, IdentStyle);
// Get the fully-qualified name of the given definition. If a prefix is provided,
// it is prepended to the definition's unqualified name.
//
-SLICE_API std::string getAbsolute(const Slice::ContainedPtr&, IdentStyle, const std::string& = std::string());
+SLICE_API std::string getAbsolute(const Slice::ContainedPtr&, bool, IdentStyle, const std::string& = std::string());
//
// Emit a comment header.
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index 5c06896..d08e153 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -408,6 +408,26 @@ Slice::JavaGenerator::getPackage(const ContainedPtr& cont) const
}
string
+Slice::JavaGenerator::getPackage(const ContainedPtr& cont, bool suppressScopes) const
+{
+ string scope = convertScopedName(cont->scope(suppressScopes));
+ string prefix = getPackagePrefix(cont);
+ if(!prefix.empty())
+ {
+ if(!scope.empty())
+ {
+ return prefix + "." + scope;
+ }
+ else
+ {
+ return prefix;
+ }
+ }
+
+ return scope;
+}
+
+string
Slice::JavaGenerator::getAbsolute(const ContainedPtr& cont,
const string& package,
const string& prefix,
@@ -434,6 +454,20 @@ Slice::JavaGenerator::getAbsolute(const ContainedPtr& cont,
}
string
+Slice::JavaGenerator::getAbsolute(const ContainedPtr& cont,
+ bool suppressScopes) const
+{
+ string name = cont->name();
+ name = fixKwd(name);
+ string contPkg = getPackage(cont, suppressScopes);
+ if(!contPkg.empty())
+ {
+ return contPkg + "." + name;
+ }
+ return name;
+}
+
+string
Slice::JavaGenerator::typeToString(const TypePtr& type,
TypeMode mode,
const string& package,
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index 5711c7b..29ad058 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -313,6 +313,40 @@ Slice::Builtin::Builtin(const UnitPtr& unit, Kind kind) :
_definitionContext = 0;
}
+class SuppressorGeneratorPolicy : public ScopeGeneratorPolicy
+{
+public:
+ string scopedName(Slice::ContainedPtr c) const
+ {
+ string result = scope(c) + c->name();
+ return result;
+ }
+
+ string scope(Slice::ContainedPtr c) const
+ {
+ std::string newScope = c->scope(false);
+ for(Slice::ContainedPtr contained = c; contained; contained = Slice::ContainedPtr::dynamicCast(contained->container()))
+ {
+ Slice::ModulePtr mod = Slice::ModulePtr::dynamicCast(contained);
+ if(mod && mod->hasMetaData("suppress"))
+ {
+ string scopeToSuppress = "::" + mod->name();
+ string::size_type pos = newScope.rfind(scopeToSuppress);
+ assert(pos != string::npos);
+ newScope.replace(pos, scopeToSuppress.length(), "");
+ }
+ }
+ return newScope;
+ }
+};
+
+Slice::ScopeGeneratorPolicyPtr
+Slice::createSuppressorGenerator()
+{
+ return new SuppressorGeneratorPolicy;
+}
+
+
// ----------------------------------------------------------------------
// Contained
// ----------------------------------------------------------------------
@@ -332,12 +366,20 @@ Slice::Contained::name() const
string
Slice::Contained::scoped() const
{
+ if(_scopeGeneratorPolicy)
+ {
+ return _scopeGeneratorPolicy->scopedName(const_cast<Slice::Contained*>(this));
+ }
return _scoped;
}
string
Slice::Contained::scope() const
{
+ if(_scopeGeneratorPolicy)
+ {
+ return _scopeGeneratorPolicy->scope(const_cast<Slice::Contained*>(this));
+ }
string::size_type idx = _scoped.rfind("::");
assert(idx != string::npos);
return string(_scoped, 0, idx + 2);
@@ -356,6 +398,40 @@ Slice::Contained::flattenedScope() const
}
string
+Slice::Contained::scoped(bool usePolicy) const
+{
+ if(usePolicy)
+ {
+ return scoped();
+ }
+ return _scoped;
+}
+
+string
+Slice::Contained::scope(bool usePolicy) const
+{
+ if(usePolicy)
+ {
+ return scope();
+ }
+ string::size_type idx = _scoped.rfind("::");
+ assert(idx != string::npos);
+ return string(_scoped, 0, idx + 2);
+}
+
+string
+Slice::Contained::flattenedScope(bool usePolicy) const
+{
+ string s = scope(usePolicy);
+ string flattenedScope;
+ for(string::const_iterator r = s.begin(); r != s.end(); ++r)
+ {
+ flattenedScope += ((*r) == ':') ? '_' : *r;
+ }
+ return flattenedScope;
+}
+
+string
Slice::Contained::file() const
{
return _file;
@@ -373,6 +449,12 @@ Slice::Contained::comment() const
return _comment;
}
+void
+Slice::Contained::setScopeGeneratorPolicy(const Slice::ScopeGeneratorPolicyPtr& policy)
+{
+ _scopeGeneratorPolicy = policy;
+}
+
int
Slice::Contained::includeLevel() const
{
@@ -5729,6 +5811,19 @@ Slice::Unit::builtin(Builtin::Kind kind)
_builtins.insert(make_pair(kind, builtin));
return builtin;
}
+
+void
+Slice::Unit::setScopeGeneratorPolicy(const ScopeGeneratorPolicyPtr& policy)
+{
+ for(map<string, Slice::ContainedList>::iterator i = _contentMap.begin(); i != _contentMap.end(); ++i)
+ {
+ for(Slice::ContainedList::iterator j = i->second.begin(); j != i->second.end(); ++ j)
+ {
+ (*j)->setScopeGeneratorPolicy(policy);
+ }
+ }
+}
+
Slice::Unit::Unit(bool ignRedefs, bool all, bool allowIcePrefix, bool allowUnderscore,
const StringList& defaultGlobalMetadata) :
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index 08c30f4..d5c1c4c 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -71,7 +71,7 @@ class ModuleVisitor : public ParserVisitor
{
public:
- ModuleVisitor(Output&, set<string>&);
+ ModuleVisitor(Output&, set<string>&, bool);
virtual bool visitModuleStart(const ModulePtr&);
@@ -79,6 +79,8 @@ private:
Output& _out;
set<string>& _history;
+
+ bool _suppress;
};
//
@@ -88,7 +90,7 @@ class CodeVisitor : public ParserVisitor
{
public:
- CodeVisitor(IceUtilInternal::Output&, set<string>&);
+ CodeVisitor(IceUtilInternal::Output&, set<string>&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -170,12 +172,36 @@ private:
set<string>& _moduleHistory;
list<string> _moduleStack;
set<string> _classHistory;
+
+ bool _suppress;
};
}
}
static string
+suppressedscoped(const ContainerPtr& cp, string scope, bool _suppress)
+{
+ string suppressed_scope = scope;
+
+ if (_suppress) {
+ for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+ ModulePtr mod = ModulePtr::dynamicCast(contained);
+ if (mod && mod->hasMetaData("suppress")) {
+ string suppress_string = "::" + mod->name();
+ string::size_type pos = suppressed_scope.rfind(suppress_string);
+ if(pos != string::npos)
+ {
+ suppressed_scope.replace(pos, suppress_string.length(), "");
+ }
+ }
+ }
+ }
+
+ return suppressed_scope;
+}
+
+static string
lookupKwd(const string& name)
{
//
@@ -229,9 +255,9 @@ splitScopedName(const string& scoped)
}
static string
-getDictLookup(const ContainedPtr& cont, const string& suffix = string())
+getDictLookup(const ContainedPtr& cont, bool suppress, const string& suffix = string())
{
- string scope = Slice::Python::scopedToName(cont->scope());
+ string scope = Slice::Python::scopedToName(suppressedscoped(cont->container(), cont->scope(), suppress));
assert(!scope.empty());
string package = Slice::Python::getPackageMetadata(cont);
@@ -246,17 +272,17 @@ getDictLookup(const ContainedPtr& cont, const string& suffix = string())
//
// ModuleVisitor implementation.
//
-Slice::Python::ModuleVisitor::ModuleVisitor(Output& out, set<string>& history) :
- _out(out), _history(history)
+Slice::Python::ModuleVisitor::ModuleVisitor(Output& out, set<string>& history, bool suppress) :
+ _out(out), _history(history), _suppress(suppress)
{
}
bool
Slice::Python::ModuleVisitor::visitModuleStart(const ModulePtr& p)
{
- if(p->includeLevel() > 0)
+ if(p->includeLevel() > 0 && (!p->hasMetaData("suppress") || !_suppress))
{
- string abs = getAbsolute(p);
+ string abs = getAbsolute(p, _suppress);
if(_history.count(abs) == 0)
{
//
@@ -296,8 +322,8 @@ Slice::Python::ModuleVisitor::visitModuleStart(const ModulePtr& p)
//
// CodeVisitor implementation.
//
-Slice::Python::CodeVisitor::CodeVisitor(Output& out, set<string>& moduleHistory) :
- _out(out), _moduleHistory(moduleHistory)
+Slice::Python::CodeVisitor::CodeVisitor(Output& out, set<string>& moduleHistory, bool suppress) :
+ _out(out), _moduleHistory(moduleHistory), _suppress(suppress)
{
}
@@ -318,7 +344,11 @@ Slice::Python::CodeVisitor::visitModuleStart(const ModulePtr& p)
//
// This allows us to create types in the module Foo.
//
- string abs = getAbsolute(p);
+ if (p->hasMetaData("suppress") && _suppress) {
+ return true;
+ }
+
+ string abs = getAbsolute(p, _suppress);
_out << sp << nl << "# Start of module " << abs;
if(_moduleHistory.count(abs) == 0) // Don't emit this more than once for each module.
{
@@ -364,13 +394,15 @@ Slice::Python::CodeVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Python::CodeVisitor::visitModuleEnd(const ModulePtr& p)
{
- assert(!_moduleStack.empty());
- _out << sp << nl << "# End of module " << _moduleStack.front();
- _moduleStack.pop_front();
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ assert(!_moduleStack.empty());
+ _out << sp << nl << "# End of module " << _moduleStack.front();
+ _moduleStack.pop_front();
- if(!_moduleStack.empty())
- {
- _out << sp << nl << "__name__ = '" << _moduleStack.front() << "'";
+ if(!_moduleStack.empty())
+ {
+ _out << sp << nl << "__name__ = '" << _moduleStack.front() << "'";
+ }
}
}
@@ -383,13 +415,13 @@ Slice::Python::CodeVisitor::visitClassDecl(const ClassDeclPtr& p)
string scoped = p->scoped();
if(_classHistory.count(scoped) == 0)
{
- _out << sp << nl << "if not " << getDictLookup(p) << ':';
+ _out << sp << nl << "if not " << getDictLookup(p, _suppress) << ':';
_out.inc();
- string type = getAbsolute(p, "_t_");
+ string type = getAbsolute(p, _suppress, "_t_");
_out << nl << "_M_" << type << " = IcePy.declareClass('" << scoped << "')";
if(!p->isLocal())
{
- _out << nl << "_M_" << getAbsolute(p, "_t_", "Prx") << " = IcePy.declareProxy('" << scoped << "')";
+ _out << nl << "_M_" << getAbsolute(p, _suppress, "_t_", "Prx") << " = IcePy.declareProxy('" << scoped << "')";
}
_out.dec();
_classHistory.insert(scoped); // Avoid redundant declarations.
@@ -400,12 +432,12 @@ bool
Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
string scoped = p->scoped();
- string type = getAbsolute(p, "_t_");
- string abs = getAbsolute(p);
+ string type = getAbsolute(p, _suppress, "_t_");
+ string abs = getAbsolute(p, _suppress);
string name = fixIdent(p->name());
- string prxAbs = getAbsolute(p, "", "Prx");
+ string prxAbs = getAbsolute(p, _suppress, "", "Prx");
string prxName = fixIdent(p->name() + "Prx");
- string prxType = getAbsolute(p, "_t_", "Prx");
+ string prxType = getAbsolute(p, _suppress, "_t_", "Prx");
ClassList bases = p->bases();
ClassDefPtr base;
OperationList ops = p->operations();
@@ -415,7 +447,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Define the class.
//
- _out << sp << nl << "if not " << getDictLookup(p) << ':';
+ _out << sp << nl << "if not " << getDictLookup(p, _suppress) << ':';
_out.inc();
_out << nl << "_M_" << abs << " = Ice.createTempClass()";
_out << nl << "class " << name << '(';
@@ -518,7 +550,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped));
#endif
StringList other;
- other.push_back(scoped);
+ other.push_back(p->scoped(false));
other.push_back("::Ice::Object");
other.sort();
ids.merge(other);
@@ -542,7 +574,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
_out << sp << nl << "def ice_id(self, current=None):";
_out.inc();
- _out << nl << "return '" << scoped << "'";
+ _out << nl << "return '" << p->scoped(false) << "'";
_out.dec();
//
@@ -550,7 +582,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
_out << sp << nl << "def ice_staticId():";
_out.inc();
- _out << nl << "return '" << scoped << "'";
+ _out << nl << "return '" << p->scoped(false) << "'";
_out.dec();
_out << nl << "ice_staticId = staticmethod(ice_staticId)";
}
@@ -625,7 +657,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
_out << sp << nl << "def __str__(self):";
_out.inc();
- _out << nl << "return IcePy.stringify(self, _M_" << getAbsolute(p, "_t_") << ")";
+ _out << nl << "return IcePy.stringify(self, _M_" << getAbsolute(p, _suppress, "_t_") << ")";
_out.dec();
_out << sp << nl << "__repr__ = __str__";
@@ -770,7 +802,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << sp << nl << "def checkedCast(proxy, facetOrCtx=None, _ctx=None):";
_out.inc();
- _out << nl << "return _M_" << prxAbs << ".ice_checkedCast(proxy, '" << scoped << "', facetOrCtx, _ctx)";
+ _out << nl << "return _M_" << prxAbs << ".ice_checkedCast(proxy, '" << p->scoped(false) << "', facetOrCtx, _ctx)";
_out.dec();
_out << nl << "checkedCast = staticmethod(checkedCast)";
@@ -782,7 +814,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out.dec();
- _out << sp << nl << "_M_" << prxType << " = IcePy.defineProxy('" << scoped << "', " << prxName << ")";
+ _out << sp << nl << "_M_" << prxType << " = IcePy.defineProxy('" << p->scoped(false) << "', " << prxName << ")";
}
if(_classHistory.count(scoped) == 0 && p->canBeCyclic())
@@ -790,11 +822,11 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Emit a forward declaration for the class in case a data member refers to this type.
//
- _out << sp << nl << "_M_" << type << " = IcePy.declareClass('" << scoped << "')";
+ _out << sp << nl << "_M_" << type << " = IcePy.declareClass('" << p->scoped(false) << "')";
}
DataMemberList members = p->dataMembers();
- _out << sp << nl << "_M_" << type << " = IcePy.defineClass('" << scoped << "', " << name << ", ";
+ _out << sp << nl << "_M_" << type << " = IcePy.defineClass('" << p->scoped(false) << "', " << name << ", ";
writeMetaData(p->getMetaData());
_out << ", " << (isAbstract ? "True" : "False") << ", ";
if(!base)
@@ -803,7 +835,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
}
else
{
- _out << "_M_" << getAbsolute(base, "_t_");
+ _out << "_M_" << getAbsolute(base, _suppress, "_t_");
}
_out << ", (";
//
@@ -818,7 +850,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
_out << ", ";
}
- _out << "_M_" << getAbsolute(*q, "_t_");
+ _out << "_M_" << getAbsolute(*q, _suppress, "_t_");
++interfaceCount;
}
}
@@ -955,7 +987,7 @@ Slice::Python::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
_out << ", ";
}
- _out << "_M_" << getAbsolute(*u, "_t_");
+ _out << "_M_" << getAbsolute(*u, _suppress, "_t_");
}
if(exceptions.size() == 1)
{
@@ -998,10 +1030,10 @@ bool
Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
{
string scoped = p->scoped();
- string abs = getAbsolute(p);
+ string abs = getAbsolute(p, _suppress);
string name = fixIdent(p->name());
- _out << sp << nl << "if not " << getDictLookup(p) << ':';
+ _out << sp << nl << "if not " << getDictLookup(p, _suppress) << ':';
_out.inc();
_out << nl << "_M_" << abs << " = Ice.createTempClass()";
_out << nl << "class " << name << '(';
@@ -1088,7 +1120,7 @@ Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
//
// Emit the type information.
//
- string type = getAbsolute(p, "_t_");
+ string type = getAbsolute(p, _suppress, "_t_");
_out << sp << nl << "_M_" << type << " = IcePy.defineException('" << scoped << "', " << name << ", ";
writeMetaData(p->getMetaData());
_out << ", ";
@@ -1098,7 +1130,7 @@ Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
}
else
{
- _out << "_M_" << getAbsolute(base, "_t_");
+ _out << "_M_" << getAbsolute(base, _suppress, "_t_");
}
_out << ", (";
if(members.size() > 1)
@@ -1148,7 +1180,7 @@ bool
Slice::Python::CodeVisitor::visitStructStart(const StructPtr& p)
{
string scoped = p->scoped();
- string abs = getAbsolute(p);
+ string abs = getAbsolute(p, _suppress);
string name = fixIdent(p->name());
MemberInfoList memberList;
MemberInfoList::iterator r;
@@ -1164,7 +1196,7 @@ Slice::Python::CodeVisitor::visitStructStart(const StructPtr& p)
}
}
- _out << sp << nl << "if not " << getDictLookup(p) << ':';
+ _out << sp << nl << "if not " << getDictLookup(p, _suppress) << ':';
_out.inc();
_out << nl << "_M_" << abs << " = Ice.createTempClass()";
_out << nl << "class " << name << "(object):";
@@ -1262,7 +1294,7 @@ Slice::Python::CodeVisitor::visitStructStart(const StructPtr& p)
//
_out << sp << nl << "def __str__(self):";
_out.inc();
- _out << nl << "return IcePy.stringify(self, _M_" << getAbsolute(p, "_t_") << ")";
+ _out << nl << "return IcePy.stringify(self, _M_" << getAbsolute(p, _suppress, "_t_") << ")";
_out.dec();
_out << sp << nl << "__repr__ = __str__";
@@ -1271,7 +1303,7 @@ Slice::Python::CodeVisitor::visitStructStart(const StructPtr& p)
//
// Emit the type information.
//
- _out << sp << nl << "_M_" << getAbsolute(p, "_t_") << " = IcePy.defineStruct('" << scoped << "', " << name << ", ";
+ _out << sp << nl << "_M_" << getAbsolute(p, _suppress, "_t_") << " = IcePy.defineStruct('" << scoped << "', " << name << ", ";
writeMetaData(p->getMetaData());
_out << ", (";
//
@@ -1342,18 +1374,18 @@ Slice::Python::CodeVisitor::visitSequence(const SequencePtr& p)
// Emit the type information.
//
string scoped = p->scoped();
- _out << sp << nl << "if not " << getDictLookup(p, "_t_") << ':';
+ _out << sp << nl << "if not " << getDictLookup(p, _suppress, "_t_") << ':';
_out.inc();
if(isCustom)
{
string package = customType.substr(0, customType.find('.'));
_out << nl << "import " << package;
- _out << nl << "_M_" << getAbsolute(p, "_t_")
+ _out << nl << "_M_" << getAbsolute(p, _suppress, "_t_")
<< " = IcePy.defineCustom('" << scoped << "', " << customType << ")";
}
else
{
- _out << nl << "_M_" << getAbsolute(p, "_t_") << " = IcePy.defineSequence('" << scoped << "', ";
+ _out << nl << "_M_" << getAbsolute(p, _suppress, "_t_") << " = IcePy.defineSequence('" << scoped << "', ";
writeMetaData(metaData);
_out << ", ";
writeType(p->type());
@@ -1369,9 +1401,9 @@ Slice::Python::CodeVisitor::visitDictionary(const DictionaryPtr& p)
// Emit the type information.
//
string scoped = p->scoped();
- _out << sp << nl << "if not " << getDictLookup(p, "_t_") << ':';
+ _out << sp << nl << "if not " << getDictLookup(p, _suppress, "_t_") << ':';
_out.inc();
- _out << nl << "_M_" << getAbsolute(p, "_t_") << " = IcePy.defineDictionary('" << scoped << "', ";
+ _out << nl << "_M_" << getAbsolute(p, _suppress, "_t_") << " = IcePy.defineDictionary('" << scoped << "', ";
writeMetaData(p->getMetaData());
_out << ", ";
writeType(p->keyType());
@@ -1385,13 +1417,13 @@ void
Slice::Python::CodeVisitor::visitEnum(const EnumPtr& p)
{
string scoped = p->scoped();
- string abs = getAbsolute(p);
+ string abs = getAbsolute(p, _suppress);
string name = fixIdent(p->name());
EnumeratorList enums = p->getEnumerators();
EnumeratorList::iterator q;
int i;
- _out << sp << nl << "if not " << getDictLookup(p) << ':';
+ _out << sp << nl << "if not " << getDictLookup(p, _suppress) << ':';
_out.inc();
_out << nl << "_M_" << abs << " = Ice.createTempClass()";
_out << nl << "class " << name << "(object):";
@@ -1481,7 +1513,7 @@ Slice::Python::CodeVisitor::visitEnum(const EnumPtr& p)
//
// Emit the type information.
//
- _out << sp << nl << "_M_" << getAbsolute(p, "_t_") << " = IcePy.defineEnum('" << scoped << "', " << name
+ _out << sp << nl << "_M_" << getAbsolute(p, _suppress, "_t_") << " = IcePy.defineEnum('" << scoped << "', " << name
<< ", ";
writeMetaData(p->getMetaData());
_out << ", (";
@@ -1512,7 +1544,7 @@ Slice::Python::CodeVisitor::visitConst(const ConstPtr& p)
string value = p->value();
string name = fixIdent(p->name());
- _out << sp << nl << "_M_" << getAbsolute(p) << " = ";
+ _out << sp << nl << "_M_" << getAbsolute(p, _suppress) << " = ";
writeConstantValue(type, value);
}
@@ -1522,7 +1554,7 @@ Slice::Python::CodeVisitor::getSymbol(const ContainedPtr& p, const string& nameS
//
// An explicit reference to another type must always be prefixed with "_M_".
//
- return "_M_" + getAbsolute(p, "", nameSuffix);
+ return "_M_" + getAbsolute(p, _suppress, "", nameSuffix);
}
void
@@ -1603,13 +1635,13 @@ Slice::Python::CodeVisitor::writeType(const TypePtr& p)
ProxyPtr prx = ProxyPtr::dynamicCast(p);
if(prx)
{
- _out << "_M_" << getAbsolute(prx->_class(), "_t_", "Prx");
+ _out << "_M_" << getAbsolute(prx->_class(), _suppress, "_t_", "Prx");
return;
}
ContainedPtr cont = ContainedPtr::dynamicCast(p);
assert(cont);
- _out << "_M_" << getAbsolute(cont, "_t_");
+ _out << "_M_" << getAbsolute(cont, _suppress, "_t_");
}
void
@@ -2194,8 +2226,13 @@ Slice::Python::CodeVisitor::editComment(const string& comment)
}
void
-Slice::Python::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out)
+Slice::Python::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out, bool suppress)
{
+ if(suppress)
+ {
+ un->setScopeGeneratorPolicy(createSuppressorGenerator());
+ }
+
Slice::Python::MetaDataVisitor visitor;
un->visit(&visitor, false);
@@ -2220,10 +2257,10 @@ Slice::Python::generate(const UnitPtr& un, bool all, bool checksum, const vector
set<string> moduleHistory;
- ModuleVisitor moduleVisitor(out, moduleHistory);
+ ModuleVisitor moduleVisitor(out, moduleHistory, suppress);
un->visit(&moduleVisitor, true);
- CodeVisitor codeVisitor(out, moduleHistory);
+ CodeVisitor codeVisitor(out, moduleHistory, suppress);
un->visit(&codeVisitor, false);
if(checksum)
@@ -2304,9 +2341,9 @@ Slice::Python::getPackageMetadata(const ContainedPtr& cont)
}
string
-Slice::Python::getAbsolute(const ContainedPtr& cont, const string& suffix, const string& nameSuffix)
+Slice::Python::getAbsolute(const ContainedPtr& cont, bool suppress, const string& suffix, const string& nameSuffix)
{
- string scope = scopedToName(cont->scope());
+ string scope = scopedToName(suppressedscoped(cont->container(), cont->scope(), suppress));
string package = getPackageMetadata(cont);
if(!package.empty())
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index f62dbc1..1dbd43d 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -31,7 +31,7 @@ class CodeVisitor : public ParserVisitor
{
public:
- CodeVisitor(IceUtilInternal::Output&);
+ CodeVisitor(IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -95,12 +95,36 @@ private:
Output& _out;
set<string> _classHistory;
+
+ bool _suppress;
};
}
}
static string
+suppressedscoped(const ContainerPtr& cp, string scope, bool _suppress)
+{
+ string suppressed_scope = scope;
+
+ if (_suppress) {
+ for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+ ModulePtr mod = ModulePtr::dynamicCast(contained);
+ if (mod && mod->hasMetaData("suppress")) {
+ string suppress_string = "::" + mod->name();
+ string::size_type pos = suppressed_scope.rfind(suppress_string);
+ if(pos != string::npos)
+ {
+ suppressed_scope.replace(pos, suppress_string.length(), "");
+ }
+ }
+ }
+ }
+
+ return suppressed_scope;
+}
+
+static string
lookupKwd(const string& name)
{
//
@@ -163,24 +187,28 @@ splitScopedName(const string& scoped)
//
// CodeVisitor implementation.
//
-Slice::Ruby::CodeVisitor::CodeVisitor(Output& out) :
- _out(out)
+Slice::Ruby::CodeVisitor::CodeVisitor(Output& out, bool suppress) :
+ _out(out), _suppress(suppress)
{
}
bool
Slice::Ruby::CodeVisitor::visitModuleStart(const ModulePtr& p)
{
- _out << sp << nl << "module " << fixIdent(p->name(), IdentToUpper);
- _out.inc();
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "module " << fixIdent(p->name(), IdentToUpper);
+ _out.inc();
+ }
return true;
}
void
Slice::Ruby::CodeVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out.dec();
- _out << nl << "end";
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out.dec();
+ _out << nl << "end";
+ }
}
void
@@ -193,16 +221,16 @@ Slice::Ruby::CodeVisitor::visitClassDecl(const ClassDeclPtr& p)
if(_classHistory.count(scoped) == 0)
{
string name = "T_" + fixIdent(p->name(), IdentToUpper);
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper, "T_") << ')';
_out.inc();
if(p->isLocal())
{
- _out << nl << name << " = ::Ice::__declareLocalClass('" << scoped << "')";
+ _out << nl << name << " = ::Ice::__declareLocalClass('" << p->scoped(false) << "')";
}
else
{
- _out << nl << name << " = ::Ice::__declareClass('" << scoped << "')";
- _out << nl << name << "Prx = ::Ice::__declareProxy('" << scoped << "')";
+ _out << nl << name << " = ::Ice::__declareClass('" << p->scoped(false) << "')";
+ _out << nl << name << "Prx = ::Ice::__declareProxy('" << p->scoped(false) << "')";
}
_out.dec();
_out << nl << "end";
@@ -223,7 +251,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Define a mix-in module for the class.
//
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << "_mixin)";
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper) << "_mixin)";
_out.inc();
_out << nl << "module " << name << "_mixin";
_out.inc();
@@ -233,7 +261,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
if(!bases.empty() && !bases.front()->isInterface())
{
base = bases.front();
- _out << nl << "include " << getAbsolute(bases.front(), IdentToUpper) << "_mixin";
+ _out << nl << "include " << getAbsolute(bases.front(), _suppress, IdentToUpper) << "_mixin";
}
else
{
@@ -257,7 +285,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped));
#endif
StringList other;
- other.push_back(scoped);
+ other.push_back(p->scoped(false));
other.push_back("::Ice::Object");
other.sort();
ids.merge(other);
@@ -282,7 +310,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
_out << sp << nl << "def ice_id(current=nil)";
_out.inc();
- _out << nl << "'" << scoped << "'";
+ _out << nl << "'" << p->scoped(false) << "'";
_out.dec();
_out << nl << "end";
}
@@ -420,7 +448,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl;
_out << nl << "def " << name << ".ice_staticId()";
_out.inc();
- _out << nl << "'" << scoped << "'";
+ _out << nl << "'" << p->scoped(false) << "'";
_out.dec();
_out << nl << "end";
_out.dec();
@@ -434,14 +462,14 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "class " << name;
if(base)
{
- _out << " < " << getAbsolute(base, IdentToUpper);
+ _out << " < " << getAbsolute(base, _suppress, IdentToUpper);
}
_out.inc();
_out << nl << "include " << name << "_mixin";
_out << nl;
_out << nl << "def " << name << ".ice_staticId()";
_out.inc();
- _out << nl << "'" << scoped << "'";
+ _out << nl << "'" << p->scoped(false) << "'";
_out.dec();
_out << nl << "end";
@@ -507,7 +535,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out.inc();
for(ClassList::iterator cli = bases.begin(); cli != bases.end(); ++cli)
{
- _out << nl << "include " << getAbsolute(*cli, IdentToUpper) << "Prx_mixin";
+ _out << nl << "include " << getAbsolute(*cli, _suppress, IdentToUpper) << "Prx_mixin";
}
for(oli = ops.begin(); oli != ops.end(); ++oli)
{
@@ -574,7 +602,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << sp << nl << "def " << name << "Prx.checkedCast(proxy, facetOrCtx=nil, _ctx=nil)";
_out.inc();
- _out << nl << "ice_checkedCast(proxy, '" << scoped << "', facetOrCtx, _ctx)";
+ _out << nl << "ice_checkedCast(proxy, '" << p->scoped(false) << "', facetOrCtx, _ctx)";
_out.dec();
_out << nl << "end";
@@ -591,16 +619,16 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Emit type descriptions.
//
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper, "T_") << ')';
_out.inc();
if(p->isLocal())
{
- _out << nl << "T_" << name << " = ::Ice::__declareLocalClass('" << scoped << "')";
+ _out << nl << "T_" << name << " = ::Ice::__declareLocalClass('" << p->scoped(false) << "')";
}
else
{
- _out << nl << "T_" << name << " = ::Ice::__declareClass('" << scoped << "')";
- _out << nl << "T_" << name << "Prx = ::Ice::__declareProxy('" << scoped << "')";
+ _out << nl << "T_" << name << " = ::Ice::__declareClass('" << p->scoped(false) << "')";
+ _out << nl << "T_" << name << "Prx = ::Ice::__declareProxy('" << p->scoped(false) << "')";
}
_out.dec();
_out << nl << "end";
@@ -614,7 +642,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
}
else
{
- _out << getAbsolute(base, IdentToUpper, "T_");
+ _out << getAbsolute(base, _suppress, IdentToUpper, "T_");
}
_out << ", [";
//
@@ -632,7 +660,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
_out << ", ";
}
- _out << getAbsolute(*q, IdentToUpper, "T_");
+ _out << getAbsolute(*q, _suppress, IdentToUpper, "T_");
++interfaceCount;
}
}
@@ -766,7 +794,7 @@ Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
_out << ", ";
}
- _out << getAbsolute(*u, IdentToUpper, "T_");
+ _out << getAbsolute(*u, _suppress, IdentToUpper, "T_");
}
_out << "])";
@@ -796,14 +824,14 @@ Slice::Ruby::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
string scoped = p->scoped();
string name = fixIdent(p->name(), IdentToUpper);
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')';
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper) << ')';
_out.inc();
_out << nl << "class " << name << " < ";
ExceptionPtr base = p->base();
string baseName;
if(base)
{
- baseName = getAbsolute(base, IdentToUpper);
+ baseName = getAbsolute(base, _suppress, IdentToUpper);
_out << baseName;
}
else if(p->isLocal())
@@ -903,7 +931,7 @@ Slice::Ruby::CodeVisitor::visitExceptionStart(const ExceptionPtr& p)
}
else
{
- _out << getAbsolute(base, IdentToUpper, "T_");
+ _out << getAbsolute(base, _suppress, IdentToUpper, "T_");
}
_out << ", [";
if(members.size() > 1)
@@ -962,7 +990,7 @@ Slice::Ruby::CodeVisitor::visitStructStart(const StructPtr& p)
}
}
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')';
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper) << ')';
_out.inc();
_out << nl << "class " << name;
_out.inc();
@@ -1101,7 +1129,7 @@ Slice::Ruby::CodeVisitor::visitSequence(const SequencePtr& p)
//
string name = fixIdent(p->name(), IdentToUpper);
string scoped = p->scoped();
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper, "T_") << ')';
_out.inc();
_out << nl << "T_" << name << " = ::Ice::__defineSequence('" << scoped << "', ";
writeType(p->type());
@@ -1118,7 +1146,7 @@ Slice::Ruby::CodeVisitor::visitDictionary(const DictionaryPtr& p)
//
string name = fixIdent(p->name(), IdentToUpper);
string scoped = p->scoped();
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper, "T_") << ')';
_out.inc();
_out << nl << "T_" << name << " = ::Ice::__defineDictionary('" << scoped << "', ";
writeType(p->keyType());
@@ -1138,7 +1166,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p)
EnumeratorList::iterator q;
int i;
- _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')';
+ _out << sp << nl << "if not defined?(" << getAbsolute(p, _suppress, IdentToUpper) << ')';
_out.inc();
_out << nl << "class " << name;
_out.inc();
@@ -1364,13 +1392,13 @@ Slice::Ruby::CodeVisitor::writeType(const TypePtr& p)
ProxyPtr prx = ProxyPtr::dynamicCast(p);
if(prx)
{
- _out << getAbsolute(prx->_class(), IdentToUpper, "T_") << "Prx";
+ _out << getAbsolute(prx->_class(), _suppress, IdentToUpper, "T_") << "Prx";
return;
}
ContainedPtr cont = ContainedPtr::dynamicCast(p);
assert(cont);
- _out << getAbsolute(cont, IdentToUpper, "T_");
+ _out << getAbsolute(cont, _suppress, IdentToUpper, "T_");
}
string
@@ -1414,13 +1442,13 @@ Slice::Ruby::CodeVisitor::getDefaultValue(const TypePtr& p)
if(en)
{
EnumeratorList enums = en->getEnumerators();
- return getAbsolute(en, IdentToUpper) + "::" + fixIdent(enums.front()->name(), IdentToUpper);
+ return getAbsolute(en, _suppress, IdentToUpper) + "::" + fixIdent(enums.front()->name(), IdentToUpper);
}
StructPtr st = StructPtr::dynamicCast(p);
if(st)
{
- return getAbsolute(st, IdentToUpper) + ".new";
+ return getAbsolute(st, _suppress, IdentToUpper) + ".new";
}
return "nil";
@@ -1545,7 +1573,7 @@ Slice::Ruby::CodeVisitor::writeConstantValue(const TypePtr& type, const string&
}
else if(en)
{
- _out << getAbsolute(en, IdentToUpper) << "::";
+ _out << getAbsolute(en, _suppress, IdentToUpper) << "::";
string::size_type colon = value.rfind(':');
if(colon != string::npos)
{
@@ -1629,10 +1657,15 @@ Slice::Ruby::CodeVisitor::collectExceptionMembers(const ExceptionPtr& p, MemberI
}
void
-Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out)
+Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<string>& includePaths, Output& out, bool suppress)
{
out << nl << "require 'Ice'";
+ if(suppress)
+ {
+ un->setScopeGeneratorPolicy(createSuppressorGenerator());
+ }
+
if(!all)
{
vector<string> paths = includePaths;
@@ -1649,7 +1682,7 @@ Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum, const vector<s
}
}
- CodeVisitor codeVisitor(out);
+ CodeVisitor codeVisitor(out, suppress);
un->visit(&codeVisitor, false);
if(checksum)
@@ -1736,9 +1769,9 @@ Slice::Ruby::fixIdent(const string& ident, IdentStyle style)
}
string
-Slice::Ruby::getAbsolute(const ContainedPtr& cont, IdentStyle style, const string& prefix)
+Slice::Ruby::getAbsolute(const ContainedPtr& cont, bool suppress, IdentStyle style, const string& prefix)
{
- string scope = fixIdent(cont->scope(), IdentToUpper);
+ string scope = fixIdent(suppressedscoped(cont->container(), cont->scope(), suppress), IdentToUpper);
if(prefix.empty())
{
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 9442aea..74d2744 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -128,7 +128,7 @@ writeDataMemberInitializers(IceUtilInternal::Output& C, const DataMemberList& me
Slice::Gen::Gen(const string& base, const string& headerExtension, const string& sourceExtension,
const vector<string>& extraHeaders, const string& include,
const vector<string>& includePaths, const string& dllExport, const string& dir,
- bool imp, bool checksum, bool stream, bool ice) :
+ bool imp, bool checksum, bool stream, bool ice, bool suppress) :
_base(base),
_headerExtension(headerExtension),
_implHeaderExtension(headerExtension),
@@ -141,7 +141,8 @@ Slice::Gen::Gen(const string& base, const string& headerExtension, const string&
_impl(imp),
_checksum(checksum),
_stream(stream),
- _ice(ice)
+ _ice(ice),
+ _suppress(suppress)
{
for(vector<string>::iterator p = _includePaths.begin(); p != _includePaths.end(); ++p)
{
@@ -157,12 +158,12 @@ Slice::Gen::Gen(const string& base, const string& headerExtension, const string&
Slice::Gen::~Gen()
{
- H << "\n\n#endif\n";
+ H << "\n";
C << '\n';
if(_impl)
{
- implH << "\n\n#endif\n";
+ implH << "\n";
implC << '\n';
}
}
@@ -172,6 +173,12 @@ Slice::Gen::generate(const UnitPtr& p)
{
string file = p->topLevelFile();
+ if(_suppress)
+ {
+ p->setScopeGeneratorPolicy(createSuppressorGenerator());
+ }
+
+
//
// Give precedence to header-ext global metadata.
//
@@ -229,9 +236,7 @@ Slice::Gen::generate(const UnitPtr& p)
s = _include + '/' + s;
}
transform(s.begin(), s.end(), s.begin(), ToIfdef());
- implH << "#ifndef __" << s << "__";
- implH << "\n#define __" << s << "__";
- implH << '\n';
+ implH << "#pragma once\n";
}
string fileH = _base + "." + _headerExtension;
@@ -266,15 +271,7 @@ Slice::Gen::generate(const UnitPtr& p)
printGeneratedHeader(C, _base + ".ice");
- string s = fileH;
- if(_include.size())
- {
- s = _include + '/' + s;
- }
- transform(s.begin(), s.end(), s.begin(), ToIfdef());
- H << "\n#ifndef __" << s << "__";
- H << "\n#define __" << s << "__";
- H << '\n';
+ H << "\n#pragma once\n";
validateMetaData(p);
@@ -414,25 +411,25 @@ Slice::Gen::generate(const UnitPtr& p)
_dllExport += " ";
}
- ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport);
+ ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport, _suppress);
p->visit(&proxyDeclVisitor, false);
- ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport);
+ ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport, _suppress);
p->visit(&objectDeclVisitor, false);
- IceInternalVisitor iceInternalVisitor(H, C, _dllExport);
+ IceInternalVisitor iceInternalVisitor(H, C, _dllExport, _suppress);
p->visit(&iceInternalVisitor, false);
- HandleVisitor handleVisitor(H, C, _dllExport, _stream);
+ HandleVisitor handleVisitor(H, C, _dllExport, _stream, _suppress);
p->visit(&handleVisitor, false);
- TypesVisitor typesVisitor(H, C, _dllExport, _stream);
+ TypesVisitor typesVisitor(H, C, _dllExport, _stream, _suppress);
p->visit(&typesVisitor, false);
- AsyncVisitor asyncVisitor(H, C, _dllExport);
+ AsyncVisitor asyncVisitor(H, C, _dllExport, _suppress);
p->visit(&asyncVisitor, false);
- AsyncImplVisitor asyncImplVisitor(H, C, _dllExport);
+ AsyncImplVisitor asyncImplVisitor(H, C, _dllExport, _suppress);
p->visit(&asyncImplVisitor, false);
//
@@ -441,27 +438,27 @@ Slice::Gen::generate(const UnitPtr& p)
// the proxy relies on knowing the hierarchy to make the begin_
// methods type-safe.
//
- AsyncCallbackVisitor asyncCallbackVisitor(H, C, _dllExport);
+ AsyncCallbackVisitor asyncCallbackVisitor(H, C, _dllExport, _suppress);
p->visit(&asyncCallbackVisitor, false);
- ProxyVisitor proxyVisitor(H, C, _dllExport);
+ ProxyVisitor proxyVisitor(H, C, _dllExport, _suppress);
p->visit(&proxyVisitor, false);
- DelegateVisitor delegateVisitor(H, C, _dllExport);
+ DelegateVisitor delegateVisitor(H, C, _dllExport, _suppress);
p->visit(&delegateVisitor, false);
- DelegateMVisitor delegateMVisitor(H, C, _dllExport);
+ DelegateMVisitor delegateMVisitor(H, C, _dllExport, _suppress);
p->visit(&delegateMVisitor, false);
- DelegateDVisitor delegateDVisitor(H, C, _dllExport);
+ DelegateDVisitor delegateDVisitor(H, C, _dllExport, _suppress);
p->visit(&delegateDVisitor, false);
- ObjectVisitor objectVisitor(H, C, _dllExport, _stream);
+ ObjectVisitor objectVisitor(H, C, _dllExport, _stream, _suppress);
p->visit(&objectVisitor, false);
if(_stream)
{
- StreamVisitor streamVistor(H, C);
+ StreamVisitor streamVistor(H, C, _suppress);
p->visit(&streamVistor, false);
}
@@ -470,7 +467,7 @@ Slice::Gen::generate(const UnitPtr& p)
// definition, because __completed calls the begin_ method in the
// proxy.
//
- AsyncCallbackTemplateVisitor asyncCallbackTemplateVisitor(H, C, _dllExport);
+ AsyncCallbackTemplateVisitor asyncCallbackTemplateVisitor(H, C, _dllExport, _suppress);
p->visit(&asyncCallbackTemplateVisitor, false);
if(_impl)
@@ -491,7 +488,7 @@ Slice::Gen::generate(const UnitPtr& p)
}
implC << _base << "I." << _implHeaderExtension << ">";
- ImplVisitor implVisitor(implH, implC, _dllExport);
+ ImplVisitor implVisitor(implH, implC, _dllExport, _suppress);
p->visit(&implVisitor, false);
}
@@ -561,8 +558,9 @@ Slice::Gen::writeExtraHeaders(IceUtilInternal::Output& out)
}
}
-Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport, bool stream) :
- H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false)
+Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport, bool stream, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false),
+ _suppress(suppress)
{
}
@@ -574,9 +572,11 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
+ H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
+ }
return true;
}
@@ -584,9 +584,11 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -1863,8 +1865,8 @@ Slice::Gen::TypesVisitor::emitUpcall(const ExceptionPtr& base, const string& cal
C.restoreIndent();
}
-Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport)
+Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _suppress(suppress)
{
}
@@ -1895,9 +1897,11 @@ Slice::Gen::ProxyDeclVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- string name = fixKwd(p->name());
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -1905,7 +1909,9 @@ Slice::Gen::ProxyDeclVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
+ }
}
void
@@ -1921,8 +1927,8 @@ Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p)
H << sp << nl << "class " << name << ';';
}
-Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -1953,11 +1959,13 @@ Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- string name = fixKwd(p->name());
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -1965,9 +1973,11 @@ Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -2873,8 +2883,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
}
}
-Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -2905,11 +2915,13 @@ Slice::Gen::DelegateVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- string name = fixKwd(p->name());
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -2917,9 +2929,11 @@ Slice::Gen::DelegateVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -3010,8 +3024,8 @@ Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p)
H << sp << nl << "virtual " << retS << ' ' << name << spar << params << epar << " = 0;";
}
-Slice::Gen::DelegateMVisitor::DelegateMVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::DelegateMVisitor::DelegateMVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -3042,11 +3056,13 @@ Slice::Gen::DelegateMVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- string name = fixKwd(p->name());
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -3054,9 +3070,11 @@ Slice::Gen::DelegateMVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -3284,8 +3302,8 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p)
C << eb;
}
-Slice::Gen::DelegateDVisitor::DelegateDVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::DelegateDVisitor::DelegateDVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -3316,11 +3334,13 @@ Slice::Gen::DelegateDVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- string name = fixKwd(p->name());
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -3328,9 +3348,11 @@ Slice::Gen::DelegateDVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::DelegateDVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -3634,8 +3656,8 @@ Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p)
}
}
-Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport)
+Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _suppress(suppress)
{
}
@@ -3647,9 +3669,11 @@ Slice::Gen::ObjectDeclVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- string name = fixKwd(p->name());
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -3657,7 +3681,9 @@ Slice::Gen::ObjectDeclVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::ObjectDeclVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
+ }
}
void
@@ -3677,8 +3703,8 @@ Slice::Gen::ObjectDeclVisitor::visitOperation(const OperationPtr& p)
C << sp << nl << "static const ::std::string " << flatName << " = \"" << p->name() << "\";";
}
-Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport, bool stream) :
- H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false)
+Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport, bool stream, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false), _suppress(suppress)
{
}
@@ -3690,11 +3716,13 @@ Slice::Gen::ObjectVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- string name = fixKwd(p->name());
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -3702,10 +3730,12 @@ Slice::Gen::ObjectVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::ObjectVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp;
- H << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp;
+ H << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -3973,13 +4003,13 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p)
transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped));
#endif
StringList other;
- other.push_back(p->scoped());
+ other.push_back(p->scoped(false));
other.push_back("::Ice::Object");
other.sort();
ids.merge(other);
ids.unique();
StringList::const_iterator firstIter = ids.begin();
- StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), p->scoped());
+ StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), p->scoped(false));
assert(scopedIter != ids.end());
StringList::difference_type scopedPos = IceUtilInternal::distance(firstIter, scopedIter);
@@ -4316,7 +4346,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
{
H << sp << nl << "static const ::Ice::ObjectFactoryPtr& ice_factory();";
- string factoryName = "__F" + p->flattenedScope() + p->name();
+ string factoryName = "__F" + p->flattenedScope() + p->name();
C << sp;
C << nl << "class " << factoryName << " : public ::Ice::ObjectFactory";
C << sb;
@@ -4362,7 +4392,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
C << sp;
C << nl << "static " << factoryName << "__Init " << factoryName << "__i;";
C << sp << nl << "#ifdef __APPLE__";
- std::string initfuncname = "__F" + p->flattenedScope() + p->name() + "__initializer";
+ std::string initfuncname = "__F" + p->flattenedScope() + p->name() + "__initializer";
C << nl << "extern \"C\" { void " << initfuncname << "() {} }";
C << nl << "#endif";
}
@@ -5148,8 +5178,8 @@ Slice::Gen::ObjectVisitor::emitUpcall(const ClassDefPtr& base, const string& cal
C.restoreIndent();
}
-Slice::Gen::AsyncCallbackVisitor::AsyncCallbackVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::AsyncCallbackVisitor::AsyncCallbackVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -5161,9 +5191,11 @@ Slice::Gen::AsyncCallbackVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
+ H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
+ }
return true;
}
@@ -5171,9 +5203,11 @@ Slice::Gen::AsyncCallbackVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::AsyncCallbackVisitor::visitModuleEnd(const ModulePtr& p)
{
- _useWstring = resetUseWstring(_useWstringHist);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = resetUseWstring(_useWstringHist);
- H << sp << nl << '}';
+ H << sp << nl << '}';
+ }
}
bool
@@ -5209,8 +5243,8 @@ Slice::Gen::AsyncCallbackVisitor::visitOperation(const OperationPtr& p)
Slice::Gen::AsyncCallbackTemplateVisitor::AsyncCallbackTemplateVisitor(Output& h,
Output& c,
- const string& dllExport)
- : H(h), C(c), _dllExport(dllExport), _useWstring(false)
+ const string& dllExport, bool suppress)
+ : H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -5233,18 +5267,23 @@ Slice::Gen::AsyncCallbackTemplateVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+ H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
+ }
- H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
return true;
}
void
Slice::Gen::AsyncCallbackTemplateVisitor::visitModuleEnd(const ModulePtr& p)
{
- _useWstring = resetUseWstring(_useWstringHist);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = resetUseWstring(_useWstringHist);
- H << sp << nl << '}';
+ H << sp << nl << '}';
+ }
}
bool
@@ -5566,8 +5605,8 @@ Slice::Gen::AsyncCallbackTemplateVisitor::generateOperation(const OperationPtr&
}
}
-Slice::Gen::IceInternalVisitor::IceInternalVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport)
+Slice::Gen::IceInternalVisitor::IceInternalVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _suppress(suppress)
{
}
@@ -5636,8 +5675,8 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p)
return true;
}
-Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dllExport, bool stream) :
- H(h), C(c), _dllExport(dllExport), _stream(stream)
+Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dllExport, bool stream, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _stream(stream), _suppress(suppress)
{
}
@@ -5649,10 +5688,12 @@ Slice::Gen::HandleVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- string name = fixKwd(p->name());
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ string name = fixKwd(p->name());
- H << sp;
- H << nl << "namespace " << name << nl << '{';
+ H << sp;
+ H << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -5660,8 +5701,10 @@ Slice::Gen::HandleVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::HandleVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp;
- H << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp;
+ H << nl << '}';
+ }
}
void
@@ -5784,8 +5827,8 @@ Slice::Gen::HandleVisitor::visitClassDefStart(const ClassDefPtr& p)
}
Slice::Gen::ImplVisitor::ImplVisitor(Output& h, Output& c,
- const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+ const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -5956,10 +5999,12 @@ Slice::Gen::ImplVisitor::visitModuleStart(const ModulePtr& p)
{
H << nl << "#include <" << *it << "I.h>";
}
-
- string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ string name = fixKwd(p->name());
+
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -5967,10 +6012,12 @@ Slice::Gen::ImplVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp;
- H << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp;
+ H << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -6205,8 +6252,8 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p)
return true;
}
-Slice::Gen::AsyncVisitor::AsyncVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::AsyncVisitor::AsyncVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -6218,11 +6265,13 @@ Slice::Gen::AsyncVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- string name = fixKwd(p->name());
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -6230,9 +6279,11 @@ Slice::Gen::AsyncVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::AsyncVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -6375,8 +6426,8 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
}
}
-Slice::Gen::AsyncImplVisitor::AsyncImplVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::AsyncImplVisitor::AsyncImplVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
{
}
@@ -6407,11 +6458,13 @@ Slice::Gen::AsyncImplVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
- string name = fixKwd(p->name());
+ string name = fixKwd(p->name());
- H << sp << nl << "namespace " << name << nl << '{';
+ H << sp << nl << "namespace " << name << nl << '{';
+ }
return true;
}
@@ -6419,9 +6472,11 @@ Slice::Gen::AsyncImplVisitor::visitModuleStart(const ModulePtr& p)
void
Slice::Gen::AsyncImplVisitor::visitModuleEnd(const ModulePtr& p)
{
- H << sp << nl << '}';
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ H << sp << nl << '}';
- _useWstring = resetUseWstring(_useWstringHist);
+ _useWstring = resetUseWstring(_useWstringHist);
+ }
}
bool
@@ -6622,8 +6677,8 @@ Slice::Gen::AsyncImplVisitor::visitOperation(const OperationPtr& p)
}
}
-Slice::Gen::StreamVisitor::StreamVisitor(Output& h, Output& c) :
- H(h), C(c)
+Slice::Gen::StreamVisitor::StreamVisitor(Output& h, Output& c, bool suppress) :
+ H(h), C(c), _suppress(suppress)
{
}
diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h
index b262fba..228107f 100644
--- a/cpp/src/slice2cpp/Gen.h
+++ b/cpp/src/slice2cpp/Gen.h
@@ -31,7 +31,8 @@ public:
bool,
bool,
bool,
- bool);
+ bool,
+ bool);
~Gen();
void generate(const UnitPtr&);
@@ -70,12 +71,13 @@ private:
bool _checksum;
bool _stream;
bool _ice;
+ bool _suppress;
class TypesVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- TypesVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+ TypesVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -102,13 +104,14 @@ private:
bool _doneStaticSymbol;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class ProxyDeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- ProxyDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ ProxyDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -122,13 +125,14 @@ private:
::IceUtilInternal::Output& C;
std::string _dllExport;
+ bool _suppress;
};
class ProxyVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- ProxyVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ ProxyVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -146,13 +150,14 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class DelegateVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- DelegateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ DelegateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -170,13 +175,14 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class DelegateMVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- DelegateMVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ DelegateMVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -194,13 +200,14 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class DelegateDVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- DelegateDVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ DelegateDVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -218,13 +225,14 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class ObjectDeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- ObjectDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ ObjectDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -237,13 +245,14 @@ private:
::IceUtilInternal::Output& C;
std::string _dllExport;
+ bool _suppress;
};
class ObjectVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- ObjectVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+ ObjectVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -270,13 +279,14 @@ private:
bool _doneStaticSymbol;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class AsyncCallbackVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- AsyncCallbackVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ AsyncCallbackVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -292,13 +302,14 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class AsyncCallbackTemplateVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- AsyncCallbackTemplateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ AsyncCallbackTemplateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -318,13 +329,14 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
};
class IceInternalVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- IceInternalVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ IceInternalVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -337,13 +349,14 @@ private:
::IceUtilInternal::Output& C;
std::string _dllExport;
+ bool _suppress;
};
class HandleVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- HandleVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+ HandleVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -357,13 +370,14 @@ private:
std::string _dllExport;
bool _stream;
+ bool _suppress;
};
class ImplVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- ImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ ImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -378,6 +392,8 @@ private:
int _useWstring;
std::list<int> _useWstringHist;
+ bool _suppress;
+
//
// Generate code to emit a local variable declaration and initialize it
// if necessary.
@@ -394,7 +410,7 @@ private:
{
public:
- AsyncVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ AsyncVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -410,13 +426,15 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+
+ bool _suppress;
};
class AsyncImplVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- AsyncImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ AsyncImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -434,13 +452,15 @@ private:
std::string _dllExport;
int _useWstring;
std::list<int> _useWstringHist;
+
+ bool _suppress;
};
class StreamVisitor : private ::IceUtil::noncopyable, public ParserVisitor
{
public:
- StreamVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&);
+ StreamVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -452,6 +472,7 @@ private:
::IceUtilInternal::Output& H;
::IceUtilInternal::Output& C;
+ bool _suppress;
};
private:
diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp
index 0ca754b..124a04a 100644
--- a/cpp/src/slice2cpp/Main.cpp
+++ b/cpp/src/slice2cpp/Main.cpp
@@ -79,6 +79,7 @@ usage(const char* n)
"--underscore Permit underscores in Slice identifiers.\n"
"--checksum Generate checksums for Slice definitions.\n"
"--stream Generate marshaling support for public stream API.\n"
+ "--suppress Suppress tagged modules from being written.\n"
;
}
@@ -105,6 +106,7 @@ compile(int argc, char* argv[])
opts.addOpt("", "underscore");
opts.addOpt("", "checksum");
opts.addOpt("", "stream");
+ opts.addOpt("", "suppress");
vector<string> args;
try
@@ -178,6 +180,8 @@ compile(int argc, char* argv[])
bool stream = opts.isSet("stream");
+ bool suppress = opts.isSet("suppress");
+
if(args.empty())
{
getErrorStream() << argv[0] << ": error: no input file" << endl;
@@ -275,7 +279,7 @@ compile(int argc, char* argv[])
try
{
Gen gen(icecpp->getBaseName(), headerExtension, sourceExtension, extraHeaders, include,
- includePaths, dllExport, output, impl, checksum, stream, ice);
+ includePaths, dllExport, output, impl, checksum, stream, ice, suppress);
gen.generate(u);
}
catch(const Slice::FileException& ex)
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 7a089e9..76e51ab 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -195,14 +195,14 @@ Slice::CsVisitor::writeDispatchAndMarshalling(const ClassDefPtr& p, bool stream)
#endif
StringList other;
- other.push_back(p->scoped());
+ other.push_back(p->scoped(false));
other.push_back("::Ice::Object");
other.sort();
ids.merge(other);
ids.unique();
StringList::const_iterator firstIter = ids.begin();
- StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), scoped);
+ StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), p->scoped(false));
assert(scopedIter != ids.end());
StringList::difference_type scopedPos = IceUtilInternal::distance(firstIter, scopedIter);
@@ -1849,9 +1849,10 @@ Slice::CsVisitor::writeDocCommentParam(const OperationPtr& p, ParamDir paramType
}
Slice::Gen::Gen(const string& base, const vector<string>& includePaths, const string& dir,
- bool impl, bool implTie, bool stream)
+ bool impl, bool implTie, bool stream, bool suppress)
: _includePaths(includePaths),
- _stream(stream)
+ _stream(stream),
+ _suppress(suppress)
{
string fileBase = base;
string::size_type pos = base.find_last_of("/\\");
@@ -1922,64 +1923,68 @@ Slice::Gen::~Gen()
void
Slice::Gen::generate(const UnitPtr& p)
{
+ if(_suppress)
+ {
+ p->setScopeGeneratorPolicy(createSuppressorGenerator());
+ }
CsGenerator::validateMetaData(p);
UnitVisitor unitVisitor(_out);
p->visit(&unitVisitor, false);
- TypesVisitor typesVisitor(_out, _stream);
+ TypesVisitor typesVisitor(_out, _stream, _suppress);
p->visit(&typesVisitor, false);
//
// The async delegates are emitted before the proxy definition
// because the proxy methods need to know the type.
//
- AsyncDelegateVisitor asyncDelegateVisitor(_out);
+ AsyncDelegateVisitor asyncDelegateVisitor(_out, _suppress);
p->visit(&asyncDelegateVisitor, false);
- ProxyVisitor proxyVisitor(_out);
+ ProxyVisitor proxyVisitor(_out, _suppress);
p->visit(&proxyVisitor, false);
- OpsVisitor opsVisitor(_out);
+ OpsVisitor opsVisitor(_out, _suppress);
p->visit(&opsVisitor, false);
- HelperVisitor helperVisitor(_out, _stream);
+ HelperVisitor helperVisitor(_out, _stream, _suppress);
p->visit(&helperVisitor, false);
- DelegateVisitor delegateVisitor(_out);
+ DelegateVisitor delegateVisitor(_out, _suppress);
p->visit(&delegateVisitor, false);
- DelegateMVisitor delegateMVisitor(_out);
+ DelegateMVisitor delegateMVisitor(_out, _suppress);
p->visit(&delegateMVisitor, false);
- DelegateDVisitor delegateDVisitor(_out);
+ DelegateDVisitor delegateDVisitor(_out, _suppress);
p->visit(&delegateDVisitor, false);
- DispatcherVisitor dispatcherVisitor(_out, _stream);
+ DispatcherVisitor dispatcherVisitor(_out, _stream, _suppress);
p->visit(&dispatcherVisitor, false);
- AsyncVisitor asyncVisitor(_out);
+ AsyncVisitor asyncVisitor(_out, _suppress);
p->visit(&asyncVisitor, false);
}
void
Slice::Gen::generateTie(const UnitPtr& p)
{
- TieVisitor tieVisitor(_out);
+ TieVisitor tieVisitor(_out, _suppress);
p->visit(&tieVisitor, false);
}
void
Slice::Gen::generateImpl(const UnitPtr& p)
{
- ImplVisitor implVisitor(_impl);
+ ImplVisitor implVisitor(_impl, _suppress);
p->visit(&implVisitor, false);
}
void
Slice::Gen::generateImplTie(const UnitPtr& p)
{
- ImplTieVisitor implTieVisitor(_impl);
+ ImplTieVisitor implTieVisitor(_impl, _suppress);
p->visit(&implTieVisitor, false);
}
@@ -2085,8 +2090,8 @@ Slice::Gen::UnitVisitor::visitUnitStart(const UnitPtr& p)
return false;
}
-Slice::Gen::TypesVisitor::TypesVisitor(IceUtilInternal::Output& out, bool stream)
- : CsVisitor(out), _stream(stream)
+Slice::Gen::TypesVisitor::TypesVisitor(IceUtilInternal::Output& out, bool stream, bool suppress)
+ : CsVisitor(out), _stream(stream), _suppress(suppress)
{
}
@@ -2118,20 +2123,24 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p)
}
}
- string name = fixId(p->name());
- _out << sp;
- emitAttributes(p);
- _out << nl << "namespace " << name;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ string name = fixId(p->name());
+ _out << sp;
+ emitAttributes(p);
+ _out << nl << "namespace " << name;
- _out << sb;
+ _out << sb;
+ }
return true;
}
void
-Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -2394,6 +2403,32 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p)
}
_out << eb;
+
+ if(!p->isInterface() && p->scoped(false) != p->scoped())
+ {
+ ContainerPtr container = p->container();
+ if(container != 0)
+ {
+ ContainedPtr contained = ContainedPtr::dynamicCast(container);
+ assert(contained);
+ _out << sp << nl << "namespace " << fixId(contained->name());
+ _out << sb;
+ _out << sp << nl << "public class " << fixId(p->name());
+ _out << " : Ice.MigrationProxy";
+ _out << sb;
+ _out << nl << "public virtual Ice.Object createCurrentVersion()";
+ _out << sb;
+ _out << nl << "return (Ice.Object)IceInternal.AssemblyUtil.createInstance(actualRuntimeClass());";
+ _out << eb;
+ _out << nl;
+ _out << nl << "public virtual _System.Type actualRuntimeClass()";
+ _out << sb;
+ _out << nl << "return IceInternal.AssemblyUtil.findType(\"" << p->scoped() << "\".Substring(2).Replace(\"::\", \".\"));";
+ _out << eb;
+ _out << eb;
+ _out << eb;
+ }
+ }
}
void
@@ -3804,8 +3839,8 @@ Slice::Gen::TypesVisitor::writeMemberEquals(const DataMemberList& dataMembers, i
}
}
-Slice::Gen::ProxyVisitor::ProxyVisitor(IceUtilInternal::Output& out)
- : CsVisitor(out)
+Slice::Gen::ProxyVisitor::ProxyVisitor(IceUtilInternal::Output& out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
@@ -3817,15 +3852,20 @@ Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -3988,23 +4028,27 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
}
}
-Slice::Gen::AsyncDelegateVisitor::AsyncDelegateVisitor(IceUtilInternal::Output& out)
- : CsVisitor(out)
+Slice::Gen::AsyncDelegateVisitor::AsyncDelegateVisitor(IceUtilInternal::Output& out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
bool
Slice::Gen::AsyncDelegateVisitor::visitModuleStart(const ModulePtr& p)
{
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
return true;
}
void
-Slice::Gen::AsyncDelegateVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::AsyncDelegateVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -4045,8 +4089,8 @@ Slice::Gen::AsyncDelegateVisitor::visitOperation(const OperationPtr& p)
_out << paramDeclAMI << epar << ';';
}
-Slice::Gen::OpsVisitor::OpsVisitor(IceUtilInternal::Output& out)
- : CsVisitor(out)
+Slice::Gen::OpsVisitor::OpsVisitor(IceUtilInternal::Output& out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
@@ -4058,15 +4102,20 @@ Slice::Gen::OpsVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::OpsVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::OpsVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -4193,8 +4242,8 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent)
_out << eb;
}
-Slice::Gen::HelperVisitor::HelperVisitor(IceUtilInternal::Output& out, bool stream)
- : CsVisitor(out), _stream(stream)
+Slice::Gen::HelperVisitor::HelperVisitor(IceUtilInternal::Output& out, bool stream, bool suppress)
+ : CsVisitor(out), _stream(stream), _suppress(suppress)
{
}
@@ -4206,15 +4255,20 @@ Slice::Gen::HelperVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::HelperVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::HelperVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -4748,7 +4802,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "return null;";
_out << eb;
_out << nl << name << "Prx r = b as " << name << "Prx;";
- _out << nl << "if((r == null) && b.ice_isA(\"" << p->scoped() << "\"))";
+ _out << nl << "if((r == null) && b.ice_isA(\"" << p->scoped(false) << "\"))";
_out << sb;
_out << nl << name << "PrxHelper h = new " << name << "PrxHelper();";
_out << nl << "h.copyFrom__(b);";
@@ -4765,7 +4819,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "return null;";
_out << eb;
_out << nl << name << "Prx r = b as " << name << "Prx;";
- _out << nl << "if((r == null) && b.ice_isA(\"" << p->scoped() << "\", ctx))";
+ _out << nl << "if((r == null) && b.ice_isA(\"" << p->scoped(false) << "\", ctx))";
_out << sb;
_out << nl << name << "PrxHelper h = new " << name << "PrxHelper();";
_out << nl << "h.copyFrom__(b);";
@@ -4783,7 +4837,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "Ice.ObjectPrx bb = b.ice_facet(f);";
_out << nl << "try";
_out << sb;
- _out << nl << "if(bb.ice_isA(\"" << p->scoped() << "\"))";
+ _out << nl << "if(bb.ice_isA(\"" << p->scoped(false) << "\"))";
_out << sb;
_out << nl << name << "PrxHelper h = new " << name << "PrxHelper();";
_out << nl << "h.copyFrom__(bb);";
@@ -4807,7 +4861,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
_out << nl << "Ice.ObjectPrx bb = b.ice_facet(f);";
_out << nl << "try";
_out << sb;
- _out << nl << "if(bb.ice_isA(\"" << p->scoped() << "\", ctx))";
+ _out << nl << "if(bb.ice_isA(\"" << p->scoped(false) << "\", ctx))";
_out << sb;
_out << nl << name << "PrxHelper h = new " << name << "PrxHelper();";
_out << nl << "h.copyFrom__(bb);";
@@ -4905,7 +4959,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
}
void
-Slice::Gen::HelperVisitor::visitClassDefEnd(const ClassDefPtr&)
+Slice::Gen::HelperVisitor::visitClassDefEnd(const ClassDefPtr& p)
{
_out << eb;
}
@@ -5216,8 +5270,8 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p)
_out << eb;
}
-Slice::Gen::DelegateVisitor::DelegateVisitor(IceUtilInternal::Output& out)
- : CsVisitor(out)
+Slice::Gen::DelegateVisitor::DelegateVisitor(IceUtilInternal::Output& out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
@@ -5229,15 +5283,20 @@ Slice::Gen::DelegateVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -5299,8 +5358,8 @@ Slice::Gen::DelegateVisitor::visitClassDefEnd(const ClassDefPtr&)
_out << eb;
}
-Slice::Gen::DelegateMVisitor::DelegateMVisitor(IceUtilInternal::Output& out)
- : CsVisitor(out)
+Slice::Gen::DelegateMVisitor::DelegateMVisitor(IceUtilInternal::Output& out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
@@ -5312,15 +5371,20 @@ Slice::Gen::DelegateMVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -5566,8 +5630,8 @@ Slice::Gen::DelegateMVisitor::visitClassDefEnd(const ClassDefPtr&)
_out << eb;
}
-Slice::Gen::DelegateDVisitor::DelegateDVisitor(IceUtilInternal::Output& out)
- : CsVisitor(out)
+Slice::Gen::DelegateDVisitor::DelegateDVisitor(IceUtilInternal::Output& out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
@@ -5579,15 +5643,20 @@ Slice::Gen::DelegateDVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::DelegateDVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::DelegateDVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -5788,8 +5857,8 @@ Slice::Gen::DelegateDVisitor::visitClassDefEnd(const ClassDefPtr&)
_out << eb;
}
-Slice::Gen::DispatcherVisitor::DispatcherVisitor(::IceUtilInternal::Output &out, bool stream)
- : CsVisitor(out), _stream(stream)
+Slice::Gen::DispatcherVisitor::DispatcherVisitor(::IceUtilInternal::Output &out, bool stream, bool suppress)
+ : CsVisitor(out), _stream(stream), _suppress(suppress)
{
}
@@ -5801,15 +5870,20 @@ Slice::Gen::DispatcherVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::DispatcherVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::DispatcherVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -5888,8 +5962,8 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p)
return true;
}
-Slice::Gen::AsyncVisitor::AsyncVisitor(::IceUtilInternal::Output &out)
- : CsVisitor(out)
+Slice::Gen::AsyncVisitor::AsyncVisitor(::IceUtilInternal::Output &out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
@@ -5901,15 +5975,20 @@ Slice::Gen::AsyncVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
+
return true;
}
void
-Slice::Gen::AsyncVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::AsyncVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -6081,8 +6160,8 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
}
}
-Slice::Gen::TieVisitor::TieVisitor(IceUtilInternal::Output& out)
- : CsVisitor(out)
+Slice::Gen::TieVisitor::TieVisitor(IceUtilInternal::Output& out, bool suppress)
+ : CsVisitor(out), _suppress(suppress)
{
}
@@ -6094,16 +6173,20 @@ Slice::Gen::TieVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
return true;
}
void
-Slice::Gen::TieVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::TieVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -6388,8 +6471,8 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment
}
}
-Slice::Gen::ImplVisitor::ImplVisitor(IceUtilInternal::Output& out)
- : BaseImplVisitor(out)
+Slice::Gen::ImplVisitor::ImplVisitor(IceUtilInternal::Output& out, bool suppress)
+ : BaseImplVisitor(out), _suppress(suppress)
{
}
@@ -6401,16 +6484,20 @@ Slice::Gen::ImplVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
return true;
}
void
-Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
@@ -6456,8 +6543,8 @@ Slice::Gen::ImplVisitor::visitClassDefEnd(const ClassDefPtr&)
_out << eb;
}
-Slice::Gen::ImplTieVisitor::ImplTieVisitor(IceUtilInternal::Output& out)
- : BaseImplVisitor(out)
+Slice::Gen::ImplTieVisitor::ImplTieVisitor(IceUtilInternal::Output& out, bool suppress)
+ : BaseImplVisitor(out), _suppress(suppress)
{
}
@@ -6469,16 +6556,20 @@ Slice::Gen::ImplTieVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
- _out << sp << nl << "namespace " << fixId(p->name());
- _out << sb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << sp << nl << "namespace " << fixId(p->name());
+ _out << sb;
+ }
return true;
}
void
-Slice::Gen::ImplTieVisitor::visitModuleEnd(const ModulePtr&)
+Slice::Gen::ImplTieVisitor::visitModuleEnd(const ModulePtr& p)
{
- _out << eb;
+ if (!p->hasMetaData("suppress") || !_suppress) {
+ _out << eb;
+ }
}
bool
diff --git a/cpp/src/slice2cs/Gen.h b/cpp/src/slice2cs/Gen.h
index 7e30421..3803830 100644
--- a/cpp/src/slice2cs/Gen.h
+++ b/cpp/src/slice2cs/Gen.h
@@ -74,7 +74,8 @@ public:
const std::string&,
bool,
bool,
- bool);
+ bool,
+ bool);
~Gen();
void generate(const UnitPtr&);
@@ -93,6 +94,8 @@ private:
bool _stream;
+ bool _suppress;
+
void printHeader();
class UnitVisitor : public CsVisitor
@@ -108,7 +111,7 @@ private:
{
public:
- TypesVisitor(::IceUtilInternal::Output&, bool);
+ TypesVisitor(::IceUtilInternal::Output&, bool, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -131,39 +134,48 @@ private:
void writeMemberEquals(const DataMemberList&, int);
bool _stream;
+ bool _suppress;
};
class AsyncDelegateVisitor : public CsVisitor
{
public:
- AsyncDelegateVisitor(::IceUtilInternal::Output&);
+ AsyncDelegateVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
virtual void visitOperation(const OperationPtr&);
+
+ private:
+
+ bool _suppress;
};
class ProxyVisitor : public CsVisitor
{
public:
- ProxyVisitor(::IceUtilInternal::Output&);
+ ProxyVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
virtual void visitOperation(const OperationPtr&);
+
+ private:
+
+ bool _suppress;
};
class OpsVisitor : public CsVisitor
{
public:
- OpsVisitor(::IceUtilInternal::Output&);
+ OpsVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -171,13 +183,15 @@ private:
private:
void writeOperations(const ClassDefPtr&, bool);
+
+ bool _suppress;
};
class HelperVisitor : public CsVisitor
{
public:
- HelperVisitor(::IceUtilInternal::Output&, bool);
+ HelperVisitor(::IceUtilInternal::Output&, bool, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -189,49 +203,63 @@ private:
private:
bool _stream;
+
+ bool _suppress;
};
class DelegateVisitor : public CsVisitor
{
public:
- DelegateVisitor(::IceUtilInternal::Output&);
+ DelegateVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class DelegateMVisitor : public CsVisitor
{
public:
- DelegateMVisitor(::IceUtilInternal::Output&);
+ DelegateMVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class DelegateDVisitor : public CsVisitor
{
public:
- DelegateDVisitor(::IceUtilInternal::Output&);
+ DelegateDVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class DispatcherVisitor : public CsVisitor
{
public:
- DispatcherVisitor(::IceUtilInternal::Output&, bool);
+ DispatcherVisitor(::IceUtilInternal::Output&, bool, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -240,26 +268,32 @@ private:
private:
bool _stream;
+
+ bool _suppress;
};
class AsyncVisitor : public CsVisitor
{
public:
- AsyncVisitor(::IceUtilInternal::Output&);
+ AsyncVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
virtual void visitOperation(const OperationPtr&);
+
+ private:
+
+ bool _suppress;
};
class TieVisitor : public CsVisitor
{
public:
- TieVisitor(::IceUtilInternal::Output&);
+ TieVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -270,6 +304,8 @@ private:
typedef std::set<std::string> NameSet;
void writeInheritedOperationsWithOpNames(const ClassDefPtr&, NameSet&);
+
+ bool _suppress;
};
class BaseImplVisitor : public CsVisitor
@@ -287,23 +323,31 @@ private:
{
public:
- ImplVisitor(::IceUtilInternal::Output&);
+ ImplVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class ImplTieVisitor : public BaseImplVisitor
{
public:
- ImplTieVisitor(::IceUtilInternal::Output&);
+ ImplTieVisitor(::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
virtual bool visitClassDefStart(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
};
diff --git a/cpp/src/slice2cs/Main.cpp b/cpp/src/slice2cs/Main.cpp
index 87ed3c6..464788b 100644
--- a/cpp/src/slice2cs/Main.cpp
+++ b/cpp/src/slice2cs/Main.cpp
@@ -99,6 +99,7 @@ compile(int argc, char* argv[])
opts.addOpt("", "underscore");
opts.addOpt("", "checksum");
opts.addOpt("", "stream");
+ opts.addOpt("", "suppress");
vector<string> args;
try
@@ -166,6 +167,8 @@ compile(int argc, char* argv[])
bool stream = opts.isSet("stream");
+ bool suppress = opts.isSet("suppress");
+
if(args.empty())
{
getErrorStream() << argv[0] << ": error: no input file" << endl;
@@ -268,7 +271,7 @@ compile(int argc, char* argv[])
{
try
{
- Gen gen(icecpp->getBaseName(), includePaths, output, impl, implTie, stream);
+ Gen gen(icecpp->getBaseName(), includePaths, output, impl, implTie, stream, suppress);
gen.generate(p);
if(tie)
{
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 2564f7e..902833e 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -35,6 +35,28 @@ using IceUtilInternal::spar;
using IceUtilInternal::epar;
static string
+suppressedabsolute(const ContainerPtr& cp, string absolute, bool _suppress)
+{
+ string suppressed_absolute = absolute;
+
+ if (_suppress) {
+ for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+ ModulePtr mod = ModulePtr::dynamicCast(contained);
+ if (mod && mod->hasMetaData("suppress")) {
+ string suppress_string = "." + mod->name();
+ string::size_type pos = suppressed_absolute.rfind(suppress_string);
+ if(pos != string::npos)
+ {
+ suppressed_absolute.replace(pos, suppress_string.length(), "");
+ }
+ }
+ }
+ }
+
+ return suppressed_absolute;
+}
+
+static string
sliceModeToIceMode(Operation::Mode opMode)
{
string mode;
@@ -407,13 +429,13 @@ Slice::JavaVisitor::writeDispatchAndMarshalling(Output& out, const ClassDefPtr&
StringList ids;
transform(allBases.begin(), allBases.end(), back_inserter(ids), ::IceUtil::constMemFun(&Contained::scoped));
StringList other;
- other.push_back(scoped);
+ other.push_back(p->scoped(false));
other.push_back("::Ice::Object");
other.sort();
ids.merge(other);
ids.unique();
StringList::const_iterator firstIter = ids.begin();
- StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), scoped);
+ StringList::const_iterator scopedIter = find(ids.begin(), ids.end(), p->scoped(false));
assert(scopedIter != ids.end());
StringList::difference_type scopedPos = IceUtilInternal::distance(firstIter, scopedIter);
@@ -1721,10 +1743,11 @@ Slice::JavaVisitor::writeDocCommentParam(Output& out, const OperationPtr& p, Par
}
}
-Slice::Gen::Gen(const string& name, const string& base, const vector<string>& includePaths, const string& dir) :
+Slice::Gen::Gen(const string& name, const string& base, const vector<string>& includePaths, const string& dir, bool suppress) :
_base(base),
_includePaths(includePaths),
- _dir(dir)
+ _dir(dir),
+ _suppress(suppress)
{
}
@@ -1735,46 +1758,50 @@ Slice::Gen::~Gen()
void
Slice::Gen::generate(const UnitPtr& p, bool stream)
{
+ if(_suppress)
+ {
+ p->setScopeGeneratorPolicy(createSuppressorGenerator());
+ }
JavaGenerator::validateMetaData(p);
- OpsVisitor opsVisitor(_dir);
+ OpsVisitor opsVisitor(_dir, _suppress);
p->visit(&opsVisitor, false);
PackageVisitor packageVisitor(_dir);
p->visit(&packageVisitor, false);
- TypesVisitor typesVisitor(_dir, stream);
+ TypesVisitor typesVisitor(_dir, stream, _suppress);
p->visit(&typesVisitor, false);
- HolderVisitor holderVisitor(_dir, stream);
+ HolderVisitor holderVisitor(_dir, stream, _suppress);
p->visit(&holderVisitor, false);
- HelperVisitor helperVisitor(_dir, stream);
+ HelperVisitor helperVisitor(_dir, stream, _suppress);
p->visit(&helperVisitor, false);
- ProxyVisitor proxyVisitor(_dir);
+ ProxyVisitor proxyVisitor(_dir, _suppress);
p->visit(&proxyVisitor, false);
- DelegateVisitor delegateVisitor(_dir);
+ DelegateVisitor delegateVisitor(_dir, _suppress);
p->visit(&delegateVisitor, false);
- DelegateMVisitor delegateMVisitor(_dir);
+ DelegateMVisitor delegateMVisitor(_dir, _suppress);
p->visit(&delegateMVisitor, false);
- DelegateDVisitor delegateDVisitor(_dir);
+ DelegateDVisitor delegateDVisitor(_dir, _suppress);
p->visit(&delegateDVisitor, false);
- DispatcherVisitor dispatcherVisitor(_dir, stream);
+ DispatcherVisitor dispatcherVisitor(_dir, stream, _suppress);
p->visit(&dispatcherVisitor, false);
- AsyncVisitor asyncVisitor(_dir);
+ AsyncVisitor asyncVisitor(_dir, _suppress);
p->visit(&asyncVisitor, false);
}
void
Slice::Gen::generateTie(const UnitPtr& p)
{
- TieVisitor tieVisitor(_dir);
+ TieVisitor tieVisitor(_dir, _suppress);
p->visit(&tieVisitor, false);
}
@@ -1847,8 +1874,8 @@ Slice::Gen::writeChecksumClass(const string& checksumClass, const string& dir, c
out << nl;
}
-Slice::Gen::OpsVisitor::OpsVisitor(const string& dir) :
- JavaVisitor(dir)
+Slice::Gen::OpsVisitor::OpsVisitor(const string& dir, bool suppress) :
+ JavaVisitor(dir), _suppress(suppress)
{
}
@@ -1885,7 +1912,7 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent)
}
string absolute = getAbsolute(p, "", "_", opIntfName);
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -1989,8 +2016,8 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent)
close();
}
-Slice::Gen::TieVisitor::TieVisitor(const string& dir) :
- JavaVisitor(dir)
+Slice::Gen::TieVisitor::TieVisitor(const string& dir, bool suppress) :
+ JavaVisitor(dir), _suppress(suppress)
{
}
@@ -2015,7 +2042,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p)
return false;
}
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -2212,8 +2239,8 @@ Slice::Gen::PackageVisitor::visitModuleStart(const ModulePtr& p)
return false;
}
-Slice::Gen::TypesVisitor::TypesVisitor(const string& dir, bool stream) :
- JavaVisitor(dir), _stream(stream)
+Slice::Gen::TypesVisitor::TypesVisitor(const string& dir, bool stream, bool suppress) :
+ JavaVisitor(dir), _stream(stream), _suppress(suppress)
{
}
@@ -2234,7 +2261,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
DataMemberList allDataMembers = p->allDataMembers();
DataMemberList::const_iterator d;
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -2511,7 +2538,7 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p)
out << sb;
out << nl << "public Ice.Object" << nl << "create(String type)";
out << sb;
- out << nl << "assert(type.equals(ice_staticId()));";
+ out << nl << "assert(type.equals(ice_staticId()));";
out << nl << "return new " << fixKwd(name) << "();";
out << eb;
out << sp << nl << "public void" << nl << "destroy()";
@@ -2543,6 +2570,31 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p)
Output& out = output();
out << eb;
close();
+ if(!p->isInterface() && p->scoped(false) != p->scoped())
+ {
+ //
+ // We need to create a proxy object that will allow us to instantiated the versioned type.
+ //
+ open(getAbsolute(p, false), p->file());
+ Output& out = output();
+ writeDocComment(out, p, getDeprecateReason(p, 0, p->isInterface() ? "interface" : "class"));
+ out << nl << "public class " << fixKwd(p->name());
+ out << " implements Ice.MigrationProxy";
+ out << sb;
+ out << nl << "public Ice.Object";
+ out << nl << "createCurrentVersion()";
+ out << sb;
+ out << nl << "return " << getAbsolute(p) << ".ice_factory().create(\"" << p->scoped(false) << "\");";
+ out << eb;
+ out << nl;
+ out << nl << "public Class<?>";
+ out << nl << "actualRuntimeClass() throws ClassNotFoundException";
+ out << sb;
+ out << nl << "return Class.forName(\"" << getAbsolute(p) << "\");";
+ out << eb;
+ out << eb;
+ close();
+ }
}
bool
@@ -2557,7 +2609,7 @@ Slice::Gen::TypesVisitor::visitExceptionStart(const ExceptionPtr& p)
DataMemberList members = p->dataMembers();
DataMemberList::const_iterator d;
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -2889,7 +2941,7 @@ Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p)
string name = fixKwd(p->name());
string absolute = getAbsolute(p);
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -3414,7 +3466,7 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p)
EnumeratorList::const_iterator en;
size_t sz = enumerators.size();
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -3529,7 +3581,7 @@ Slice::Gen::TypesVisitor::visitConst(const ConstPtr& p)
string absolute = getAbsolute(p);
TypePtr type = p->type();
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -3565,8 +3617,8 @@ Slice::Gen::TypesVisitor::validateGetterSetter(const OperationList& ops, const s
return true;
}
-Slice::Gen::HolderVisitor::HolderVisitor(const string& dir, bool stream) :
- JavaVisitor(dir), _stream(stream)
+Slice::Gen::HolderVisitor::HolderVisitor(const string& dir, bool stream, bool suppress) :
+ JavaVisitor(dir), _stream(stream), _suppress(suppress)
{
}
@@ -3581,7 +3633,7 @@ Slice::Gen::HolderVisitor::visitClassDefStart(const ClassDefPtr& p)
string name = p->name();
string absolute = getAbsolute(p, "", "", "PrxHolder");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
out << sp << nl << "public final class " << name << "PrxHolder";
@@ -3658,7 +3710,7 @@ Slice::Gen::HolderVisitor::writeHolder(const TypePtr& p)
file = p->definitionContext()->filename();
}
- open(absolute, file);
+ open(suppressedabsolute(contained->container(), absolute, _suppress), file);
Output& out = output();
string typeS = typeToString(p, TypeModeIn, getPackage(contained));
@@ -3718,8 +3770,8 @@ Slice::Gen::HolderVisitor::writeHolder(const TypePtr& p)
close();
}
-Slice::Gen::HelperVisitor::HelperVisitor(const string& dir, bool stream) :
- JavaVisitor(dir), _stream(stream)
+Slice::Gen::HelperVisitor::HelperVisitor(const string& dir, bool stream, bool suppress) :
+ JavaVisitor(dir), _stream(stream), _suppress(suppress)
{
}
@@ -3740,7 +3792,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
string package = getPackage(p);
string absolute = getAbsolute(p);
- open(getAbsolute(p, "", "", "PrxHelper"), p->file());
+ open(suppressedabsolute(p->container(), getAbsolute(p, "", "", "PrxHelper"), _suppress), p->file());
Output& out = output();
//
@@ -4168,7 +4220,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
out << eb;
out << nl << "catch(ClassCastException ex)";
out << sb;
- out << nl << "if(__obj.ice_isA(\"" << scoped << "\"))";
+ out << nl << "if(__obj.ice_isA(\"" << p->scoped(false) << "\"))";
out << sb;
out << nl << name << "PrxHelper __h = new " << name << "PrxHelper();";
out << nl << "__h.__copyFrom(__obj);";
@@ -4191,7 +4243,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
out << eb;
out << nl << "catch(ClassCastException ex)";
out << sb;
- out << nl << "if(__obj.ice_isA(\"" << scoped << "\", __ctx))";
+ out << nl << "if(__obj.ice_isA(\"" << p->scoped(false) << "\", __ctx))";
out << sb;
out << nl << name << "PrxHelper __h = new " << name << "PrxHelper();";
out << nl << "__h.__copyFrom(__obj);";
@@ -4210,7 +4262,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
out << nl << "Ice.ObjectPrx __bb = __obj.ice_facet(__facet);";
out << nl << "try";
out << sb;
- out << nl << "if(__bb.ice_isA(\"" << scoped << "\"))";
+ out << nl << "if(__bb.ice_isA(\"" << p->scoped(false) << "\"))";
out << sb;
out << nl << name << "PrxHelper __h = new " << name << "PrxHelper();";
out << nl << "__h.__copyFrom(__bb);";
@@ -4233,7 +4285,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
out << nl << "Ice.ObjectPrx __bb = __obj.ice_facet(__facet);";
out << nl << "try";
out << sb;
- out << nl << "if(__bb.ice_isA(\"" << scoped << "\", __ctx))";
+ out << nl << "if(__bb.ice_isA(\"" << p->scoped(false) << "\", __ctx))";
out << sb;
out << nl << name << "PrxHelper __h = new " << name << "PrxHelper();";
out << nl << "__h.__copyFrom(__bb);";
@@ -4334,7 +4386,8 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p)
//
// Class helper.
//
- open(getAbsolute(p, "", "", "Helper"), p->file());
+
+ open(suppressedabsolute(p->container(), getAbsolute(p, "", "", "Helper"), _suppress), p->file());
Output& out2 = output();
@@ -4366,7 +4419,7 @@ Slice::Gen::HelperVisitor::visitStructStart(const StructPtr& p)
string name = p->name();
string fixedName = fixKwd(name);
- open(getAbsolute(p, "", "", "Helper"), p->file());
+ open(suppressedabsolute(p->container(), getAbsolute(p, "", "", "Helper"), _suppress), p->file());
Output& out = output();
@@ -4460,7 +4513,7 @@ Slice::Gen::HelperVisitor::visitSequence(const SequencePtr& p)
suppressUnchecked = origContentS.find('<') != string::npos;
}
- open(helper, p->file());
+ open(suppressedabsolute(p->container(), helper, _suppress), p->file());
Output& out = output();
int iter;
@@ -4534,7 +4587,7 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p)
StringList metaData = p->getMetaData();
string formalType = typeToString(p, TypeModeIn, package, StringList(), true);
- open(helper, p->file());
+ open(suppressedabsolute(p->container(), helper, _suppress), p->file());
Output& out = output();
int iter;
@@ -4588,7 +4641,7 @@ Slice::Gen::HelperVisitor::visitEnum(const EnumPtr& p)
string name = p->name();
string fixedName = fixKwd(name);
- open(getAbsolute(p, "", "", "Helper"), p->file());
+ open(suppressedabsolute(p->container(), getAbsolute(p, "", "", "Helper"), _suppress), p->file());
Output& out = output();
@@ -4610,8 +4663,8 @@ Slice::Gen::HelperVisitor::visitEnum(const EnumPtr& p)
}
}
-Slice::Gen::ProxyVisitor::ProxyVisitor(const string& dir) :
- JavaVisitor(dir)
+Slice::Gen::ProxyVisitor::ProxyVisitor(const string& dir, bool suppress) :
+ JavaVisitor(dir), _suppress(suppress)
{
}
@@ -4628,7 +4681,7 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p)
string package = getPackage(p);
string absolute = getAbsolute(p, "", "", "Prx");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -4788,8 +4841,8 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
}
}
-Slice::Gen::DelegateVisitor::DelegateVisitor(const string& dir) :
- JavaVisitor(dir)
+Slice::Gen::DelegateVisitor::DelegateVisitor(const string& dir, bool suppress) :
+ JavaVisitor(dir), _suppress(suppress)
{
}
@@ -4806,7 +4859,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p)
string package = getPackage(p);
string absolute = getAbsolute(p, "", "_", "Del");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -4862,8 +4915,8 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p)
return false;
}
-Slice::Gen::DelegateMVisitor::DelegateMVisitor(const string& dir) :
- JavaVisitor(dir)
+Slice::Gen::DelegateMVisitor::DelegateMVisitor(const string& dir, bool suppress) :
+ JavaVisitor(dir), _suppress(suppress)
{
}
@@ -4880,7 +4933,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
string package = getPackage(p);
string absolute = getAbsolute(p, "", "_", "DelM");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
out << sp << nl << "public final class _" << name << "DelM extends Ice._ObjectDelM implements _" << name << "Del";
@@ -5061,8 +5114,8 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p)
return false;
}
-Slice::Gen::DelegateDVisitor::DelegateDVisitor(const string& dir) :
- JavaVisitor(dir)
+Slice::Gen::DelegateDVisitor::DelegateDVisitor(const string& dir, bool suppress) :
+ JavaVisitor(dir), _suppress(suppress)
{
}
@@ -5079,7 +5132,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
string package = getPackage(p);
string absolute = getAbsolute(p, "", "_", "DelD");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -5246,8 +5299,8 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p)
return false;
}
-Slice::Gen::DispatcherVisitor::DispatcherVisitor(const string& dir, bool stream) :
- JavaVisitor(dir), _stream(stream)
+Slice::Gen::DispatcherVisitor::DispatcherVisitor(const string& dir, bool stream, bool suppress) :
+ JavaVisitor(dir), _stream(stream), _suppress(suppress)
{
}
@@ -5263,7 +5316,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p)
ClassList bases = p->bases();
string absolute = getAbsolute(p, "", "_", "Disp");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -5560,7 +5613,7 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p)
string package = getPackage(p);
string absolute = getAbsolute(p, "", "", "I");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -5618,7 +5671,7 @@ Slice::Gen::ImplTieVisitor::visitClassDefStart(const ClassDefPtr& p)
string package = getPackage(p);
string absolute = getAbsolute(p, "", "", "I");
- open(absolute, p->file());
+ open(suppressedabsolute(p->container(), absolute, _suppress), p->file());
Output& out = output();
@@ -5690,8 +5743,8 @@ Slice::Gen::ImplTieVisitor::visitClassDefStart(const ClassDefPtr& p)
return false;
}
-Slice::Gen::AsyncVisitor::AsyncVisitor(const string& dir) :
- JavaVisitor(dir)
+Slice::Gen::AsyncVisitor::AsyncVisitor(const string& dir, bool suppress) :
+ JavaVisitor(dir), _suppress(suppress)
{
}
@@ -5717,7 +5770,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
string classNameAsync = "Callback_" + cl->name();
string absoluteAsync = getAbsolute(cl, "", "Callback_", "_" + name);
- open(absoluteAsync, p->file());
+ open(suppressedabsolute(p->container(), absoluteAsync, _suppress), p->file());
Output& out = output();
@@ -5817,7 +5870,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
string classNameAMI = "AMI_" + cl->name();
string absoluteAMI = getAbsolute(cl, "", "AMI_", "_" + name);
- open(absoluteAMI, p->file());
+ open(suppressedabsolute(p->container(), absoluteAMI, _suppress), p->file());
Output& out = output();
@@ -5895,7 +5948,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
vector<string> paramsAMD = getParamsAsyncCB(p, classPkg);
{
- open(absoluteAMD, p->file());
+ open(suppressedabsolute(p->container(), absoluteAMD, _suppress), p->file());
Output& out = output();
@@ -5913,7 +5966,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p)
}
{
- open(absoluteAMDI, p->file());
+ open(suppressedabsolute(p->container(), absoluteAMDI, _suppress), p->file());
Output& out = output();
diff --git a/cpp/src/slice2java/Gen.h b/cpp/src/slice2java/Gen.h
index 5e3f828..27aa6a1 100644
--- a/cpp/src/slice2java/Gen.h
+++ b/cpp/src/slice2java/Gen.h
@@ -99,7 +99,8 @@ public:
Gen(const std::string&,
const std::string&,
const std::vector<std::string>&,
- const std::string&);
+ const std::string&,
+ bool);
~Gen();
void generate(const UnitPtr&, bool);
@@ -115,25 +116,32 @@ private:
std::vector<std::string> _includePaths;
std::string _dir;
+ bool _suppress;
+
class OpsVisitor : public JavaVisitor
{
public:
- OpsVisitor(const std::string&);
+ OpsVisitor(const std::string&, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
private:
void writeOperations(const ClassDefPtr&, bool);
+ bool _suppress;
};
class TieVisitor : public JavaVisitor
{
public:
- TieVisitor(const std::string&);
+ TieVisitor(const std::string&, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class PackageVisitor : public JavaVisitor
@@ -149,7 +157,7 @@ private:
{
public:
- TypesVisitor(const std::string&, bool);
+ TypesVisitor(const std::string&, bool, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
@@ -170,13 +178,15 @@ private:
const std::string&);
bool _stream;
+
+ bool _suppress;
};
class HolderVisitor : public JavaVisitor
{
public:
- HolderVisitor(const std::string&, bool);
+ HolderVisitor(const std::string&, bool, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual bool visitStructStart(const StructPtr&);
@@ -189,13 +199,15 @@ private:
void writeHolder(const TypePtr&);
bool _stream;
+
+ bool _suppress;
};
class HelperVisitor : public JavaVisitor
{
public:
- HelperVisitor(const std::string&, bool);
+ HelperVisitor(const std::string&, bool, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual bool visitStructStart(const StructPtr&);
@@ -206,57 +218,77 @@ private:
private:
bool _stream;
+
+ bool _suppress;
};
class ProxyVisitor : public JavaVisitor
{
public:
- ProxyVisitor(const std::string&);
+ ProxyVisitor(const std::string&, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
virtual void visitClassDefEnd(const ClassDefPtr&);
virtual void visitOperation(const OperationPtr&);
+
+ private:
+
+ bool _suppress;
};
class DelegateVisitor : public JavaVisitor
{
public:
- DelegateVisitor(const std::string&);
+ DelegateVisitor(const std::string&, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class DelegateMVisitor : public JavaVisitor
{
public:
- DelegateMVisitor(const std::string&);
+ DelegateMVisitor(const std::string&, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class DelegateDVisitor : public JavaVisitor
{
public:
- DelegateDVisitor(const std::string&);
+ DelegateDVisitor(const std::string&, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
+
+ private:
+
+ bool _suppress;
};
class DispatcherVisitor : public JavaVisitor
{
public:
- DispatcherVisitor(const std::string&, bool);
+ DispatcherVisitor(const std::string&, bool, bool);
virtual bool visitClassDefStart(const ClassDefPtr&);
private:
bool _stream;
+
+ bool _suppress;
};
class BaseImplVisitor : public JavaVisitor
@@ -278,6 +310,8 @@ private:
//
void writeReturn(::IceUtilInternal::Output&, const TypePtr&);
+ bool _suppress;
+
//
// Generate an operation.
//
@@ -306,13 +340,15 @@ private:
{
public:
- AsyncVisitor(const std::string&);
+ AsyncVisitor(const std::string&, bool);
virtual void visitOperation(const OperationPtr&);
private:
static std::string initValue(const TypePtr&);
+
+ bool _suppress;
};
};
diff --git a/cpp/src/slice2java/Main.cpp b/cpp/src/slice2java/Main.cpp
index 90978cf..d00e54f 100644
--- a/cpp/src/slice2java/Main.cpp
+++ b/cpp/src/slice2java/Main.cpp
@@ -80,6 +80,7 @@ usage(const char* n)
"--checksum CLASS Generate checksums for Slice definitions into CLASS.\n"
"--stream Generate marshaling support for public stream API.\n"
"--meta META Define global metadata directive META.\n"
+ "--suppress Suppress tagged modules from being written.\n"
;
}
@@ -106,6 +107,7 @@ compile(int argc, char* argv[])
opts.addOpt("", "checksum", IceUtilInternal::Options::NeedArg);
opts.addOpt("", "stream");
opts.addOpt("", "meta", IceUtilInternal::Options::NeedArg, "", IceUtilInternal::Options::Repeat);
+ opts.addOpt("", "suppress");
vector<string>args;
try
@@ -180,6 +182,8 @@ compile(int argc, char* argv[])
vector<string> v = opts.argVec("meta");
copy(v.begin(), v.end(), back_inserter(globalMetadata));
+ bool suppress = opts.isSet("suppress");
+
if(args.empty())
{
getErrorStream() << argv[0] << ": error: no input file" << endl;
@@ -308,7 +312,7 @@ compile(int argc, char* argv[])
{
try
{
- Gen gen(argv[0], icecpp->getBaseName(), includePaths, output);
+ Gen gen(argv[0], icecpp->getBaseName(), includePaths, output, suppress);
gen.generate(p, stream);
if(tie)
{
diff --git a/cpp/src/slice2py/Main.cpp b/cpp/src/slice2py/Main.cpp
index 0eed265..efcb14d 100644
--- a/cpp/src/slice2py/Main.cpp
+++ b/cpp/src/slice2py/Main.cpp
@@ -170,7 +170,7 @@ PackageVisitor::visitModuleEnd(const ModulePtr& p)
// Collect the most deeply-nested modules. For example, if we have a
// module named M.N.O, then we don't need to keep M or M.N in the list.
//
- string abs = getAbsolute(p);
+ string abs = getAbsolute(p, false);
if(find(_modules.begin(), _modules.end(), abs) == _modules.end())
{
_modules.push_back(abs);
@@ -378,6 +378,7 @@ usage(const char* n)
"--all Generate code for Slice definitions in included files.\n"
"--checksum Generate checksums for Slice definitions.\n"
"--prefix PREFIX Prepend filenames of Python modules with PREFIX.\n"
+ "--suppress Suppress tagged modules from being written.\n"
;
}
@@ -400,6 +401,7 @@ compile(int argc, char* argv[])
opts.addOpt("", "no-package");
opts.addOpt("", "checksum");
opts.addOpt("", "prefix", IceUtilInternal::Options::NeedArg);
+ opts.addOpt("", "suppress");
vector<string> args;
try
@@ -465,6 +467,8 @@ compile(int argc, char* argv[])
string prefix = opts.optArg("prefix");
+ bool suppress = opts.isSet("suppress");
+
if(args.empty())
{
getErrorStream() << argv[0] << ": error: no input file" << endl;
@@ -597,7 +601,7 @@ compile(int argc, char* argv[])
//
// Generate the Python mapping.
//
- generate(u, all, checksum, includePaths, out);
+ generate(u, all, checksum, includePaths, out, suppress);
out.close();
diff --git a/cpp/src/slice2rb/Main.cpp b/cpp/src/slice2rb/Main.cpp
index e4b6cd0..550eb68 100644
--- a/cpp/src/slice2rb/Main.cpp
+++ b/cpp/src/slice2rb/Main.cpp
@@ -90,6 +90,7 @@ usage(const char* n)
"--underscore Permit underscores in Slice identifiers.\n"
"--all Generate code for Slice definitions in included files.\n"
"--checksum Generate checksums for Slice definitions.\n"
+ "--suppress Suppress tagged modules from being written.\n"
;
}
@@ -110,6 +111,7 @@ compile(int argc, char* argv[])
opts.addOpt("", "underscore");
opts.addOpt("", "all");
opts.addOpt("", "checksum");
+ opts.addOpt("", "suppress");
vector<string> args;
try
@@ -171,6 +173,8 @@ compile(int argc, char* argv[])
bool checksum = opts.isSet("checksum");
+ bool suppress = opts.isSet("suppress");
+
if(args.empty())
{
getErrorStream() << argv[0] << ": error: no input file" << endl;
@@ -296,7 +300,7 @@ compile(int argc, char* argv[])
//
// Generate the Ruby mapping.
//
- generate(u, all, checksum, includePaths, out);
+ generate(u, all, checksum, includePaths, out, suppress);
out.close();
}
diff --git a/cpp/test/Ice/Makefile b/cpp/test/Ice/Makefile
index 9bf6ba1..504aa13 100644
--- a/cpp/test/Ice/Makefile
+++ b/cpp/test/Ice/Makefile
@@ -40,7 +40,8 @@ SUBDIRS = proxy \
defaultServant \
defaultValue \
threadPoolPriority \
- invoke
+ invoke \
+ versioning
$(EVERYTHING)::
@for subdir in $(SUBDIRS); \
diff --git a/cs/allTests.py b/cs/allTests.py
index 341cd69..c5745b2 100755
--- a/cs/allTests.py
+++ b/cs/allTests.py
@@ -57,6 +57,7 @@ tests = [
("Ice/defaultValue", ["core"]),
("Ice/threadPoolPriority", ["core", "nomono"]),
("Ice/invoke", ["core"]),
+ ("Ice/versioning", ["core"]),
("IceBox/configuration", ["core", "noipv6"]),
("Glacier2/router", ["service"]),
("IceGrid/simple", ["service"]),
diff --git a/cs/src/Ice/BasicStream.cs b/cs/src/Ice/BasicStream.cs
index 703c362..db6b056 100644
--- a/cs/src/Ice/BasicStream.cs
+++ b/cs/src/Ice/BasicStream.cs
@@ -2716,10 +2716,24 @@ namespace IceInternal
internal DynamicObjectFactory(Type c)
{
_class = c;
+ _versionChecked = false;
}
public Ice.Object create(string type)
{
+ if(!_versionChecked)
+ {
+ try
+ {
+ Ice.MigrationProxy v = (Ice.MigrationProxy)AssemblyUtil.createInstance(_class);
+ _class = v.actualRuntimeClass();
+ }
+ catch(InvalidCastException)
+ {
+ }
+ _versionChecked = true;
+ }
+
try
{
return (Ice.Object)AssemblyUtil.createInstance(_class);
@@ -2735,6 +2749,7 @@ namespace IceInternal
}
private Type _class;
+ private bool _versionChecked;
}
private Ice.ObjectFactory loadObjectFactory(string id)
diff --git a/cs/src/Ice/Makefile b/cs/src/Ice/Makefile
index 574a8c3..0376b23 100644
--- a/cs/src/Ice/Makefile
+++ b/cs/src/Ice/Makefile
@@ -55,6 +55,7 @@ SRCS = Acceptor.cs \
LocatorInfo.cs \
LoggerI.cs \
LoggerPlugin.cs \
+ MigrationProxy.cs \
Network.cs \
ObjectAdapterFactory.cs \
ObjectAdapterI.cs \
diff --git a/cs/test/Ice/Makefile b/cs/test/Ice/Makefile
index 54ae95f..d96399b 100644
--- a/cs/test/Ice/Makefile
+++ b/cs/test/Ice/Makefile
@@ -38,6 +38,7 @@ SUBDIRS = application \
seqMapping \
background \
udp \
+ versioning \
defaultServant \
defaultValue \
threadPoolPriority
diff --git a/java/allTests.py b/java/allTests.py
index 8054a0f..879fe7b 100755
--- a/java/allTests.py
+++ b/java/allTests.py
@@ -62,6 +62,7 @@ tests = [
("Ice/threadPoolPriority", ["core"]),
("Ice/classLoader", ["core"]),
("Ice/invoke", ["core"]),
+ ("Ice/versioning", ["core"]),
("IceBox/configuration", ["core", "noipv6"]),
("Freeze/dbmap", ["once"]),
("Freeze/complex", ["once"]),
diff --git a/java/build.xml b/java/build.xml
index 62a5702..7938d50 100644
--- a/java/build.xml
+++ b/java/build.xml
@@ -366,6 +366,18 @@
</fileset>
</slice2java>
+ <slice2java suppress="on" outputdir="${generated.test.dir}" dependencyfile="${generated.test.dir}/.depend.Test">
+ <includepath>
+ <pathelement path="${slice.dir}" />
+ </includepath>
+
+ <fileset dir="test/Ice/versioning/">
+ <include name="Client1Private.ice" />
+ <include name="Client2Private.ice" />
+ <include name="ServerPrivate.ice" />
+ </fileset>
+ </slice2java>
+
<slice2java tie="on" outputdir="${generated.test.dir}" dependencyfile="${generated.test.dir}/.depend.Test">
<includepath>
<pathelement path="${slice.dir}" />
diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java
index e07585b..3a7e8b9 100644
--- a/java/src/IceInternal/BasicStream.java
+++ b/java/src/IceInternal/BasicStream.java
@@ -2077,6 +2077,29 @@ public class BasicStream
public Ice.Object
create(String type)
{
+ if(!_versionChecked)
+ {
+ try
+ {
+ Class[] interfaces = _class.getInterfaces();
+ for(int i = 0; i < interfaces.length; ++i)
+ {
+ if(interfaces[i].getName().equals("Ice.MigrationProxy"))
+ {
+ Ice.MigrationProxy v = (Ice.MigrationProxy)_class.newInstance();
+ _class = v.actualRuntimeClass();
+ }
+ }
+ }
+ catch(java.lang.Exception ex)
+ {
+ Ice.SyscallException e = new Ice.SyscallException();
+ e.initCause(ex);
+ throw e;
+ }
+ _versionChecked = true;
+ }
+
try
{
return (Ice.Object)_class.newInstance();
@@ -2095,13 +2118,13 @@ public class BasicStream
}
private Class<?> _class;
+ private boolean _versionChecked = false;
}
private Ice.ObjectFactory
loadObjectFactory(String id)
{
Ice.ObjectFactory factory = null;
-
try
{
Class<?> c = findClass(id);
diff --git a/java/src/ant/Slice2JavaTask.java b/java/src/ant/Slice2JavaTask.java
index f660657..092d941 100644
--- a/java/src/ant/Slice2JavaTask.java
+++ b/java/src/ant/Slice2JavaTask.java
@@ -274,6 +274,12 @@ public class Slice2JavaTask extends SliceTask
cmd.append(" --underscore");
}
+ if(_suppress)
+ {
+ cmd.append(" --suppress");
+ }
+
+
//
// Add files to be translated
//
@@ -327,6 +333,11 @@ public class Slice2JavaTask extends SliceTask
cmd.append(" --underscore");
}
+ if(_suppress)
+ {
+ cmd.append(" --suppress");
+ }
+
//
// Add include directives
//
diff --git a/java/src/ant/SliceTask.java b/java/src/ant/SliceTask.java
index b492167..b92b8f4 100644
--- a/java/src/ant/SliceTask.java
+++ b/java/src/ant/SliceTask.java
@@ -40,6 +40,7 @@ import java.io.BufferedWriter;
* outputdir - The value for the --output-dir translator option.
* ice - Enables the --ice translator option.
* underscore - Enables the --underscore translator option.
+ * suppress - Enables the --suppress translator option
*
* Nested elements:
*
@@ -60,6 +61,7 @@ public class SliceTask extends org.apache.tools.ant.Task
_outputDir = null;
_outputDirString = null;
_ice = false;
+ _suppress = false;
_includePath = null;
}
@@ -92,6 +94,13 @@ public class SliceTask extends org.apache.tools.ant.Task
_underscore = underscore;
}
+ public void
+ setSuppress(boolean suppress)
+ {
+ System.err.println("Suppression is " + suppress);
+ _suppress = suppress;
+ }
+
public Path
createIncludePath()
{
@@ -548,6 +557,7 @@ public class SliceTask extends org.apache.tools.ant.Task
protected String _outputDirString;
protected boolean _ice;
protected boolean _underscore;
+ protected boolean _suppress;
protected Path _includePath;
protected java.util.List<FileSet> _fileSets = new java.util.LinkedList<FileSet>();
protected java.util.List<SliceDefine> _defines = new java.util.LinkedList<SliceDefine>();
diff --git a/py/modules/IcePy/Slice.cpp b/py/modules/IcePy/Slice.cpp
index b0d33be..e10fa0b 100644
--- a/py/modules/IcePy/Slice.cpp
+++ b/py/modules/IcePy/Slice.cpp
@@ -71,6 +71,7 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args)
opts.addOpt("", "underscore");
opts.addOpt("", "checksum");
opts.addOpt("", "all");
+ opts.addOpt("", "suppress");
vector<string> files;
try
@@ -101,6 +102,7 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args)
bool underscore = opts.isSet("underscore");
bool all = false;
bool checksum = false;
+ bool suppress = false;
if(opts.isSet("D"))
{
vector<string> optargs = opts.argVec("D");
@@ -128,6 +130,7 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args)
debug = opts.isSet("d") || opts.isSet("debug");
all = opts.isSet("all");
checksum = opts.isSet("checksum");
+ suppress = opts.isSet("suppress");
bool ignoreRedefs = false;
bool keepComments = true;
@@ -160,7 +163,7 @@ IcePy_loadSlice(PyObject* /*self*/, PyObject* args)
ostringstream codeStream;
IceUtilInternal::Output out(codeStream);
out.setUseTab(false);
- generate(u, all, checksum, includePaths, out);
+ generate(u, all, checksum, includePaths, out, suppress);
u->destroy();
string code = codeStream.str();
diff --git a/rb/src/IceRuby/Slice.cpp b/rb/src/IceRuby/Slice.cpp
index 4198307..dc993d0 100644
--- a/rb/src/IceRuby/Slice.cpp
+++ b/rb/src/IceRuby/Slice.cpp
@@ -61,6 +61,7 @@ IceRuby_loadSlice(int argc, VALUE* argv, VALUE self)
opts.addOpt("", "underscore");
opts.addOpt("", "checksum");
opts.addOpt("", "all");
+ opts.addOpt("", "suppress");
vector<string> files;
try
@@ -88,6 +89,7 @@ IceRuby_loadSlice(int argc, VALUE* argv, VALUE self)
bool underscore = opts.isSet("underscore");
bool all = false;
bool checksum = false;
+ bool suppress = false;
if(opts.isSet("D"))
{
vector<string> optargs = opts.argVec("D");
@@ -115,6 +117,7 @@ IceRuby_loadSlice(int argc, VALUE* argv, VALUE self)
debug = opts.isSet("d") || opts.isSet("debug");
all = opts.isSet("all");
checksum = opts.isSet("checksum");
+ suppress = opts.isSet("suppress");
bool ignoreRedefs = false;
@@ -144,7 +147,7 @@ IceRuby_loadSlice(int argc, VALUE* argv, VALUE self)
ostringstream codeStream;
IceUtilInternal::Output out(codeStream);
out.setUseTab(false);
- generate(u, all, checksum, includePaths, out);
+ generate(u, all, checksum, includePaths, out, suppress);
u->destroy();
string code = codeStream.str();
commit 32d56ab3b12e024059cf784ce646f96d50d253f9
Author: Brent Eagles <brent at puffin.(none)>
Date: Thu Jun 24 09:27:11 2010 -0230
Added support for using scope suppressed types as arguments,etc.
Added support for keeping suppressed scopes in the type ids.
Added test applications.
diff --git a/cpp/test/Ice/versioning/.depend b/cpp/test/Ice/versioning/.depend
new file mode 100644
index 0000000..d2afba3
--- /dev/null
+++ b/cpp/test/Ice/versioning/.depend
@@ -0,0 +1,4 @@
+Test$(OBJEXT): Test.cpp Test.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/Ice/ObjectFactory.h $(includedir)/IceUtil/Iterator.h
+TestI$(OBJEXT): TestI.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/Dispatcher.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/CommunicatorAsync.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionAsync.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h TestI.h Test.h
+Server$(OBJEXT): Server.cpp $(includedir)/Ice/Ice.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/LocalObjectF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Handle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/Ice/ProxyF.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Exception.h $(includedir)/Ice/LocalObject.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/Dispatcher.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/Stream.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/CommunicatorAsync.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionAsync.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/IconvStringConverter.h TestI.h Test.h
+Test.cpp: Test.ice $(SLICE2CPP) $(SLICEPARSERLIB)
diff --git a/cpp/test/Ice/versioning/.depend.mak b/cpp/test/Ice/versioning/.depend.mak
new file mode 100644
index 0000000..7b4d4aa
--- /dev/null
+++ b/cpp/test/Ice/versioning/.depend.mak
@@ -0,0 +1,4 @@
+Test$(OBJEXT): Test.cpp Test.h "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Handle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/Ice/ProxyF.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/FactoryTableInit.h" "$(includedir)/Ice/FactoryTable.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/Ice/Stream.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/IceUtil/Iterator.h"
+TestI$(OBJEXT): TestI.cpp "$(includedir)/Ice/Ice.h" "$(includedir)/Ice/Initialize.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Handle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/Ice/ProxyF.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/PropertiesF.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/LoggerF.h" "$(includedir)/Ice/StatsF.h" "$(includedir)/Ice/Dispatcher.h" "$(includedir)/Ice/StringConverter.h" "$(includedir)/Ice/Plugin.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/Ice/Stream.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/Properties.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/Logger.h" "$(includedir)/Ice/LoggerUtil.h" "$(includedir)/Ice/Stats.h" "$(includedir)/Ice/Communicator.h" "$(includedir)/Ice/RouterF.h" "$(includedir)/Ice/LocatorF.h" "$(includedir)/Ice/PluginF.h" "$(includedir)/Ice/ImplicitContextF.h" "$(includedir)/Ice/CommunicatorAsync.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/Ice/ObjectAdapter.h" "$(includedir)/Ice/FacetMap.h" "$(includedir)/Ice/Endpoint.h" "$(includedir)/Ice/ServantLocator.h" "$(includedir)/Ice/IncomingAsync.h" "$(includedir)/Ice/Process.h" "$(includedir)/Ice/Application.h" "$(includedir)/Ice/Connection.h" "$(includedir)/Ice/ConnectionAsync.h" "$(includedir)/Ice/Functional.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/Ice/ImplicitContext.h" "$(includedir)/Ice/Locator.h" "$(includedir)/Ice/FactoryTableInit.h" "$(includedir)/Ice/FactoryTable.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/ProcessF.h" "$(includedir)/Ice/Router.h" "$(includedir)/Ice/DispatchInterceptor.h" "$(includedir)/Ice/IconvStringConverter.h" TestI.h Test.h
+Server$(OBJEXT): Server.cpp "$(includedir)/Ice/Ice.h" "$(includedir)/Ice/Initialize.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Handle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/Ice/ProxyF.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/PropertiesF.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/LoggerF.h" "$(includedir)/Ice/StatsF.h" "$(includedir)/Ice/Dispatcher.h" "$(includedir)/Ice/StringConverter.h" "$(includedir)/Ice/Plugin.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/Ice/Stream.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/Properties.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/Logger.h" "$(includedir)/Ice/LoggerUtil.h" "$(includedir)/Ice/Stats.h" "$(includedir)/Ice/Communicator.h" "$(includedir)/Ice/RouterF.h" "$(includedir)/Ice/LocatorF.h" "$(includedir)/Ice/PluginF.h" "$(includedir)/Ice/ImplicitContextF.h" "$(includedir)/Ice/CommunicatorAsync.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/Ice/ObjectAdapter.h" "$(includedir)/Ice/FacetMap.h" "$(includedir)/Ice/Endpoint.h" "$(includedir)/Ice/ServantLocator.h" "$(includedir)/Ice/IncomingAsync.h" "$(includedir)/Ice/Process.h" "$(includedir)/Ice/Application.h" "$(includedir)/Ice/Connection.h" "$(includedir)/Ice/ConnectionAsync.h" "$(includedir)/Ice/Functional.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/Ice/ImplicitContext.h" "$(includedir)/Ice/Locator.h" "$(includedir)/Ice/FactoryTableInit.h" "$(includedir)/Ice/FactoryTable.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/ProcessF.h" "$(includedir)/Ice/Router.h" "$(includedir)/Ice/DispatchInterceptor.h" "$(includedir)/Ice/IconvStringConverter.h" TestI.h Test.h
+Test.cpp: Test.ice "$(SLICE2CPP)" "$(SLICEPARSERLIB)"
diff --git a/cpp/test/Ice/versioning/AllTests.cpp b/cpp/test/Ice/versioning/AllTests.cpp
new file mode 100644
index 0000000..a18510c
--- /dev/null
+++ b/cpp/test/Ice/versioning/AllTests.cpp
@@ -0,0 +1,47 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+using namespace Test;
+
+InitialPrx
+allTests(const Ice::CommunicatorPtr& communicator, bool collocated)
+{
+ cout << "testing stringToProxy... " << flush;
+ string ref = "initial:default -p 12010";
+ Ice::ObjectPrx base = communicator->stringToProxy(ref);
+ test(base);
+ cout << "ok" << endl;
+ InitialPrx initial = InitialPrx::checkedCast(base);
+
+ cout << "testing checked cast... " << flush;
+ IAPrx prx = IAPrx::checkedCast(base, InterfaceVersion);
+ test(prx);
+ test(prx->ice_getFacet() == InterfaceVersion);
+ cout << "ok" << endl;
+
+ CAPtr p = prx->getCA();
+
+#ifdef VERSION1
+ test(p->message == "version 1");
+ test(p->flag == "1");
+#endif
+
+#ifdef VERSION2
+ test(p->message == "version 2");
+ test(p->flag == 1);
+#endif
+
+ cout << "ok" << endl;
+ return initial;
+}
diff --git a/cpp/test/Ice/versioning/Client.cpp b/cpp/test/Ice/versioning/Client.cpp
new file mode 100644
index 0000000..58889c2
--- /dev/null
+++ b/cpp/test/Ice/versioning/Client.cpp
@@ -0,0 +1,57 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestCommon.h>
+#include <Test.h>
+
+using namespace std;
+using namespace Test;
+
+int
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+{
+ InitialPrx allTests(const Ice::CommunicatorPtr&, bool);
+ InitialPrx initial = allTests(communicator, false);
+ initial->shutdown();
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ communicator = Ice::initialize(argc, argv);
+ status = run(argc, argv, communicator);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
+}
diff --git a/cpp/test/Ice/versioning/Makefile b/cpp/test/Ice/versioning/Makefile
new file mode 100644
index 0000000..dee607c
--- /dev/null
+++ b/cpp/test/Ice/versioning/Makefile
@@ -0,0 +1,46 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ../../..
+
+SERVER = server
+
+TARGETS = $(SERVER)
+
+OBJS = TestI.o \
+ Test.o
+
+SOBJS = Server.o
+
+SRCS = $(OBJS:.o=.cpp) \
+ $(SOBJS:.o=.cpp)
+
+SLICE_SRCS = Test.ice
+
+include $(top_srcdir)/config/Make.rules
+CPPFLAGS := -I. -I../../include $(CPPFLAGS)
+SLICE2CPPFLAGS := $(SLICE2CPPFLAGS)
+
+SUBDIRS = version1 version2
+
+$(EVERYTHING)::
+ @for subdir in $(SUBDIRS); \
+ do \
+ echo "making $@ in $$subdir"; \
+ ( cd $$subdir && $(MAKE) $@ ) || exit 1; \
+ done
+
+$(SERVER): $(OBJS) $(SOBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(LIBS)
+
+clean::
+ rm -f Test.cpp Test.h
+
+include .depend
diff --git a/cpp/test/Ice/versioning/Makefile.mak b/cpp/test/Ice/versioning/Makefile.mak
new file mode 100644
index 0000000..2e08c24
--- /dev/null
+++ b/cpp/test/Ice/versioning/Makefile.mak
@@ -0,0 +1,41 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..
+
+SERVER = server.exe
+
+TARGETS = $(SERVER)
+
+OBJS = Test.obj \
+ TestI.obj
+
+SOBJS = Server.obj
+
+SRCS = $(OBJS:.obj=.cpp) \
+ $(SOBJS:.obj=.cpp) \
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+SLICE2CPPFLAGS = $(SLICE2CPPFLAGS)
+CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+
+!if "$(GENERATE_PDB)" == "yes"
+SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
+!endif
+
+$(SERVER): $(SOBJS) $(OBJS)
+ $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+clean::
+ del /q Test.cpp Test.h
+
+!include .depend.mak
diff --git a/cpp/test/Ice/versioning/Server.cpp b/cpp/test/Ice/versioning/Server.cpp
new file mode 100644
index 0000000..cc75f0c
--- /dev/null
+++ b/cpp/test/Ice/versioning/Server.cpp
@@ -0,0 +1,65 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestI.h>
+
+using namespace std;
+using namespace Test;
+
+int
+run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
+{
+
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010");
+ Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
+ InitialPtr initial = new InitialI(adapter);
+ adapter->add(initial, communicator->stringToIdentity("initial"));
+
+ Version1::IAPtr ver1 = new Version1I;
+ adapter->addFacet(ver1, communicator->stringToIdentity("initial"), Test::Version1::InterfaceVersion);
+ Version2::IAPtr ver2 = new Version2I;
+ adapter->addFacet(ver2, communicator->stringToIdentity("initial"), Test::Version2::InterfaceVersion);
+ adapter->activate();
+ communicator->waitForShutdown();
+ return EXIT_SUCCESS;
+}
+
+int
+main(int argc, char* argv[])
+{
+ int status;
+ Ice::CommunicatorPtr communicator;
+
+ try
+ {
+ communicator = Ice::initialize(argc, argv);
+ status = run(argc, argv, communicator);
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+
+ if(communicator)
+ {
+ try
+ {
+ communicator->destroy();
+ }
+ catch(const Ice::Exception& ex)
+ {
+ cerr << ex << endl;
+ status = EXIT_FAILURE;
+ }
+ }
+
+ return status;
+}
diff --git a/cpp/test/Ice/versioning/Test.ice b/cpp/test/Ice/versioning/Test.ice
new file mode 100644
index 0000000..1673bb1
--- /dev/null
+++ b/cpp/test/Ice/versioning/Test.ice
@@ -0,0 +1,59 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+#ifdef VERSION1
+ ["suppress"]
+#endif
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+#ifdef VERSION2
+ ["suppress"]
+#endif
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/cpp/test/Ice/versioning/TestI.cpp b/cpp/test/Ice/versioning/TestI.cpp
new file mode 100644
index 0000000..9fb68c5
--- /dev/null
+++ b/cpp/test/Ice/versioning/TestI.cpp
@@ -0,0 +1,40 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#include <Ice/Ice.h>
+#include <TestI.h>
+
+Test::Version1::CAPtr
+Version1I::getCA(const Ice::Current&)
+{
+ Test::Version1::CAPtr result = new Test::Version1::CA;
+ result->message = "version 1";
+ result->flag = "1";
+ return result;
+}
+
+Test::Version2::CAPtr
+Version2I::getCA(const Ice::Current&)
+{
+ Test::Version2::CAPtr result = new Test::Version2::CA;
+ result->message = "version 2";
+ result->flag = 1;
+ return result;
+}
+
+InitialI::InitialI(const Ice::ObjectAdapterPtr& adapter) :
+ _adapter(adapter)
+{
+}
+
+void
+InitialI::shutdown(const Ice::Current&)
+{
+ _adapter->getCommunicator()->shutdown();
+}
diff --git a/cpp/test/Ice/versioning/TestI.h b/cpp/test/Ice/versioning/TestI.h
new file mode 100644
index 0000000..f1588bf
--- /dev/null
+++ b/cpp/test/Ice/versioning/TestI.h
@@ -0,0 +1,41 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_I_H
+#define TEST_I_H
+
+#include <Test.h>
+
+class Version1I : virtual public Test::Version1::IA
+{
+public:
+ Test::Version1::CAPtr getCA(const Ice::Current&);
+};
+
+class Version2I : virtual public Test::Version2::IA
+{
+public:
+ Test::Version2::CAPtr getCA(const Ice::Current&);
+};
+
+class InitialI : public Test::Initial
+{
+public:
+
+ InitialI(const Ice::ObjectAdapterPtr&);
+
+ virtual void shutdown(const Ice::Current&);
+
+private:
+
+ Ice::ObjectAdapterPtr _adapter;
+};
+
+
+#endif
diff --git a/cpp/test/Ice/versioning/run.py b/cpp/test/Ice/versioning/run.py
new file mode 100755
index 0000000..722b0fe
--- /dev/null
+++ b/cpp/test/Ice/versioning/run.py
@@ -0,0 +1,43 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys
+
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
+ raise "can't find toplevel directory!"
+sys.path.append(os.path.join(path[0]))
+from scripts import *
+
+def runServer():
+ server = "server"
+ driverConfig = TestUtil.DriverConfig("server")
+ driverConfig.lang = "cpp"
+ cmd = TestUtil.getCommandLine(server, driverConfig)
+ proc = TestUtil.spawnServer(cmd)
+ return proc
+
+def runClient(suffix):
+ server = "client" + suffix
+ driverConfig = TestUtil.DriverConfig("client")
+ driverConfig.lang = "cpp"
+ cmd = TestUtil.getCommandLine(server, driverConfig)
+ proc = TestUtil.spawnClient(cmd)
+ return proc
+
+server = runServer()
+client = runClient("1")
+
+server = runServer()
+client = runClient("2")
diff --git a/cpp/test/Ice/versioning/version1/.depend b/cpp/test/Ice/versioning/version1/.depend
new file mode 100644
index 0000000..e69de29
diff --git a/cpp/test/Ice/versioning/version1/.depend.mak b/cpp/test/Ice/versioning/version1/.depend.mak
new file mode 100644
index 0000000..e69de29
diff --git a/cpp/test/Ice/versioning/version1/Makefile b/cpp/test/Ice/versioning/version1/Makefile
new file mode 100644
index 0000000..c2d367f
--- /dev/null
+++ b/cpp/test/Ice/versioning/version1/Makefile
@@ -0,0 +1,47 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ../../../..
+
+CLIENT = ../client1
+
+TARGETS = $(CLIENT)
+
+VOBJS = Client.o \
+ AllTests.o \
+ Test.o
+
+
+include $(top_srcdir)/config/Make.rules
+CPPFLAGS := -DVERSION1 -I. -I.. -I../../../include $(CPPFLAGS)
+SLICE2CPPFLAGS := $(SLICE2CPPFLAGS) -DVERSION1 --suppress
+
+Client.o: ../Client.cpp Test.cpp
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ ../Client.cpp
+
+AllTests.o: ../AllTests.cpp Test.cpp
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ ../AllTests.cpp
+
+Test.o: Test.cpp Test.h
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $(@:.o=.cpp)
+
+Test.cpp Test.h: ../Test.ice
+ rm -f $@
+ $(SLICE2CPP) $(SLICE2CPPFLAGS) $^
+
+$(CLIENT): $(VOBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(VOBJS) $(LIBS)
+
+clean::
+ rm -f Test.h Test.cpp
+ rm -f $(VOBJS)
+ rm -f $(CLIENT)
+
+include .depend
diff --git a/cpp/test/Ice/versioning/version1/Makefile.mak b/cpp/test/Ice/versioning/version1/Makefile.mak
new file mode 100644
index 0000000..623a18e
--- /dev/null
+++ b/cpp/test/Ice/versioning/version1/Makefile.mak
@@ -0,0 +1,47 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..\..
+
+CLIENT = ..\client1.exe
+
+TARGETS = $(CLIENT)
+
+OBJS = Client.obj \
+ AllTests.obj \
+ Test.obj
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+SLICE2CPPFLAGS = $(SLICE2CPPFLAGS) -DVERSION1
+CPPFLAGS = -DVERSION1 -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+
+!if "$(GENERATE_PDB)" == "yes"
+CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
+!endif
+
+Client.obj: ..\Client.cpp Test.h
+
+AllTests.obj: ..\AllTests.cpp Test.h
+
+Test.obj: Test.cpp Test.h
+
+Test.cpp: ..\Test.ice
+ del /q Test.h Test.cpp
+ $(SLICE2CPP) $(SLICE2CPPFLAGS) $^
+
+$(CLIENT): $(OBJS)
+ $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+clean::
+ del /q Test.cpp Test.h
+
+!include .depend.mak
diff --git a/cpp/test/Ice/versioning/version2/.depend b/cpp/test/Ice/versioning/version2/.depend
new file mode 100644
index 0000000..e69de29
diff --git a/cpp/test/Ice/versioning/version2/.depend.mak b/cpp/test/Ice/versioning/version2/.depend.mak
new file mode 100644
index 0000000..e69de29
diff --git a/cpp/test/Ice/versioning/version2/Makefile b/cpp/test/Ice/versioning/version2/Makefile
new file mode 100644
index 0000000..e4c786d
--- /dev/null
+++ b/cpp/test/Ice/versioning/version2/Makefile
@@ -0,0 +1,47 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ../../../..
+
+CLIENT = ../client2
+
+TARGETS = $(CLIENT)
+
+VOBJS = Client.o \
+ AllTests.o \
+ Test.o
+
+
+include $(top_srcdir)/config/Make.rules
+CPPFLAGS := -DVERSION2 -I. -I.. -I../../../include $(CPPFLAGS)
+SLICE2CPPFLAGS := $(SLICE2CPPFLAGS) -DVERSION2 --suppress
+
+Client.o: ../Client.cpp Test.cpp
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ ../Client.cpp
+
+AllTests.o: ../AllTests.cpp Test.cpp
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ ../AllTests.cpp
+
+Test.o: Test.cpp Test.h
+ $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $(@:.o=.cpp)
+
+Test.cpp Test.h: ../Test.ice
+ rm -f $@
+ $(SLICE2CPP) $(SLICE2CPPFLAGS) $^
+
+$(CLIENT): $(VOBJS)
+ rm -f $@
+ $(CXX) $(LDFLAGS) -o $@ $(VOBJS) $(LIBS)
+
+clean::
+ rm -f Test.h Test.cpp
+ rm -f $(VOBJS)
+ rm -f $(CLIENT)
+
+include .depend
diff --git a/cpp/test/Ice/versioning/version2/Makefile.mak b/cpp/test/Ice/versioning/version2/Makefile.mak
new file mode 100644
index 0000000..623a18e
--- /dev/null
+++ b/cpp/test/Ice/versioning/version2/Makefile.mak
@@ -0,0 +1,47 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..\..
+
+CLIENT = ..\client1.exe
+
+TARGETS = $(CLIENT)
+
+OBJS = Client.obj \
+ AllTests.obj \
+ Test.obj
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+SLICE2CPPFLAGS = $(SLICE2CPPFLAGS) -DVERSION1
+CPPFLAGS = -DVERSION1 -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+
+!if "$(GENERATE_PDB)" == "yes"
+CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
+!endif
+
+Client.obj: ..\Client.cpp Test.h
+
+AllTests.obj: ..\AllTests.cpp Test.h
+
+Test.obj: Test.cpp Test.h
+
+Test.cpp: ..\Test.ice
+ del /q Test.h Test.cpp
+ $(SLICE2CPP) $(SLICE2CPPFLAGS) $^
+
+$(CLIENT): $(OBJS)
+ $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+clean::
+ del /q Test.cpp Test.h
+
+!include .depend.mak
diff --git a/cs/src/Ice/MigrationProxy.cs b/cs/src/Ice/MigrationProxy.cs
new file mode 100644
index 0000000..5b1e3fa
--- /dev/null
+++ b/cs/src/Ice/MigrationProxy.cs
@@ -0,0 +1,9 @@
+namespace Ice
+{
+ using System;
+ public interface MigrationProxy
+ {
+ Object createCurrentVersion();
+ Type actualRuntimeClass();
+ }
+}
diff --git a/cs/test/Ice/versioning/.depend b/cs/test/Ice/versioning/.depend
new file mode 100644
index 0000000..e69de29
diff --git a/cs/test/Ice/versioning/.depend.mak b/cs/test/Ice/versioning/.depend.mak
new file mode 100644
index 0000000..e69de29
diff --git a/cs/test/Ice/versioning/InitialI.cs b/cs/test/Ice/versioning/InitialI.cs
new file mode 100644
index 0000000..e701d26
--- /dev/null
+++ b/cs/test/Ice/versioning/InitialI.cs
@@ -0,0 +1,36 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using Test;
+
+public class Version1I : Test.Version1.IADisp_
+{
+ public override Test.Version1.CA getCA(Ice.Current current)
+ {
+ return new Test.Version1.CA("version 1", "1");
+ }
+}
+
+public class Version2I : Test.Version2.IADisp_
+{
+ public override Test.Version2.CA getCA(Ice.Current current)
+ {
+ return new Test.Version2.CA("version 2", 1);
+ }
+}
+
+public sealed class InitialI : InitialDisp_
+{
+ public override void shutdown(Ice.Current current)
+ {
+ current.adapter.getCommunicator().shutdown();
+ }
+}
diff --git a/cs/test/Ice/versioning/Makefile b/cs/test/Ice/versioning/Makefile
new file mode 100644
index 0000000..67bbf13
--- /dev/null
+++ b/cs/test/Ice/versioning/Makefile
@@ -0,0 +1,43 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ../../..
+
+TARGETS = server.exe
+
+S_SRCS = Server.cs InitialI.cs
+
+SLICE_S_SRCS = $(SDIR)/Test.ice
+
+SDIR = .
+
+GDIR = generated
+
+include $(top_srcdir)/config/Make.rules.cs
+
+MCSFLAGS := $(MCSFLAGS) -target:exe
+
+SLICE2CSFLAGS := $(SLICE2CSFLAGS) -I.
+
+SUBDIRS = version1 version2
+
+$(EVERYTHING)::
+ @for subdir in $(SUBDIRS); \
+ do \
+ echo "making $@ in $$subdir"; \
+ ( cd $$subdir && $(MAKE) $@ ) || exit 1; \
+ done
+
+server.exe: $(S_SRCS) $(SGEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ $(call ref,Ice) $(subst /,$(DSEP),$^)
+
+clean::
+ rm -f generated/*
+
+include .depend
diff --git a/cs/test/Ice/versioning/Makefile.mak b/cs/test/Ice/versioning/Makefile.mak
new file mode 100644
index 0000000..aa8a034
--- /dev/null
+++ b/cs/test/Ice/versioning/Makefile.mak
@@ -0,0 +1,45 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..\..
+
+TARGETS = client.exe server.exe serveramd.exe
+
+C_SRCS = AllTests.cs Client.cs
+S_SRCS = Server.cs TestI.cs
+SAMD_SRCS = Server.cs TestAMDI.cs
+
+GEN_SRCS = $(GDIR)\Test.cs \
+ $(GDIR)\Forward.cs
+CGEN_SRCS = $(GDIR)\ClientPrivate.cs
+SGEN_SRCS = $(GDIR)\ServerPrivate.cs
+GEN_AMD_SRCS = $(GDIR)\TestAMD.cs \
+ $(GDIR)\Forward.cs
+SAMD_GEN_SRCS = $(GDIR)\ServerPrivateAMD.cs
+
+SDIR = .
+
+GDIR = generated
+
+!include $(top_srcdir)\config\Make.rules.mak.cs
+
+MCSFLAGS = $(MCSFLAGS) -target:exe
+
+SLICE2CSFLAGS = $(SLICE2CSFLAGS) -I.
+
+client.exe: $(C_SRCS) $(GEN_SRCS) $(CGEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(C_SRCS) $(GEN_SRCS) $(CGEN_SRCS)
+
+server.exe: $(S_SRCS) $(GEN_SRCS) $(SGEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(S_SRCS) $(GEN_SRCS) $(SGEN_SRCS)
+
+serveramd.exe: $(SAMD_SRCS) $(GEN_AMD_SRCS) $(SAMD_GEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ -r:"$(refdir)\Ice.dll" $(SAMD_SRCS) $(GEN_AMD_SRCS) $(SAMD_GEN_SRCS)
+
+!include .depend.mak
diff --git a/cs/test/Ice/versioning/Server.cs b/cs/test/Ice/versioning/Server.cs
new file mode 100644
index 0000000..cae7ea0
--- /dev/null
+++ b/cs/test/Ice/versioning/Server.cs
@@ -0,0 +1,65 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using System.Diagnostics;
+
+public class Server
+{
+ private static int run(string[] args, Ice.Communicator communicator)
+ {
+ Ice.Properties properties = communicator.getProperties();
+ properties.setProperty("Ice.Warn.Dispatch", "0");
+ properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
+ Ice.Object obj = new InitialI();
+ adapter.add(obj, communicator.stringToIdentity("initial"));
+ adapter.addFacet(new Version1I(), communicator.stringToIdentity("initial"), Test.Version1.InterfaceVersion.value);
+ adapter.addFacet(new Version2I(), communicator.stringToIdentity("initial"), Test.Version2.InterfaceVersion.value);
+ adapter.activate();
+ communicator.waitForShutdown();
+ return 0;
+ }
+
+ public static void Main(string[] args)
+ {
+ int status = 0;
+ Ice.Communicator communicator = null;
+
+ Debug.Listeners.Add(new ConsoleTraceListener());
+
+ try
+ {
+ communicator = Ice.Util.initialize(ref args);
+ status = run(args, communicator);
+ }
+ catch(System.Exception ex)
+ {
+ System.Console.Error.WriteLine(ex);
+ status = 1;
+ }
+
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ System.Console.Error.WriteLine(ex);
+ status = 1;
+ }
+ }
+
+ if(status != 0)
+ {
+ System.Environment.Exit(status);
+ }
+ }
+}
diff --git a/cs/test/Ice/versioning/Test.ice b/cs/test/Ice/versioning/Test.ice
new file mode 100644
index 0000000..cc2d10d
--- /dev/null
+++ b/cs/test/Ice/versioning/Test.ice
@@ -0,0 +1,59 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+#ifdef VERSION1
+ ["suppress"]
+#endif
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+#ifdef VERSION2
+ ["suppress"]
+#endif
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/cs/test/Ice/versioning/version1/.depend b/cs/test/Ice/versioning/version1/.depend
new file mode 100644
index 0000000..e69de29
diff --git a/cs/test/Ice/versioning/version1/.depend.mak b/cs/test/Ice/versioning/version1/.depend.mak
new file mode 100644
index 0000000..e69de29
diff --git a/cs/test/Ice/versioning/version1/AllTests.cs b/cs/test/Ice/versioning/version1/AllTests.cs
new file mode 100644
index 0000000..3e4d306
--- /dev/null
+++ b/cs/test/Ice/versioning/version1/AllTests.cs
@@ -0,0 +1,60 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Threading;
+using Test;
+
+public class AllTests
+{
+ private static void test(bool b)
+ {
+ if(!b)
+ {
+ throw new System.Exception();
+ }
+ }
+
+ public static InitialPrx allTests(Ice.Communicator communicator)
+ {
+ Console.Out.Write("testing stringToProxy... ");
+ Console.Out.Flush();
+ string r = "initial:default -p 12010 -t 2000";
+ Ice.ObjectPrx basePrx = communicator.stringToProxy(r);
+ test(basePrx != null);
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("testing checked cast... ");
+ Console.Out.Flush();
+ InitialPrx initialPrx = InitialPrxHelper.checkedCast(basePrx);
+ test(initialPrx != null);
+ test(initialPrx.Equals(basePrx));
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("testing accessing the facet... ");
+ Console.Out.Flush();
+ IAPrx prx = IAPrxHelper.checkedCast(initialPrx.ice_facet(InterfaceVersion.value));
+ test(prx != null);
+ test(prx.ice_id().Equals("::Test::Version1::IA"));
+ test(prx.ice_getFacet().Equals(InterfaceVersion.value));
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("testing correct type... ");
+ Console.Out.Flush();
+ CA p = prx.getCA();
+ test(p.ice_id().Equals("::Test::Version1::CA"));
+ test(p.message.Equals("version 1"));
+ test(p.flag.Equals("1"));
+ Console.Out.WriteLine("ok");
+
+ return initialPrx;
+ }
+}
diff --git a/cs/test/Ice/versioning/version1/Client.cs b/cs/test/Ice/versioning/version1/Client.cs
new file mode 100644
index 0000000..d13ba7d
--- /dev/null
+++ b/cs/test/Ice/versioning/version1/Client.cs
@@ -0,0 +1,58 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using Test;
+using System.Diagnostics;
+
+public class Client
+{
+ private static int run(string[] args, Ice.Communicator communicator)
+ {
+ InitialPrx test = AllTests.allTests(communicator);
+ test.shutdown();
+ return 0;
+ }
+
+ public static void Main(string[] args)
+ {
+ int status = 0;
+ Ice.Communicator communicator = null;
+
+ Debug.Listeners.Add(new ConsoleTraceListener());
+
+ try
+ {
+ communicator = Ice.Util.initialize(ref args);
+ status = run(args, communicator);
+ }
+ catch(System.Exception ex)
+ {
+ System.Console.Error.WriteLine(ex);
+ status = 1;
+ }
+
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ System.Console.Error.WriteLine(ex);
+ status = 1;
+ }
+ }
+
+ if(status != 0)
+ {
+ System.Environment.Exit(status);
+ }
+ }
+}
diff --git a/cs/test/Ice/versioning/version1/Makefile b/cs/test/Ice/versioning/version1/Makefile
new file mode 100644
index 0000000..adefd3e
--- /dev/null
+++ b/cs/test/Ice/versioning/version1/Makefile
@@ -0,0 +1,34 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ../../../..
+
+TARGETS = ../client1.exe
+
+SRCS = AllTests.cs Client.cs
+
+SLICE_SRCS = $(SDIR)/Test.ice
+
+SDIR = ..
+
+GDIR = generated
+
+include $(top_srcdir)/config/Make.rules.cs
+
+MCSFLAGS := $(MCSFLAGS) -target:exe
+
+SLICE2CSFLAGS := $(SLICE2CSFLAGS) -DVERSION1 -I. --suppress
+
+../client1.exe: $(SRCS) $(GEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ $(call ref,Ice) $(subst /,$(DSEP),$^)
+
+clean::
+ rm -f generated/*
+
+include .depend
diff --git a/cs/test/Ice/versioning/version2/.depend b/cs/test/Ice/versioning/version2/.depend
new file mode 100644
index 0000000..e69de29
diff --git a/cs/test/Ice/versioning/version2/.depend.mak b/cs/test/Ice/versioning/version2/.depend.mak
new file mode 100644
index 0000000..e69de29
diff --git a/cs/test/Ice/versioning/version2/AllTests.cs b/cs/test/Ice/versioning/version2/AllTests.cs
new file mode 100644
index 0000000..6b6c16d
--- /dev/null
+++ b/cs/test/Ice/versioning/version2/AllTests.cs
@@ -0,0 +1,60 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Threading;
+using Test;
+
+public class AllTests
+{
+ private static void test(bool b)
+ {
+ if(!b)
+ {
+ throw new System.Exception();
+ }
+ }
+
+ public static InitialPrx allTests(Ice.Communicator communicator)
+ {
+ Console.Out.Write("testing stringToProxy... ");
+ Console.Out.Flush();
+ string r = "initial:default -p 12010 -t 2000";
+ Ice.ObjectPrx basePrx = communicator.stringToProxy(r);
+ test(basePrx != null);
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("testing checked cast... ");
+ Console.Out.Flush();
+ InitialPrx initialPrx = InitialPrxHelper.checkedCast(basePrx);
+ test(initialPrx != null);
+ test(initialPrx.Equals(basePrx));
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("testing accessing the facet... ");
+ Console.Out.Flush();
+ IAPrx prx = IAPrxHelper.checkedCast(initialPrx.ice_facet(InterfaceVersion.value));
+ test(prx != null);
+ test(prx.ice_id().Equals("::Test::Version2::IA"));
+ test(prx.ice_getFacet().Equals(InterfaceVersion.value));
+ Console.Out.WriteLine("ok");
+
+ Console.Out.Write("testing correct type... ");
+ Console.Out.Flush();
+ CA p = prx.getCA();
+ test(p.ice_id().Equals("::Test::Version2::CA"));
+ test(p.message.Equals("version 1"));
+ test(p.flag.Equals("1"));
+ Console.Out.WriteLine("ok");
+
+ return initialPrx;
+ }
+}
diff --git a/cs/test/Ice/versioning/version2/Client.cs b/cs/test/Ice/versioning/version2/Client.cs
new file mode 100644
index 0000000..d13ba7d
--- /dev/null
+++ b/cs/test/Ice/versioning/version2/Client.cs
@@ -0,0 +1,58 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+using Test;
+using System.Diagnostics;
+
+public class Client
+{
+ private static int run(string[] args, Ice.Communicator communicator)
+ {
+ InitialPrx test = AllTests.allTests(communicator);
+ test.shutdown();
+ return 0;
+ }
+
+ public static void Main(string[] args)
+ {
+ int status = 0;
+ Ice.Communicator communicator = null;
+
+ Debug.Listeners.Add(new ConsoleTraceListener());
+
+ try
+ {
+ communicator = Ice.Util.initialize(ref args);
+ status = run(args, communicator);
+ }
+ catch(System.Exception ex)
+ {
+ System.Console.Error.WriteLine(ex);
+ status = 1;
+ }
+
+ if(communicator != null)
+ {
+ try
+ {
+ communicator.destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ System.Console.Error.WriteLine(ex);
+ status = 1;
+ }
+ }
+
+ if(status != 0)
+ {
+ System.Environment.Exit(status);
+ }
+ }
+}
diff --git a/cs/test/Ice/versioning/version2/Makefile b/cs/test/Ice/versioning/version2/Makefile
new file mode 100644
index 0000000..111e572
--- /dev/null
+++ b/cs/test/Ice/versioning/version2/Makefile
@@ -0,0 +1,34 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ../../../..
+
+TARGETS = ../client2.exe
+
+SRCS = AllTests.cs Client.cs
+
+SLICE_SRCS = $(SDIR)/Test.ice
+
+SDIR = ..
+
+GDIR = generated
+
+include $(top_srcdir)/config/Make.rules.cs
+
+MCSFLAGS := $(MCSFLAGS) -target:exe
+
+SLICE2CSFLAGS := $(SLICE2CSFLAGS) -DVERSION2 -I. --suppress
+
+../client2.exe: $(SRCS) $(GEN_SRCS)
+ $(MCS) $(MCSFLAGS) -out:$@ $(call ref,Ice) $(subst /,$(DSEP),$^)
+
+clean::
+ rm -f generated/*
+
+include .depend
diff --git a/java/src/Ice/MigrationProxy.java b/java/src/Ice/MigrationProxy.java
new file mode 100644
index 0000000..e753ce6
--- /dev/null
+++ b/java/src/Ice/MigrationProxy.java
@@ -0,0 +1,9 @@
+package Ice;
+
+public interface MigrationProxy
+{
+ public Object createCurrentVersion();
+
+ public Class<?> actualRuntimeClass()
+ throws ClassNotFoundException;
+};
diff --git a/java/test/Ice/versioning/Client1Private.ice b/java/test/Ice/versioning/Client1Private.ice
new file mode 100644
index 0000000..df33ee8
--- /dev/null
+++ b/java/test/Ice/versioning/Client1Private.ice
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.version1"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ ["suppress"]
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/java/test/Ice/versioning/Client2Private.ice b/java/test/Ice/versioning/Client2Private.ice
new file mode 100644
index 0000000..d226192
--- /dev/null
+++ b/java/test/Ice/versioning/Client2Private.ice
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.version2"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ ["suppress"]
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/java/test/Ice/versioning/InitialI.java b/java/test/Ice/versioning/InitialI.java
new file mode 100644
index 0000000..0a53735
--- /dev/null
+++ b/java/test/Ice/versioning/InitialI.java
@@ -0,0 +1,31 @@
+package test.Ice.versioning;
+
+public final class InitialI extends test.Ice.versioning.server.Test._InitialDisp
+{
+ public
+ InitialI()
+ {
+ }
+
+ public void
+ shutdown(Ice.Current current)
+ {
+ current.adapter.getCommunicator().shutdown();
+ }
+
+ static class Version1I extends test.Ice.versioning.server.Test.Version1._IADisp
+ {
+ public test.Ice.versioning.server.Test.Version1.CA getCA(Ice.Current current)
+ {
+ return new test.Ice.versioning.server.Test.Version1.CA("version 1", "1");
+ }
+ }
+
+ static class Version2I extends test.Ice.versioning.server.Test.Version2._IADisp
+ {
+ public test.Ice.versioning.server.Test.Version2.CA getCA(Ice.Current current)
+ {
+ return new test.Ice.versioning.server.Test.Version2.CA("version 2", 1);
+ }
+ }
+}
diff --git a/java/test/Ice/versioning/Server.java b/java/test/Ice/versioning/Server.java
new file mode 100644
index 0000000..1a20d6e
--- /dev/null
+++ b/java/test/Ice/versioning/Server.java
@@ -0,0 +1,45 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+package test.Ice.versioning;
+
+public class Server extends test.Util.Application
+{
+ public int run(String[] args)
+ {
+ Ice.Communicator communicator = communicator();
+ Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
+ Ice.Object object = new InitialI();
+ adapter.add(object, Ice.Util.stringToIdentity("initial"));
+ test.Ice.versioning.server.Test.Version1.IA ver1 = new InitialI.Version1I();
+ Ice.ObjectPrx obj = adapter.addFacet(ver1, Ice.Util.stringToIdentity("initial"), test.Ice.versioning.server.Test.Version1.InterfaceVersion.value);
+ test.Ice.versioning.server.Test.Version2.IA ver2 = new InitialI.Version2I();
+ obj = adapter.addFacet(ver2, Ice.Util.stringToIdentity("initial"), test.Ice.versioning.server.Test.Version2.InterfaceVersion.value);
+ adapter.activate();
+ return WAIT;
+ }
+
+ protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.Package.Test", "test.Ice.versioning.server");
+ initData.properties.setProperty("Ice.Warn.Dispatch", "0");
+ initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
+ return initData;
+ }
+
+ public static void main(String[] args)
+ {
+ Server app = new Server();
+ int result = app.main("Server", args);
+ System.gc();
+ System.exit(result);
+ }
+}
diff --git a/java/test/Ice/versioning/ServerPrivate.ice b/java/test/Ice/versioning/ServerPrivate.ice
new file mode 100644
index 0000000..ed4f978
--- /dev/null
+++ b/java/test/Ice/versioning/ServerPrivate.ice
@@ -0,0 +1,54 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.server"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/java/test/Ice/versioning/version1/AllTests.java b/java/test/Ice/versioning/version1/AllTests.java
new file mode 100644
index 0000000..9c134a0
--- /dev/null
+++ b/java/test/Ice/versioning/version1/AllTests.java
@@ -0,0 +1,59 @@
+package test.Ice.versioning.version1;
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+import test.Ice.versioning.version1.Test.CA;
+import test.Ice.versioning.version1.Test.CAHolder;
+import test.Ice.versioning.version1.Test.IA;
+import test.Ice.versioning.version1.Test.IAPrx;
+import test.Ice.versioning.version1.Test.IAPrxHelper;
+import test.Ice.versioning.version1.Test.Initial;
+import test.Ice.versioning.version1.Test.InitialPrx;
+import test.Ice.versioning.version1.Test.InitialPrxHelper;
+
+public class AllTests
+{
+ private static void
+ test(boolean b)
+ {
+ if(!b)
+ {
+ throw new RuntimeException();
+ }
+ }
+
+ public static InitialPrx
+ allTests(Ice.Communicator communicator, PrintWriter out)
+ {
+ out.print("testing stringToProxy... ");
+ out.flush();
+ String ref = "initial:default -p 12010";
+ Ice.ObjectPrx base = communicator.stringToProxy(ref);
+ test(base != null);
+ out.println("ok");
+
+ out.print("testing checked cast... ");
+ out.flush();
+ InitialPrx initial = InitialPrxHelper.checkedCast(base);
+ test(initial != null);
+ out.println("ok");
+
+ out.print("testing accessing the facet... ");
+ IAPrx prx = IAPrxHelper.checkedCast(initial.ice_facet(test.Ice.versioning.version1.Test.InterfaceVersion.value));
+ test(prx != null);
+ test(prx.ice_id().equals("::Test::Version1::IA"));
+ test(prx.ice_getFacet().equals(test.Ice.versioning.version1.Test.InterfaceVersion.value));
+ out.println("ok");
+
+ out.print("testing correct type... ");
+ out.flush();
+ CA p = prx.getCA();
+ test(p.ice_id().equals("::Test::Version1::CA"));
+ test(p.message.equals("version 1"));
+ test(p.flag.equals("1"));
+ out.println("ok");
+
+ return initial;
+ }
+}
diff --git a/java/test/Ice/versioning/version1/Client.java b/java/test/Ice/versioning/version1/Client.java
new file mode 100644
index 0000000..d26a500
--- /dev/null
+++ b/java/test/Ice/versioning/version1/Client.java
@@ -0,0 +1,41 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+package test.Ice.versioning.version1;
+
+import test.Ice.versioning.version1.Test.CA;
+import test.Ice.versioning.version1.Test.InitialPrx;
+import test.Ice.versioning.version1.Test.InitialPrxHelper;
+
+public class Client extends test.Util.Application
+{
+ public int run(String[] args)
+ {
+ Ice.Communicator communicator = communicator();
+ InitialPrx test = AllTests.allTests(communicator, getWriter());
+ test.shutdown();
+ return 0;
+ }
+
+ protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.Package.Test", "test.Ice.versioning.version1");
+ return initData;
+ }
+
+ public static void main(String[] args)
+ {
+ Client app = new Client();
+ int result = app.main("Client", args);
+ System.gc();
+ System.exit(result);
+ }
+}
diff --git a/java/test/Ice/versioning/version2/AllTests.java b/java/test/Ice/versioning/version2/AllTests.java
new file mode 100644
index 0000000..5be80fb
--- /dev/null
+++ b/java/test/Ice/versioning/version2/AllTests.java
@@ -0,0 +1,59 @@
+package test.Ice.versioning.version2;
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+import test.Ice.versioning.version2.Test.CA;
+import test.Ice.versioning.version2.Test.CAHolder;
+import test.Ice.versioning.version2.Test.IA;
+import test.Ice.versioning.version2.Test.IAPrx;
+import test.Ice.versioning.version2.Test.IAPrxHelper;
+import test.Ice.versioning.version2.Test.Initial;
+import test.Ice.versioning.version2.Test.InitialPrx;
+import test.Ice.versioning.version2.Test.InitialPrxHelper;
+
+public class AllTests
+{
+ private static void
+ test(boolean b)
+ {
+ if(!b)
+ {
+ throw new RuntimeException();
+ }
+ }
+
+ public static InitialPrx
+ allTests(Ice.Communicator communicator, PrintWriter out)
+ {
+ out.print("testing stringToProxy... ");
+ out.flush();
+ String ref = "initial:default -p 12010";
+ Ice.ObjectPrx base = communicator.stringToProxy(ref);
+ test(base != null);
+ out.println("ok");
+
+ out.print("testing checked cast... ");
+ out.flush();
+ InitialPrx initial = InitialPrxHelper.checkedCast(base);
+ test(initial != null);
+ out.println("ok");
+
+ out.print("testing accessing the facet... ");
+ IAPrx prx = IAPrxHelper.checkedCast(initial, test.Ice.versioning.version2.Test.InterfaceVersion.value);
+ test(prx != null);
+ test(prx.ice_id().equals("::Test::Version2::IA"));
+ test(prx.ice_getFacet().equals(test.Ice.versioning.version2.Test.InterfaceVersion.value));
+ out.println("ok");
+
+ out.print("testing correct type... ");
+ out.flush();
+ CA p = prx.getCA();
+ test(p.ice_id().equals("::Test::Version2::CA"));
+ test(p.message.equals("version 2"));
+ test(p.flag == 1);
+ out.println("ok");
+
+ return initial;
+ }
+}
diff --git a/java/test/Ice/versioning/version2/Client.java b/java/test/Ice/versioning/version2/Client.java
new file mode 100644
index 0000000..b63aca3
--- /dev/null
+++ b/java/test/Ice/versioning/version2/Client.java
@@ -0,0 +1,39 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+package test.Ice.versioning.version2;
+
+import test.Ice.versioning.version2.Test.*;
+
+public class Client extends test.Util.Application
+{
+ public int run(String[] args)
+ {
+ Ice.Communicator communicator = communicator();
+ InitialPrx test = AllTests.allTests(communicator, getWriter());
+ test.shutdown();
+ return 0;
+ }
+
+ protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
+ {
+ Ice.InitializationData initData = new Ice.InitializationData();
+ initData.properties = Ice.Util.createProperties(argsH);
+ initData.properties.setProperty("Ice.Package.Test", "test.Ice.versioning.version2");
+ return initData;
+ }
+
+ public static void main(String[] args)
+ {
+ Client app = new Client();
+ int result = app.main("Client", args);
+ System.gc();
+ System.exit(result);
+ }
+}
diff --git a/py/test/Ice/versioning/AllTests1.py b/py/test/Ice/versioning/AllTests1.py
new file mode 100644
index 0000000..4c5a49e
--- /dev/null
+++ b/py/test/Ice/versioning/AllTests1.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import Ice, sys, threading
+
+Ice.loadSlice('-I. --suppress --all Client1Private.ice')
+import Test
+
+def test(b):
+ if not b:
+ raise RuntimeError('test assertion failed')
+
+def allTests(communicator):
+ obj = communicator.stringToProxy("initial:default -p 12010")
+ t = Test.InitialPrx.checkedCast(obj)
+
+ print "testing checked cast... ",
+ try:
+ test(t)
+ test(t.ice_id() == "::Test::Initial")
+ except Ice.Exception:
+ test(False)
+ print "ok"
+
+ print "testing accessing the facet... ",
+ try:
+ o = Test.IAPrx.checkedCast(t.ice_facet(Test.InterfaceVersion))
+ test(o)
+ test(o.ice_id() == "::Test::Version1::IA")
+ except Ice.Exception:
+ test(False)
+ print "ok"
+
+ print "testing correct type... ",
+ try:
+ p = o.getCA()
+ test(p)
+ test(p.ice_id() == "::Test::Version1::CA")
+ test(p.message == "version 1")
+ test(p.flag == "1")
+ except Ice.Exception as e:
+ print e
+ test(False)
+ print "ok"
+
+ return t
diff --git a/py/test/Ice/versioning/AllTests2.py b/py/test/Ice/versioning/AllTests2.py
new file mode 100644
index 0000000..562deb4
--- /dev/null
+++ b/py/test/Ice/versioning/AllTests2.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import Ice, sys, threading
+
+Ice.loadSlice('-I. --suppress --all Client2Private.ice')
+import Test
+
+def test(b):
+ if not b:
+ raise RuntimeError('test assertion failed')
+
+def allTests(communicator):
+ obj = communicator.stringToProxy("initial:default -p 12010")
+ t = Test.InitialPrx.checkedCast(obj)
+
+ print "testing checked cast... ",
+ try:
+ test(t)
+ test(t.ice_id() == "::Test::Initial")
+ except Ice.Exception:
+ test(False)
+ print "ok"
+
+ print "testing accessing the facet... ",
+ try:
+ o = Test.IAPrx.checkedCast(t.ice_facet(Test.InterfaceVersion))
+ test(o)
+ test(o.ice_id() == "::Test::Version2::IA")
+ except Ice.Exception:
+ test(False)
+ print "ok"
+
+ print "testing correct type... ",
+ try:
+ p = o.getCA()
+ test(p)
+ test(p.ice_id() == "::Test::Version2::CA")
+ test(p.message == "version 2")
+ test(p.flag == 1)
+ except Ice.Exception:
+ test(False)
+ print "ok"
+
+ return t
diff --git a/py/test/Ice/versioning/Client1.py b/py/test/Ice/versioning/Client1.py
new file mode 100644
index 0000000..594bcd6
--- /dev/null
+++ b/py/test/Ice/versioning/Client1.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys, traceback
+
+import Ice, AllTests1
+
+def run(args, communicator):
+ Test = AllTests1.allTests(communicator)
+ Test.shutdown()
+ return True
+
+try:
+ communicator = Ice.initialize(sys.argv)
+ status = run(sys.argv, communicator)
+except:
+ traceback.print_exc()
+ status = False
+
+if communicator:
+ try:
+ communicator.destroy()
+ except:
+ traceback.print_exc()
+ status = False
+
+sys.exit(not status)
diff --git a/py/test/Ice/versioning/Client1Private.ice b/py/test/Ice/versioning/Client1Private.ice
new file mode 100644
index 0000000..df33ee8
--- /dev/null
+++ b/py/test/Ice/versioning/Client1Private.ice
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.version1"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ ["suppress"]
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/py/test/Ice/versioning/Client2.py b/py/test/Ice/versioning/Client2.py
new file mode 100644
index 0000000..5da944a
--- /dev/null
+++ b/py/test/Ice/versioning/Client2.py
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys, traceback
+
+import Ice, AllTests2
+
+def run(args, communicator):
+ Test = AllTests2.allTests(communicator)
+ Test.shutdown()
+ return True
+
+try:
+ communicator = Ice.initialize(sys.argv)
+ status = run(sys.argv, communicator)
+except:
+ traceback.print_exc()
+ status = False
+
+if communicator:
+ try:
+ communicator.destroy()
+ except:
+ traceback.print_exc()
+ status = False
+
+sys.exit(not status)
diff --git a/py/test/Ice/versioning/Client2Private.ice b/py/test/Ice/versioning/Client2Private.ice
new file mode 100644
index 0000000..d226192
--- /dev/null
+++ b/py/test/Ice/versioning/Client2Private.ice
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.version2"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ ["suppress"]
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/py/test/Ice/versioning/Server.py b/py/test/Ice/versioning/Server.py
new file mode 100644
index 0000000..97a3004
--- /dev/null
+++ b/py/test/Ice/versioning/Server.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys, traceback
+
+import Ice
+Ice.loadSlice('-I. --all ServerPrivate.ice')
+import Test
+
+class TestI(Test.Initial):
+ def shutdown(self, current=None):
+ current.adapter.getCommunicator().shutdown()
+
+class Version1I(Test.Version1.IA):
+ def getCA(self, current=None):
+ result = Test.Version1.CA()
+ result.message = "version 1"
+ result.flag = "1"
+ return result
+
+class Version2I(Test.Version2.IA):
+ def getCA(self, current=None):
+ result = Test.Version2.CA()
+ result.message = "version 2"
+ result.flag = 1
+ return result
+
+def run(args, communicator):
+ properties = communicator.getProperties()
+ properties.setProperty("Ice.Warn.Dispatch", "0")
+ properties.setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000")
+ adapter = communicator.createObjectAdapter("TestAdapter")
+ object = TestI()
+ adapter.add(object, communicator.stringToIdentity("initial"))
+ adapter.addFacet(Version1I(), communicator.stringToIdentity("initial"), Test.Version1.InterfaceVersion)
+ adapter.addFacet(Version2I(), communicator.stringToIdentity("initial"), Test.Version2.InterfaceVersion)
+ adapter.activate()
+ communicator.waitForShutdown()
+ return True
+
+try:
+ communicator = Ice.initialize(sys.argv)
+ status = run(sys.argv, communicator)
+except:
+ traceback.print_exc()
+ status = False
+
+if communicator:
+ try:
+ communicator.destroy()
+ except:
+ traceback.print_exc()
+ status = False
+
+sys.exit(not status)
diff --git a/py/test/Ice/versioning/ServerPrivate.ice b/py/test/Ice/versioning/ServerPrivate.ice
new file mode 100644
index 0000000..ed4f978
--- /dev/null
+++ b/py/test/Ice/versioning/ServerPrivate.ice
@@ -0,0 +1,54 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.server"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/rb/test/Ice/versioning/AllTests1.rb b/rb/test/Ice/versioning/AllTests1.rb
new file mode 100644
index 0000000..1e72244
--- /dev/null
+++ b/rb/test/Ice/versioning/AllTests1.rb
@@ -0,0 +1,60 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+require 'Ice'
+Ice::loadSlice('-I. --all --suppress Client1Private.ice')
+
+def test(b)
+ if !b
+ raise RuntimeError, 'test assertion failed'
+ end
+end
+
+def allTests(communicator)
+ print "testing checked cast... "
+ STDOUT.flush
+ obj = communicator.stringToProxy("initial:default -p 12010")
+ t = Test::InitialPrx::checkedCast(obj)
+ begin
+ test(t)
+ test(t.ice_id() == "::Test::Initial")
+ rescue Ice::Exception
+ puts $!.inspect
+ test(false)
+ end
+ puts "ok"
+
+ print "testing accessing the facet... "
+ STDOUT.flush
+ begin
+ o = Test::IAPrx::checkedCast(t.ice_facet(Test::InterfaceVersion))
+ test(o)
+ test(o.ice_id() == "::Test::Version1::IA")
+ rescue Ice::Exception
+ puts $!.inspect
+ test(false)
+ end
+ puts "ok"
+
+ print "testing correct type... "
+ STDOUT.flush
+ begin
+ p = o.getCA()
+ test(p)
+ test(p.ice_id() == "::Test::Version1::CA")
+ test(p.message == "version 1")
+ test(p.flag == "1")
+ rescue Ice::Exception
+ puts $!.inspect
+ test(false)
+ end
+ puts "ok"
+
+ return t
+end
diff --git a/rb/test/Ice/versioning/AllTests2.rb b/rb/test/Ice/versioning/AllTests2.rb
new file mode 100644
index 0000000..cd31566
--- /dev/null
+++ b/rb/test/Ice/versioning/AllTests2.rb
@@ -0,0 +1,60 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+require 'Ice'
+Ice::loadSlice('-I. --all --suppress Client2Private.ice')
+
+def test(b)
+ if !b
+ raise RuntimeError, 'test assertion failed'
+ end
+end
+
+def allTests(communicator)
+ print "testing checked cast... "
+ STDOUT.flush
+ obj = communicator.stringToProxy("initial:default -p 12010")
+ t = Test::InitialPrx::checkedCast(obj)
+ begin
+ test(t)
+ test(t.ice_id() == "::Test::Initial")
+ rescue Ice::Exception
+ puts $!.inspect
+ test(false)
+ end
+ puts "ok"
+
+ print "testing accessing the facet... "
+ STDOUT.flush
+ begin
+ o = Test::IAPrx::checkedCast(t.ice_facet(Test::InterfaceVersion))
+ test(o)
+ test(o.ice_id() == "::Test::Version2::IA")
+ rescue Ice::Exception
+ puts $!.inspect
+ test(false)
+ end
+ puts "ok"
+
+ print "testing correct type... "
+ STDOUT.flush
+ begin
+ p = o.getCA()
+ test(p)
+ test(p.ice_id() == "::Test::Version2::CA")
+ test(p.message == "version 2")
+ test(p.flag == 1)
+ rescue Ice::Exception
+ puts $!.inspect
+ test(false)
+ end
+ puts "ok"
+
+ return t
+end
diff --git a/rb/test/Ice/versioning/Client1.rb b/rb/test/Ice/versioning/Client1.rb
new file mode 100644
index 0000000..78aec4b
--- /dev/null
+++ b/rb/test/Ice/versioning/Client1.rb
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+require 'pathname'
+require 'AllTests1'
+
+def run(args, communicator)
+ t = allTests(communicator)
+ t.shutdown()
+ return true
+end
+
+begin
+ communicator = Ice.initialize(ARGV)
+ status = run(ARGV, communicator)
+rescue => ex
+ puts $!
+ print ex.backtrace.join("\n")
+ status = false
+end
+
+if communicator
+ begin
+ communicator.destroy()
+ rescue => ex
+ puts $!
+ print ex.backtrace.join("\n")
+ status = false
+ end
+end
+
+exit(status ? 0 : 1)
diff --git a/rb/test/Ice/versioning/Client1Private.ice b/rb/test/Ice/versioning/Client1Private.ice
new file mode 100644
index 0000000..df33ee8
--- /dev/null
+++ b/rb/test/Ice/versioning/Client1Private.ice
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.version1"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ ["suppress"]
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
diff --git a/rb/test/Ice/versioning/Client1Private.rb b/rb/test/Ice/versioning/Client1Private.rb
new file mode 100644
index 0000000..702043a
--- /dev/null
+++ b/rb/test/Ice/versioning/Client1Private.rb
@@ -0,0 +1,328 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+# Ice version 3.4.0
+
+# <auto-generated>
+#
+# Generated from file `Client1Private.ice'
+#
+# Warning: do not edit this file.
+#
+# </auto-generated>
+
+require 'Ice'
+
+module Test
+
+ if not defined?(::Test::Initial_mixin)
+ module Initial_mixin
+ include ::Ice::Object_mixin
+
+ def ice_ids(current=nil)
+ ['::Ice::Object', '::Test::Initial']
+ end
+
+ def ice_id(current=nil)
+ '::Test::Initial'
+ end
+
+ #
+ # Operation signatures.
+ #
+ # def shutdown(current=nil)
+
+ def inspect
+ ::Ice::__stringify(self, T_Initial)
+ end
+ end
+ class Initial
+ include Initial_mixin
+
+ def Initial.ice_staticId()
+ '::Test::Initial'
+ end
+ end
+ module InitialPrx_mixin
+
+ def shutdown(_ctx=nil)
+ Initial_mixin::OP_shutdown.invoke(self, [], _ctx)
+ end
+ end
+ class InitialPrx < ::Ice::ObjectPrx
+ include InitialPrx_mixin
+
+ def InitialPrx.checkedCast(proxy, facetOrCtx=nil, _ctx=nil)
+ ice_checkedCast(proxy, '::Test::Initial', facetOrCtx, _ctx)
+ end
+
+ def InitialPrx.uncheckedCast(proxy, facet=nil)
+ ice_uncheckedCast(proxy, facet)
+ end
+ end
+
+ if not defined?(::Test::T_Initial)
+ T_Initial = ::Ice::__declareClass('::Test::Initial')
+ T_InitialPrx = ::Ice::__declareProxy('::Test::Initial')
+ end
+
+ T_Initial.defineClass(Initial, true, nil, [], [])
+ Initial_mixin::ICE_TYPE = T_Initial
+
+ T_InitialPrx.defineProxy(InitialPrx, T_Initial)
+ InitialPrx::ICE_TYPE = T_InitialPrx
+
+ Initial_mixin::OP_shutdown = ::Ice::__defineOperation('shutdown', ::Ice::OperationMode::Normal, ::Ice::OperationMode::Normal, false, [], [], nil, [])
+ end
+
+ InterfaceVersion = "V1"
+
+ if not defined?(::Test::CA_mixin)
+ module CA_mixin
+ include ::Ice::Object_mixin
+
+ def ice_ids(current=nil)
+ ['::Ice::Object', '::Test::Version1::CA']
+ end
+
+ def ice_id(current=nil)
+ '::Test::Version1::CA'
+ end
+
+ def inspect
+ ::Ice::__stringify(self, T_CA)
+ end
+
+ attr_accessor :message, :flag
+ end
+ class CA
+ include CA_mixin
+
+ def CA.ice_staticId()
+ '::Test::Version1::CA'
+ end
+
+ def initialize(message='', flag='')
+ @message = message
+ @flag = flag
+ end
+ end
+ module CAPrx_mixin
+ end
+ class CAPrx < ::Ice::ObjectPrx
+ include CAPrx_mixin
+
+ def CAPrx.checkedCast(proxy, facetOrCtx=nil, _ctx=nil)
+ ice_checkedCast(proxy, '::Test::Version1::CA', facetOrCtx, _ctx)
+ end
+
+ def CAPrx.uncheckedCast(proxy, facet=nil)
+ ice_uncheckedCast(proxy, facet)
+ end
+ end
+
+ if not defined?(::Test::T_CA)
+ T_CA = ::Ice::__declareClass('::Test::Version1::CA')
+ T_CAPrx = ::Ice::__declareProxy('::Test::Version1::CA')
+ end
+
+ T_CA.defineClass(CA, false, nil, [], [
+ ['message', ::Ice::T_string],
+ ['flag', ::Ice::T_string]
+ ])
+ CA_mixin::ICE_TYPE = T_CA
+
+ T_CAPrx.defineProxy(CAPrx, T_CA)
+ CAPrx::ICE_TYPE = T_CAPrx
+ end
+
+ if not defined?(::Test::IA_mixin)
+ module IA_mixin
+ include ::Ice::Object_mixin
+
+ def ice_ids(current=nil)
+ ['::Ice::Object', '::Test::Version1::IA']
+ end
+
+ def ice_id(current=nil)
+ '::Test::Version1::IA'
+ end
+
+ #
+ # Operation signatures.
+ #
+ # def getCA(current=nil)
+
+ def inspect
+ ::Ice::__stringify(self, T_IA)
+ end
+ end
+ class IA
+ include IA_mixin
+
+ def IA.ice_staticId()
+ '::Test::Version1::IA'
+ end
+ end
+ module IAPrx_mixin
+
+ def getCA(_ctx=nil)
+ IA_mixin::OP_getCA.invoke(self, [], _ctx)
+ end
+ end
+ class IAPrx < ::Ice::ObjectPrx
+ include IAPrx_mixin
+
+ def IAPrx.checkedCast(proxy, facetOrCtx=nil, _ctx=nil)
+ ice_checkedCast(proxy, '::Test::Version1::IA', facetOrCtx, _ctx)
+ end
+
+ def IAPrx.uncheckedCast(proxy, facet=nil)
+ ice_uncheckedCast(proxy, facet)
+ end
+ end
+
+ if not defined?(::Test::T_IA)
+ T_IA = ::Ice::__declareClass('::Test::Version1::IA')
+ T_IAPrx = ::Ice::__declareProxy('::Test::Version1::IA')
+ end
+
+ T_IA.defineClass(IA, true, nil, [], [])
+ IA_mixin::ICE_TYPE = T_IA
+
+ T_IAPrx.defineProxy(IAPrx, T_IA)
+ IAPrx::ICE_TYPE = T_IAPrx
+
+ IA_mixin::OP_getCA = ::Ice::__defineOperation('getCA', ::Ice::OperationMode::Normal, ::Ice::OperationMode::Normal, false, [], [], ::Test::T_CA, [])
+ end
+
+ module Version2
+
+ InterfaceVersion = "V2"
+
+ if not defined?(::Test::Version2::CA_mixin)
+ module CA_mixin
+ include ::Ice::Object_mixin
+
+ def ice_ids(current=nil)
+ ['::Ice::Object', '::Test::Version2::CA']
+ end
+
+ def ice_id(current=nil)
+ '::Test::Version2::CA'
+ end
+
+ def inspect
+ ::Ice::__stringify(self, T_CA)
+ end
+
+ attr_accessor :message, :flag
+ end
+ class CA
+ include CA_mixin
+
+ def CA.ice_staticId()
+ '::Test::Version2::CA'
+ end
+
+ def initialize(message='', flag=0)
+ @message = message
+ @flag = flag
+ end
+ end
+ module CAPrx_mixin
+ end
+ class CAPrx < ::Ice::ObjectPrx
+ include CAPrx_mixin
+
+ def CAPrx.checkedCast(proxy, facetOrCtx=nil, _ctx=nil)
+ ice_checkedCast(proxy, '::Test::Version2::CA', facetOrCtx, _ctx)
+ end
+
+ def CAPrx.uncheckedCast(proxy, facet=nil)
+ ice_uncheckedCast(proxy, facet)
+ end
+ end
+
+ if not defined?(::Test::Version2::T_CA)
+ T_CA = ::Ice::__declareClass('::Test::Version2::CA')
+ T_CAPrx = ::Ice::__declareProxy('::Test::Version2::CA')
+ end
+
+ T_CA.defineClass(CA, false, nil, [], [
+ ['message', ::Ice::T_string],
+ ['flag', ::Ice::T_int]
+ ])
+ CA_mixin::ICE_TYPE = T_CA
+
+ T_CAPrx.defineProxy(CAPrx, T_CA)
+ CAPrx::ICE_TYPE = T_CAPrx
+ end
+
+ if not defined?(::Test::Version2::IA_mixin)
+ module IA_mixin
+ include ::Ice::Object_mixin
+
+ def ice_ids(current=nil)
+ ['::Ice::Object', '::Test::Version2::IA']
+ end
+
+ def ice_id(current=nil)
+ '::Test::Version2::IA'
+ end
+
+ #
+ # Operation signatures.
+ #
+ # def getCA(current=nil)
+
+ def inspect
+ ::Ice::__stringify(self, T_IA)
+ end
+ end
+ class IA
+ include IA_mixin
+
+ def IA.ice_staticId()
+ '::Test::Version2::IA'
+ end
+ end
+ module IAPrx_mixin
+
+ def getCA(_ctx=nil)
+ IA_mixin::OP_getCA.invoke(self, [], _ctx)
+ end
+ end
+ class IAPrx < ::Ice::ObjectPrx
+ include IAPrx_mixin
+
+ def IAPrx.checkedCast(proxy, facetOrCtx=nil, _ctx=nil)
+ ice_checkedCast(proxy, '::Test::Version2::IA', facetOrCtx, _ctx)
+ end
+
+ def IAPrx.uncheckedCast(proxy, facet=nil)
+ ice_uncheckedCast(proxy, facet)
+ end
+ end
+
+ if not defined?(::Test::Version2::T_IA)
+ T_IA = ::Ice::__declareClass('::Test::Version2::IA')
+ T_IAPrx = ::Ice::__declareProxy('::Test::Version2::IA')
+ end
+
+ T_IA.defineClass(IA, true, nil, [], [])
+ IA_mixin::ICE_TYPE = T_IA
+
+ T_IAPrx.defineProxy(IAPrx, T_IA)
+ IAPrx::ICE_TYPE = T_IAPrx
+
+ IA_mixin::OP_getCA = ::Ice::__defineOperation('getCA', ::Ice::OperationMode::Normal, ::Ice::OperationMode::Normal, false, [], [], ::Test::Version2::T_CA, [])
+ end
+ end
+end
diff --git a/rb/test/Ice/versioning/Client2.rb b/rb/test/Ice/versioning/Client2.rb
new file mode 100644
index 0000000..5549119
--- /dev/null
+++ b/rb/test/Ice/versioning/Client2.rb
@@ -0,0 +1,39 @@
+#!/usr/bin/env ruby
+# **********************************************************************
+#
+# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+require 'pathname'
+require 'AllTests2'
+
+def run(args, communicator)
+ t = allTests(communicator)
+ t.shutdown()
+ return true
+end
+
+begin
+ communicator = Ice.initialize(ARGV)
+ status = run(ARGV, communicator)
+rescue => ex
+ puts $!
+ print ex.backtrace.join("\n")
+ status = false
+end
+
+if communicator
+ begin
+ communicator.destroy()
+ rescue => ex
+ puts $!
+ print ex.backtrace.join("\n")
+ status = false
+ end
+end
+
+exit(status ? 0 : 1)
diff --git a/rb/test/Ice/versioning/Client2Private.ice b/rb/test/Ice/versioning/Client2Private.ice
new file mode 100644
index 0000000..d226192
--- /dev/null
+++ b/rb/test/Ice/versioning/Client2Private.ice
@@ -0,0 +1,55 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#ifndef TEST_ICE
+#define TEST_ICE
+
+[["java:package:test.Ice.versioning.version2"]]
+module Test
+{
+ interface Initial
+ {
+ void shutdown();
+ };
+
+ module Version1
+ {
+ const string InterfaceVersion = "V1";
+
+ class CA
+ {
+ string message;
+ string flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+
+ ["suppress"]
+ module Version2
+ {
+ const string InterfaceVersion = "V2";
+
+ class CA
+ {
+ string message;
+ int flag;
+ };
+
+ interface IA
+ {
+ CA getCA();
+ };
+ };
+};
+
+#endif
-----------------------------------------------------------------------
--
hydra/ice
More information about the asterisk-scf-commits
mailing list