Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <rtl/instance.hxx>
30 : :
31 : : #include "internal/rtllifecycle.h"
32 : :
33 : : namespace
34 : : {
35 : : struct rtlMemorySingleton
36 : : {
37 : 2742 : rtlMemorySingleton()
38 : : {
39 : 2742 : rtl_memory_init();
40 : 2742 : }
41 : 2742 : ~rtlMemorySingleton()
42 : : {
43 : 2742 : rtl_memory_fini();
44 : 2742 : }
45 : : };
46 : : class theMemorySingleton
47 : : : public rtl::Static<rtlMemorySingleton, theMemorySingleton>{};
48 : : }
49 : :
50 : 2742 : void ensureMemorySingleton()
51 : : {
52 : 2742 : theMemorySingleton::get();
53 : 2742 : }
54 : :
55 : : namespace
56 : : {
57 : : struct rtlCacheSingleton
58 : : {
59 : 3003 : rtlCacheSingleton()
60 : : {
61 : 3003 : rtl_cache_init();
62 : 3003 : }
63 : 3003 : ~rtlCacheSingleton()
64 : : {
65 : 3003 : rtl_cache_fini();
66 : 3003 : }
67 : : };
68 : : class theCacheSingleton
69 : : : public rtl::Static<rtlCacheSingleton, theCacheSingleton>{};
70 : : }
71 : :
72 : 3003 : void ensureCacheSingleton()
73 : : {
74 : 3003 : theCacheSingleton::get();
75 : 3003 : }
76 : :
77 : : namespace
78 : : {
79 : : struct rtlArenaSingleton
80 : : {
81 : 3003 : rtlArenaSingleton()
82 : : {
83 : 3003 : rtl_arena_init();
84 : 3003 : }
85 : 3003 : ~rtlArenaSingleton()
86 : : {
87 : 3003 : rtl_arena_fini();
88 : 3003 : }
89 : : };
90 : : class theArenaSingleton
91 : : : public rtl::Static<rtlArenaSingleton, theArenaSingleton>{};
92 : : }
93 : :
94 : 3003 : void ensureArenaSingleton()
95 : : {
96 : 3003 : theArenaSingleton::get();
97 : 3003 : }
98 : :
99 : : namespace
100 : : {
101 : : struct rtlLocaleSingleton
102 : : {
103 : 2975 : rtlLocaleSingleton()
104 : : {
105 : 2975 : rtl_locale_init();
106 : 2975 : }
107 : 2975 : ~rtlLocaleSingleton()
108 : : {
109 : 2975 : rtl_locale_fini();
110 : 2975 : }
111 : : };
112 : : class theLocaleSingleton
113 : : : public rtl::Static<rtlLocaleSingleton, theLocaleSingleton>{};
114 : : }
115 : :
116 : 3070 : void ensureLocaleSingleton()
117 : : {
118 : 3070 : theLocaleSingleton::get();
119 : 3070 : }
120 : :
121 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|