summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/FactoryTable.cpp
blob: d3539b91db325cd99c4651c9492739e951d57430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice-E is licensed to you under the terms described in the
// ICEE_LICENSE file included in this distribution.
//
// **********************************************************************

#include <IceE/FactoryTable.h>
#include <IceE/UserExceptionFactory.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.
//
IceInternal::FactoryTable::FactoryTable()
{

    IceInternal::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.
//
IceInternal::FactoryTable::~FactoryTable()
{
    IceInternal::factoryTableWrapper.finalize();
}