[asterisk-scf-commits] asterisk-scf/integration/ice.git branch "slice-plugins" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Mar 10 08:08:17 CST 2011


branch "slice-plugins" has been updated
       via  2942fcd1c8f1ef81687bbb7b3b629fb1a79695f7 (commit)
      from  41d3fa3712219453bec3a430f05d3d2dc1869b76 (commit)

Summary of changes:
 cpp/include/Slice/Plugin.h        |    4 ++-
 cpp/src/Slice/.depend             |    5 ++-
 cpp/src/Slice/.depend.mak         |    5 ++-
 cpp/src/Slice/Makefile            |    3 +-
 cpp/src/Slice/Makefile.mak        |    3 +-
 cpp/src/Slice/Plugin.cpp          |   49 +++++++++++++++++++++++++++++++++++++
 cpp/src/Slice/PythonUtil.cpp      |   27 +-------------------
 cpp/src/Slice/RubyUtil.cpp        |   27 +-------------------
 cpp/src/slice2cpp/.depend         |    2 +-
 cpp/src/slice2cpp/.depend.mak     |    2 +-
 cpp/src/slice2cpp/Gen.cpp         |   27 +-------------------
 cpp/src/slice2cs/.depend          |    2 +-
 cpp/src/slice2cs/.depend.mak      |    2 +-
 cpp/src/slice2cs/Gen.cpp          |   27 +-------------------
 cpp/src/slice2freeze/.depend      |    2 +-
 cpp/src/slice2freeze/.depend.mak  |    2 +-
 cpp/src/slice2freeze/Main.cpp     |   27 +-------------------
 cpp/src/slice2freezej/.depend     |    2 +-
 cpp/src/slice2freezej/.depend.mak |    2 +-
 cpp/src/slice2freezej/Main.cpp    |   27 +-------------------
 cpp/src/slice2java/.depend        |    2 +-
 cpp/src/slice2java/.depend.mak    |    2 +-
 cpp/src/slice2java/Gen.cpp        |   27 +-------------------
 cpp/src/slice2php/.depend         |    2 +-
 cpp/src/slice2php/.depend.mak     |    2 +-
 cpp/src/slice2php/Main.cpp        |   27 +-------------------
 26 files changed, 82 insertions(+), 227 deletions(-)
 create mode 100644 cpp/src/Slice/Plugin.cpp


- Log -----------------------------------------------------------------
commit 2942fcd1c8f1ef81687bbb7b3b629fb1a79695f7
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Mar 10 08:07:37 2011 -0600

    Move common plugin visitor application code to the Slice library.

diff --git a/cpp/include/Slice/Plugin.h b/cpp/include/Slice/Plugin.h
index 7649d90..b47ba3a 100644
--- a/cpp/include/Slice/Plugin.h
+++ b/cpp/include/Slice/Plugin.h
@@ -21,7 +21,9 @@ namespace Plugin
 
     typedef std::list<ParserVisitor *> VisitorList;
 
-    typedef VisitorList* (*FACTORY)(Plugin::Language);
+    typedef VisitorList* (*FACTORY)(Language);
+
+    void applyPluginsToUnit(const std::vector<std::string>&, Language, const UnitPtr&);
 
 }
 
diff --git a/cpp/src/Slice/.depend b/cpp/src/Slice/.depend
index 0b7c1e9..f0190af 100644
--- a/cpp/src/Slice/.depend
+++ b/cpp/src/Slice/.depend
@@ -6,11 +6,12 @@ CsUtil$(OBJEXT): CsUtil.cpp $(includedir)/Slice/CsUtil.h $(includedir)/Slice/Par
 JavaUtil$(OBJEXT): JavaUtil.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/Slice/JavaUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/Functional.h
 Preprocessor$(OBJEXT): Preprocessor.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/Slice/Preprocessor.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Slice/Util.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/IceUtil/StringUtil.h $(includedir)/IceUtil/FileUtil.h $(includedir)/IceUtil/UUID.h $(includedir)/IceUtil/Unicode.h
 Checksum$(OBJEXT): Checksum.cpp $(includedir)/Slice/Checksum.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h ../Slice/MD5.h
