summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/FactoryTable.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2003-05-08 05:46:29 +0000
committerMichi Henning <michi@zeroc.com>2003-05-08 05:46:29 +0000
commit225855fb6b992a4207f9107d988036aa1ee0d217 (patch)
treeefa68b5ed0afbc0753e7b8d98786674262caa872 /cpp/src/Ice/FactoryTable.cpp
parentmore install projects (diff)
downloadice-225855fb6b992a4207f9107d988036aa1ee0d217.tar.bz2
ice-225855fb6b992a4207f9107d988036aa1ee0d217.tar.xz
ice-225855fb6b992a4207f9107d988036aa1ee0d217.zip
Merged HEAD and slicing trees.
Diffstat (limited to 'cpp/src/Ice/FactoryTable.cpp')
-rw-r--r--cpp/src/Ice/FactoryTable.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/cpp/src/Ice/FactoryTable.cpp b/cpp/src/Ice/FactoryTable.cpp
new file mode 100644
index 00000000000..1166208c4d7
--- /dev/null
+++ b/cpp/src/Ice/FactoryTable.cpp
@@ -0,0 +1,37 @@
+// **********************************************************************
+//
+// Copyright (c) 2003
+// ZeroC, Inc.
+// Billerica, MA, USA
+//
+// All Rights Reserved.
+//
+// Ice is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License version 2 as published by
+// the Free Software Foundation.
+//
+// **********************************************************************
+
+#include <Ice/FactoryTable.h>
+
+//
+// This constructor initializes the single global Ice::factoryTable instance
+// from the outside (if it hasn't been initialized yet). The constructor here
+// is triggered by a file-static instance of FactoryTable in each
+// slice2cpp-generated header file that uses non-local exceptions or non-abstract classes.
+// This ensures that Ice::factoryTable is always initialized before it is used.
+//
+Ice::FactoryTable::FactoryTable()
+{
+
+ Ice::factoryTableWrapper.initialize();
+}
+
+//
+// Similarly, the destructor calls the finalize() method on the factory table wrapper which,
+// once the tables reference count drops to zero, deletes the table.
+//
+Ice::FactoryTable::~FactoryTable()
+{
+ Ice::factoryTableWrapper.finalize();
+}