helics  2.8.1
GuardedTypes.hpp
1 /*
2 Copyright (c) 2017-2021,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 #pragma once
8 
9 #include "helics/compiler-config.h"
10 #ifndef HAVE_SHARED_TIMED_MUTEX
11 # ifndef HAVE_SHARED_MUTEX
12 # define LIBGUARDED_NO_DEFAULT 1
13 # endif
14 #endif
15 #include "gmlc/libguarded/atomic_guarded.hpp"
16 #include "gmlc/libguarded/guarded.hpp"
17 #include "gmlc/libguarded/ordered_guarded.hpp"
18 #include "gmlc/libguarded/shared_guarded.hpp"
19 //#include "gmlc/libguarded/staged_guarded.hpp"
20 
21 template<class T>
22 using guarded = gmlc::libguarded::guarded<T>;
23 
24 template<class T>
25 using atomic_guarded = gmlc::libguarded::atomic_guarded<T>;
26 
27 template<class T>
29 
30 template<class T>
31 using ordered_guarded_m = gmlc::libguarded::ordered_guarded<T, std::mutex>;
32 
33 #ifdef HAVE_SHARED_MUTEX
34 template<class T>
36 
37 template<class T>
38 using ordered_guarded = gmlc::libguarded::ordered_guarded<T, std::shared_mutex>;
39 #else
40 # ifdef HAVE_SHARED_TIMED_MUTEX
41 template<class T>
43 
44 template<class T>
45 using ordered_guarded = gmlc::libguarded::ordered_guarded<T, std::shared_timed_mutex>;
46 # else
47 # include <mutex>
48 template<class T>
50 
51 template<class T>
52 using ordered_guarded = gmlc::libguarded::ordered_guarded<T, std::mutex>;
53 # endif
54 #endif
gmlc::libguarded::shared_guarded
Definition: application_api/Federate.hpp:26