-PythonUtil$(OBJEXT): PythonUtil.cpp $(includedir)/Slice/PythonUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/IceUtil.h $(includedir)/IceUtil/AbstractMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Cache.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/CountDownLatch.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/IceUtil/RWRecMutex.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/UUID.h $(includedir)/IceUtil/Unicode.h $(includedir)/IceUtil/StringUtil.h $(includedir)/IceUtil/InputUtil.h
+PythonUtil$(OBJEXT): PythonUtil.cpp $(includedir)/Slice/PythonUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Util.h $(includedir)/Slice/Plugin.h $(includedir)/IceUtil/IceUtil.h $(includedir)/IceUtil/AbstractMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Cache.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/CountDownLatch.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/IceUtil/RWRecMutex.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/UUID.h $(includedir)/IceUtil/Unicode.h $(includedir)/IceUtil/StringUtil.h $(includedir)/IceUtil/InputUtil.h
 DotNetNames$(OBJEXT): DotNetNames.cpp $(includedir)/Slice/DotNetNames.h
-RubyUtil$(OBJEXT): RubyUtil.cpp $(includedir)/Slice/RubyUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/InputUtil.h
+RubyUtil$(OBJEXT): RubyUtil.cpp $(includedir)/Slice/RubyUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Util.h $(includedir)/Slice/Plugin.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/InputUtil.h
 PHPUtil$(OBJEXT): PHPUtil.cpp $(includedir)/Slice/PHPUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h
 Util$(OBJEXT): Util.cpp $(includedir)/Slice/Util.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/IceUtil/Unicode.h $(includedir)/IceUtil/FileUtil.h $(includedir)/IceUtil/StringUtil.h
 FileTracker$(OBJEXT): FileTracker.cpp $(includedir)/Slice/FileTracker.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h
 MD5$(OBJEXT): MD5.cpp ../Slice/MD5.h $(includedir)/IceUtil/Config.h ../Slice/MD5I.h
 MD5I$(OBJEXT): MD5I.cpp ../Slice/MD5I.h
+Plugin$(OBJEXT): Plugin.cpp $(includedir)/Slice/Plugin.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/DynamicLibrary.h $(includedir)/IceUtil/DynamicLibraryF.h $(includedir)/Ice/Handle.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h
diff --git a/cpp/src/Slice/.depend.mak b/cpp/src/Slice/.depend.mak
index f0ca13e..8332928 100644
--- a/cpp/src/Slice/.depend.mak
+++ b/cpp/src/Slice/.depend.mak
@@ -6,11 +6,12 @@ CsUtil$(OBJEXT): CsUtil.cpp "$(includedir)/Slice/CsUtil.h" "$(includedir)/Slice/
 JavaUtil$(OBJEXT): JavaUtil.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/Slice/JavaUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/Functional.h"
 Preprocessor$(OBJEXT): Preprocessor.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/IceUtil/StringUtil.h" "$(includedir)/IceUtil/FileUtil.h" "$(includedir)/IceUtil/UUID.h" "$(includedir)/IceUtil/Unicode.h"
 Checksum$(OBJEXT): Checksum.cpp "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" ../Slice/MD5.h
-PythonUtil$(OBJEXT): PythonUtil.cpp "$(includedir)/Slice/PythonUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/IceUtil.h" "$(includedir)/IceUtil/AbstractMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/Cache.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/CountDownLatch.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/IceUtil/RWRecMutex.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/StaticMutex.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/UUID.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/IceUtil/StringUtil.h" "$(includedir)/IceUtil/InputUtil.h"
+PythonUtil$(OBJEXT): PythonUtil.cpp "$(includedir)/Slice/PythonUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Plugin.h" "$(includedir)/IceUtil/IceUtil.h" "$(includedir)/IceUtil/AbstractMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/Cache.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/CountDownLatch.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/IceUtil/RWRecMutex.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/StaticMutex.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/UUID.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/IceUtil/StringUtil.h" "$(includedir)/IceUtil/InputUtil.h"
 DotNetNames$(OBJEXT): DotNetNames.cpp "$(includedir)/Slice/DotNetNames.h"
