Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <rtl/instance.hxx>
21 :
22 : #include "internal/rtllifecycle.h"
23 :
24 : namespace
25 : {
26 : struct rtlMemorySingleton
27 : {
28 1660 : rtlMemorySingleton()
29 : {
30 1660 : rtl_memory_init();
31 1660 : }
32 1660 : ~rtlMemorySingleton()
33 : {
34 1660 : rtl_memory_fini();
35 1660 : }
36 : };
37 : class theMemorySingleton
38 : : public rtl::Static<rtlMemorySingleton, theMemorySingleton>{};
39 : }
40 :
41 1660 : void ensureMemorySingleton()
42 : {
43 1660 : theMemorySingleton::get();
44 1660 : }
45 :
46 : namespace
47 : {
48 : struct rtlCacheSingleton
49 : {
50 1910 : rtlCacheSingleton()
51 : {
52 1910 : rtl_cache_init();
53 1910 : }
54 1910 : ~rtlCacheSingleton()
55 : {
56 1910 : rtl_cache_fini();
57 1910 : }
58 : };
59 : class theCacheSingleton
60 : : public rtl::Static<rtlCacheSingleton, theCacheSingleton>{};
61 : }
62 :
63 1910 : void ensureCacheSingleton()
64 : {
65 1910 : theCacheSingleton::get();
66 1910 : }
67 :
68 : namespace
69 : {
70 : struct rtlArenaSingleton
71 : {
72 1910 : rtlArenaSingleton()
73 : {
74 1910 : rtl_arena_init();
75 1910 : }
76 1910 : ~rtlArenaSingleton()
77 : {
78 1910 : rtl_arena_fini();
79 1910 : }
80 : };
81 : class theArenaSingleton
82 : : public rtl::Static<rtlArenaSingleton, theArenaSingleton>{};
83 : }
84 :
85 1910 : void ensureArenaSingleton()
86 : {
87 1910 : theArenaSingleton::get();
88 1910 : }
89 :
90 : namespace
91 : {
92 : struct rtlLocaleSingleton
93 : {
94 1909 : rtlLocaleSingleton()
95 : {
96 1909 : rtl_locale_init();
97 1909 : }
98 1909 : ~rtlLocaleSingleton()
99 : {
100 1909 : rtl_locale_fini();
101 1909 : }
102 : };
103 : class theLocaleSingleton
104 : : public rtl::Static<rtlLocaleSingleton, theLocaleSingleton>{};
105 : }
106 :
107 1927 : void ensureLocaleSingleton()
108 : {
109 1927 : theLocaleSingleton::get();
110 1927 : }
111 :
112 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|