GetFEM  5.4.3
getfem_locale.h
Go to the documentation of this file.
1 /* -*- c++ -*- (enables emacs c++ mode) */
2 /*===========================================================================
3 
4  Copyright (C) 2002-2020 Yves Renard
5 
6  This file is a part of GetFEM
7 
8  GetFEM is free software; you can redistribute it and/or modify it
9  under the terms of the GNU Lesser General Public License as published
10  by the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version along with the GCC Runtime Library
12  Exception either version 3.1 or (at your option) any later version.
13  This program is distributed in the hope that it will be useful, but
14  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  License and GCC Runtime Library Exception for more details.
17  You should have received a copy of the GNU Lesser General Public License
18  along with this program; if not, write to the Free Software Foundation,
19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, you may use this file as it is a part of a free
22  software library without restriction. Specifically, if other files
23  instantiate templates or use macros or inline functions from this file,
24  or you compile this file and link it with other files to produce an
25  executable, this file does not by itself cause the resulting executable
26  to be covered by the GNU Lesser General Public License. This exception
27  does not however invalidate any other reasons why the executable file
28  might be covered by the GNU Lesser General Public License.
29 
30 ===========================================================================*/
31 
32 /**@file getfem_locale.h
33  @author Andriy Andreykiv [email protected]
34  @date November 29, 2018
35  @brief thread safe standard locale with RAII semantics
36 */
37 
38 #pragma once
39 
40 #include <locale.h>
41 #include <string>
42 
43 #include "getfem_omp.h"
44 
45 namespace getfem {
46 
47  /**Identical to gmm::standard_locale, but does not
48  change std::locale in multi-threaded sections
49  of the code, which is not thread-safe*/
51  std::string cloc;
52  std::locale cinloc;
53  public :
55  ~standard_locale();
56  };
57 
58 } /* end of namespace getfem. */
Identical to gmm::standard_locale, but does not change std::locale in multi-threaded sections of the ...
Definition: getfem_locale.h:50
Tools for multithreaded, OpenMP and Boost based parallelization.
GEneric Tool for Finite Element Methods.