From 225855fb6b992a4207f9107d988036aa1ee0d217 Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Thu, 8 May 2003 05:46:29 +0000 Subject: Merged HEAD and slicing trees. --- cpp/src/Ice/FactoryTable.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cpp/src/Ice/FactoryTable.cpp (limited to 'cpp/src/Ice/FactoryTable.cpp') 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 + +// +// 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(); +} -- cgit v1.2.3