-RubyUtil$(OBJEXT): RubyUtil.cpp "$(includedir)/Slice/RubyUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/InputUtil.h"
+RubyUtil$(OBJEXT): RubyUtil.cpp "$(includedir)/Slice/RubyUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Plugin.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/InputUtil.h"
 PHPUtil$(OBJEXT): PHPUtil.cpp "$(includedir)/Slice/PHPUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h"
 Util$(OBJEXT): Util.cpp "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/IceUtil/FileUtil.h" "$(includedir)/IceUtil/StringUtil.h"
 FileTracker$(OBJEXT): FileTracker.cpp "$(includedir)/Slice/FileTracker.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h"
 MD5$(OBJEXT): MD5.cpp ../Slice/MD5.h "$(includedir)/IceUtil/Config.h" ../Slice/MD5I.h
 MD5I$(OBJEXT): MD5I.cpp ../Slice/MD5I.h
+Plugin$(OBJEXT): Plugin.cpp "$(includedir)/Slice/Plugin.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/DynamicLibrary.h" "$(includedir)/IceUtil/DynamicLibraryF.h" "$(includedir)/Ice/Handle.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h"
diff --git a/cpp/src/Slice/Makefile b/cpp/src/Slice/Makefile
index d6a010c..5d92678 100644
--- a/cpp/src/Slice/Makefile
+++ b/cpp/src/Slice/Makefile
@@ -30,7 +30,8 @@ OBJS		= Scanner.o \
 		  Util.o \
 		  FileTracker.o \
 		  MD5.o \
-		  MD5I.o
+		  MD5I.o \
+		  Plugin.o
 
 SRCS		= $(OBJS:.o=.cpp)
 
diff --git a/cpp/src/Slice/Makefile.mak b/cpp/src/Slice/Makefile.mak
index b370fb1..011ded1 100644
--- a/cpp/src/Slice/Makefile.mak
+++ b/cpp/src/Slice/Makefile.mak
@@ -29,7 +29,8 @@ OBJS		= Scanner.obj \
 		  Util.obj \
 		  FileTracker.obj \
 		  MD5.obj \
-		  MD5I.obj
+		  MD5I.obj \
+		  Plugin.obj
 
 SRCS		= $(OBJS:.obj=.cpp)
 
diff --git a/cpp/src/Slice/Plugin.cpp b/cpp/src/Slice/Plugin.cpp
new file mode 100644
index 0000000..8e8cb12
--- /dev/null
+++ b/cpp/src/Slice/Plugin.cpp
@@ -0,0 +1,49 @@
+// **********************************************************************
+//
+// 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 <Slice/Plugin.h>
+#include <IceUtil/DynamicLibrary.h>
+
+using namespace std;
+using namespace Slice;
+
+namespace Slice
+{
+
+void
+Plugin::applyPluginsToUnit(const std::vector<std::string>& plugins, Language lang, const UnitPtr& unit)
+{
+    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
+    {
+        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
+        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
+        if(sym == 0)
+        {
+            string msg = library->getErrorMessage();
+            cerr << "Unable to find " << *plugin << " = " << msg << endl;
+            continue;
+        }
+        
+        Plugin::VisitorList* pluginVisitors;
+        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
+        pluginVisitors = factory(lang);
+        
+        if(pluginVisitors)
+        {
+            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
+            {
+                unit->visit(*it, true);
+                delete *it;
+            }
+            delete pluginVisitors;
+        }
+    }
+}
+
+}
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index b45a20e..5bbab00 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -14,7 +14,6 @@
 #include <IceUtil/IceUtil.h>
 #include <IceUtil/StringUtil.h>
 #include <IceUtil/InputUtil.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <climits>
 #include <iterator>
 
@@ -2246,31 +2245,7 @@ Slice::Python::generate(const UnitPtr& un, bool all, bool checksum, const vector
     Slice::Python::MetaDataVisitor visitor;
     un->visit(&visitor, false);
 
-    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguagePython);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                un->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(plugins, Plugin::LanguagePython, un);
 
     out << nl << "import Ice, IcePy, __builtin__";
 
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index 5f97cfb..b93d046 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -13,7 +13,6 @@
 #include <Slice/Plugin.h>
 #include <IceUtil/Functional.h>
 #include <IceUtil/InputUtil.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <iterator>
 
 using namespace std;
@@ -1636,31 +1635,7 @@ Slice::Ruby::generate(const UnitPtr& un, bool all, bool checksum,
                       Output& out,
                       const vector<string>& plugins)
 {
-    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguageRuby);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                un->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(plugins, Plugin::LanguageRuby, un);
 
     out << nl << "require 'Ice'";
 
diff --git a/cpp/src/slice2cpp/.depend b/cpp/src/slice2cpp/.depend
index 9ac6f06..e657c15 100644
--- a/cpp/src/slice2cpp/.depend
+++ b/cpp/src/slice2cpp/.depend
@@ -1,2 +1,2 @@
-Gen$(OBJEXT): Gen.cpp $(includedir)/IceUtil/DisableWarnings.h Gen.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Util.h $(includedir)/Slice/CPlusPlusUtil.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Iterator.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/FileTracker.h
+Gen$(OBJEXT): Gen.cpp $(includedir)/IceUtil/DisableWarnings.h Gen.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Util.h $(includedir)/Slice/CPlusPlusUtil.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Iterator.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Plugin.h
 Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Parser.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/OutputUtil.h Gen.h
diff --git a/cpp/src/slice2cpp/.depend.mak b/cpp/src/slice2cpp/.depend.mak
index 595c481..ba80226 100644
--- a/cpp/src/slice2cpp/.depend.mak
+++ b/cpp/src/slice2cpp/.depend.mak
@@ -1,2 +1,2 @@
-Gen$(OBJEXT): Gen.cpp "$(includedir)/IceUtil/DisableWarnings.h" Gen.h "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/CPlusPlusUtil.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/FileTracker.h"
+Gen$(OBJEXT): Gen.cpp "$(includedir)/IceUtil/DisableWarnings.h" Gen.h "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/CPlusPlusUtil.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Plugin.h"
 Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Parser.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/OutputUtil.h" Gen.h
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 14b6cf1..6e9c577 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -8,7 +8,6 @@
 // **********************************************************************
 
 #include <IceUtil/DisableWarnings.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <Gen.h>
 #include <Slice/Util.h>
 #include <Slice/CPlusPlusUtil.h>
@@ -175,31 +174,7 @@ Slice::Gen::generate(const UnitPtr& p)
 {
     string file = p->topLevelFile();
     
-    for(vector<string>::const_iterator plugin = _plugins.begin(); plugin != _plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguageCPlusPlus);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                p->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(_plugins, Plugin::LanguageCPlusPlus, p);
 
     //
     // Give precedence to header-ext global metadata.
diff --git a/cpp/src/slice2cs/.depend b/cpp/src/slice2cs/.depend
index dd91d15..0008a96 100644
--- a/cpp/src/slice2cs/.depend
+++ b/cpp/src/slice2cs/.depend
@@ -1,2 +1,2 @@
-Gen$(OBJEXT): Gen.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/StringUtil.h Gen.h $(includedir)/Slice/CsUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/UUID.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/DotNetNames.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Util.h
+Gen$(OBJEXT): Gen.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/StringUtil.h Gen.h $(includedir)/Slice/CsUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/UUID.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/DotNetNames.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Util.h $(includedir)/Slice/Plugin.h
 Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Parser.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/OutputUtil.h Gen.h $(includedir)/Slice/CsUtil.h
diff --git a/cpp/src/slice2cs/.depend.mak b/cpp/src/slice2cs/.depend.mak
index fe1111b..dcba7a6 100644
--- a/cpp/src/slice2cs/.depend.mak
+++ b/cpp/src/slice2cs/.depend.mak
@@ -1,2 +1,2 @@
-Gen$(OBJEXT): Gen.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/StringUtil.h" Gen.h "$(includedir)/Slice/CsUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/UUID.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/DotNetNames.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Util.h"
+Gen$(OBJEXT): Gen.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/StringUtil.h" Gen.h "$(includedir)/Slice/CsUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/UUID.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/DotNetNames.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Plugin.h"
 Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Parser.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/OutputUtil.h" Gen.h "$(includedir)/Slice/CsUtil.h"
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index 8b32da4..228f540 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -10,7 +10,6 @@
 #include <IceUtil/DisableWarnings.h>
 #include <IceUtil/Functional.h>
 #include <IceUtil/StringUtil.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <Gen.h>
 #include <limits>
 #include <sys/stat.h>
@@ -1962,31 +1961,7 @@ Slice::Gen::generate(const UnitPtr& p)
 {
     CsGenerator::validateMetaData(p);
 
-    for(vector<string>::const_iterator plugin = _plugins.begin(); plugin != _plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguageCs);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                p->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(_plugins, Plugin::LanguageCs, p);
 
     UnitVisitor unitVisitor(_out);
     p->visit(&unitVisitor, false);
diff --git a/cpp/src/slice2freeze/.depend b/cpp/src/slice2freeze/.depend
index 44cc355..597ca65 100644
--- a/cpp/src/slice2freeze/.depend
+++ b/cpp/src/slice2freeze/.depend
@@ -1 +1 @@
-Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/CPlusPlusUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/StringUtil.h
+Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/CPlusPlusUtil.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Util.h $(includedir)/Slice/Plugin.h $(includedir)/IceUtil/StringUtil.h
diff --git a/cpp/src/slice2freeze/.depend.mak b/cpp/src/slice2freeze/.depend.mak
index f2aa1fe..f5614fb 100644
--- a/cpp/src/slice2freeze/.depend.mak
+++ b/cpp/src/slice2freeze/.depend.mak
@@ -1 +1 @@
-Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/CPlusPlusUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/StringUtil.h"
+Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/CPlusPlusUtil.h" "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Plugin.h" "$(includedir)/IceUtil/StringUtil.h"
diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp
index d17ff08..c42c791 100644
--- a/cpp/src/slice2freeze/Main.cpp
+++ b/cpp/src/slice2freeze/Main.cpp
@@ -12,7 +12,6 @@
 #include <IceUtil/CtrlCHandler.h>
 #include <IceUtil/Mutex.h>
 #include <IceUtil/MutexPtrLock.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <Slice/Preprocessor.h>
 #include <Slice/CPlusPlusUtil.h>
 #include <Slice/FileTracker.h>
@@ -1388,31 +1387,7 @@ gen(const string& name, const UnitPtr& u, const vector<string>& includePaths, co
         fileC = output + '/' + fileC;
     }
 
-    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguageCPlusPlus);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                u->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(plugins, Plugin::LanguageCPlusPlus, u);
 
     u->mergeModules();
     u->sort();
diff --git a/cpp/src/slice2freezej/.depend b/cpp/src/slice2freezej/.depend
index 12cff0d..3c5ad97 100644
--- a/cpp/src/slice2freezej/.depend
+++ b/cpp/src/slice2freezej/.depend
@@ -1 +1 @@
-Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/StringUtil.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Parser.h $(includedir)/Slice/JavaUtil.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Util.h
+Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/StringUtil.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Parser.h $(includedir)/Slice/JavaUtil.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Util.h $(includedir)/Slice/Plugin.h
diff --git a/cpp/src/slice2freezej/.depend.mak b/cpp/src/slice2freezej/.depend.mak
index bd1eb4f..b152882 100644
--- a/cpp/src/slice2freezej/.depend.mak
+++ b/cpp/src/slice2freezej/.depend.mak
@@ -1 +1 @@
-Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/StringUtil.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Parser.h" "$(includedir)/Slice/JavaUtil.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Util.h"
+Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/StringUtil.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Parser.h" "$(includedir)/Slice/JavaUtil.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Plugin.h"
diff --git a/cpp/src/slice2freezej/Main.cpp b/cpp/src/slice2freezej/Main.cpp
index 4b84db7..e1e986e 100644
--- a/cpp/src/slice2freezej/Main.cpp
+++ b/cpp/src/slice2freezej/Main.cpp
@@ -12,7 +12,6 @@
 #include <IceUtil/CtrlCHandler.h>
 #include <IceUtil/Mutex.h>
 #include <IceUtil/MutexPtrLock.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <Slice/Preprocessor.h>
 #include <Slice/FileTracker.h>
 #include <Slice/JavaUtil.h>
@@ -265,31 +264,7 @@ FreezeGenerator::objectToVar(const TypePtr& type, const string& param)
 void
 FreezeGenerator::generate(UnitPtr& u, const Dict& dict)
 {
-    for(vector<string>::const_iterator plugin = _plugins.begin(); plugin != _plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguageJava);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                u->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(_plugins, Plugin::LanguageJava, u);
 
     //
     // The dictionary name may include a package.
diff --git a/cpp/src/slice2java/.depend b/cpp/src/slice2java/.depend
index 5d3f6f9..0852473 100644
--- a/cpp/src/slice2java/.depend
+++ b/cpp/src/slice2java/.depend
@@ -1,2 +1,2 @@
-Gen$(OBJEXT): Gen.cpp $(includedir)/IceUtil/DisableWarnings.h Gen.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Slice/JavaUtil.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/StringUtil.h
+Gen$(OBJEXT): Gen.cpp $(includedir)/IceUtil/DisableWarnings.h Gen.h $(includedir)/Slice/Parser.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Slice/JavaUtil.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Util.h $(includedir)/Slice/Plugin.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/StringUtil.h
 Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/Parser.h $(includedir)/Slice/Util.h $(includedir)/IceUtil/OutputUtil.h Gen.h $(includedir)/Slice/JavaUtil.h $(includedir)/Slice/Checksum.h
diff --git a/cpp/src/slice2java/.depend.mak b/cpp/src/slice2java/.depend.mak
index 8075a27..7769854 100644
--- a/cpp/src/slice2java/.depend.mak
+++ b/cpp/src/slice2java/.depend.mak
@@ -1,2 +1,2 @@
-Gen$(OBJEXT): Gen.cpp "$(includedir)/IceUtil/DisableWarnings.h" Gen.h "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Slice/JavaUtil.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/StringUtil.h"
+Gen$(OBJEXT): Gen.cpp "$(includedir)/IceUtil/DisableWarnings.h" Gen.h "$(includedir)/Slice/Parser.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Slice/JavaUtil.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Plugin.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/StringUtil.h"
 Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/Parser.h" "$(includedir)/Slice/Util.h" "$(includedir)/IceUtil/OutputUtil.h" Gen.h "$(includedir)/Slice/JavaUtil.h" "$(includedir)/Slice/Checksum.h"
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index 7a086de..9e5622f 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -15,7 +15,6 @@
 #include <IceUtil/Functional.h>
 #include <IceUtil/Iterator.h>
 #include <IceUtil/StringUtil.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <cstring>
 
 #include <limits>
@@ -1759,31 +1758,7 @@ Slice::Gen::~Gen()
 void
 Slice::Gen::generate(const UnitPtr& p, bool stream)
 {
-    for(vector<string>::const_iterator plugin = _plugins.begin(); plugin != _plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguageJava);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                p->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(_plugins, Plugin::LanguageJava, p);
 
     JavaGenerator::validateMetaData(p);
 
diff --git a/cpp/src/slice2php/.depend b/cpp/src/slice2php/.depend
index 73ef4e4..0f44e9c 100644
--- a/cpp/src/slice2php/.depend
+++ b/cpp/src/slice2php/.depend
@@ -1 +1 @@
-Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/IceUtil.h $(includedir)/IceUtil/AbstractMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Cache.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/CountDownLatch.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/IceUtil/RWRecMutex.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/UUID.h $(includedir)/IceUtil/Unicode.h $(includedir)/IceUtil/InputUtil.h $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/IceUtil/StringUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Parser.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/PHPUtil.h $(includedir)/Slice/Util.h
+Main$(OBJEXT): Main.cpp $(includedir)/IceUtil/DisableWarnings.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/Config.h $(includedir)/IceUtil/Exception.h $(includedir)/IceUtil/IceUtil.h $(includedir)/IceUtil/AbstractMutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/Cache.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/IceUtil/CountDownLatch.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Functional.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/IceUtil/RWRecMutex.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/StaticMutex.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/UUID.h $(includedir)/IceUtil/Unicode.h $(includedir)/IceUtil/InputUtil.h $(includedir)/IceUtil/Options.h $(includedir)/IceUtil/OutputUtil.h $(includedir)/IceUtil/StringUtil.h $(includedir)/Slice/Checksum.h $(includedir)/Slice/Parser.h $(includedir)/Slice/Preprocessor.h $(includedir)/Slice/FileTracker.h $(includedir)/Slice/PHPUtil.h $(includedir)/Slice/Util.h $(includedir)/Slice/Plugin.h
diff --git a/cpp/src/slice2php/.depend.mak b/cpp/src/slice2php/.depend.mak
index 3f8a55f..ef1ea53 100644
--- a/cpp/src/slice2php/.depend.mak
+++ b/cpp/src/slice2php/.depend.mak
@@ -1 +1 @@
-Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/IceUtil.h" "$(includedir)/IceUtil/AbstractMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/Cache.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/CountDownLatch.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/IceUtil/RWRecMutex.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/StaticMutex.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/UUID.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/IceUtil/InputUtil.h" "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/IceUtil/StringUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Parser.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/PHPUtil.h" "$(includedir)/Slice/Util.h"
+Main$(OBJEXT): Main.cpp "$(includedir)/IceUtil/DisableWarnings.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/IceUtil/IceUtil.h" "$(includedir)/IceUtil/AbstractMutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/Cache.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/IceUtil/CountDownLatch.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/IceUtil/RWRecMutex.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/StaticMutex.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/UUID.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/IceUtil/InputUtil.h" "$(includedir)/IceUtil/Options.h" "$(includedir)/IceUtil/OutputUtil.h" "$(includedir)/IceUtil/StringUtil.h" "$(includedir)/Slice/Checksum.h" "$(includedir)/Slice/Parser.h" "$(includedir)/Slice/Preprocessor.h" "$(includedir)/Slice/FileTracker.h" "$(includedir)/Slice/PHPUtil.h" "$(includedir)/Slice/Util.h" "$(includedir)/Slice/Plugin.h"
diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp
index ae828c1..134a61f 100644
--- a/cpp/src/slice2php/Main.cpp
+++ b/cpp/src/slice2php/Main.cpp
@@ -16,7 +16,6 @@
 #include <IceUtil/StringUtil.h>
 #include <IceUtil/Mutex.h>
 #include <IceUtil/MutexPtrLock.h>
-#include <IceUtil/DynamicLibrary.h>
 #include <Slice/Checksum.h>
 #include <Slice/Preprocessor.h>
 #include <Slice/FileTracker.h>
@@ -1398,31 +1397,7 @@ generate(const UnitPtr& un, bool all, bool checksum, bool ns,
          Output& out,
          const vector<string>& plugins)
 {
-    for(vector<string>::const_iterator plugin = plugins.begin(); plugin != plugins.end(); plugin++)
-    {
-        IceUtil::DynamicLibraryPtr library = new IceUtil::DynamicLibrary();
-        IceUtil::DynamicLibrary::symbol_type sym = library->loadEntryPoint(*plugin, false);
-        if(sym == 0)
-        {
-            string msg = library->getErrorMessage();
-            cerr << "Unable to find " << *plugin << " = " << msg << endl;
-            continue;
-        }
-        
-        Plugin::VisitorList* pluginVisitors;
-        Plugin::FACTORY factory = (Plugin::FACTORY) sym;
-        pluginVisitors = factory(Plugin::LanguagePHP);
-        
-        if(pluginVisitors)
-        {
-            for(Plugin::VisitorList::const_iterator it = pluginVisitors->begin(); it != pluginVisitors->end(); it++)
-            {
-                un->visit(*it, true);
-                delete *it;
-            }
-            delete pluginVisitors;
-        }
-    }
+    Plugin::applyPluginsToUnit(plugins, Plugin::LanguagePHP, un);
 
     if(!all)
     {

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/ice.git



More information about the asterisk-scf-commits mailing list