eOn 3.2.0
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
PotCapabilities.h
Go to the documentation of this file.
1
/*
2
** This file is part of eOn.
3
**
4
** SPDX-License-Identifier: BSD-3-Clause
5
**
6
** Copyright (c) 2010--present, eOn Development Team
7
** All rights reserved.
8
**
9
** Repo:
10
** https://github.com/TheochemUI/eOn
11
*/
12
#pragma once
13
14
#include "
Potential.h
"
15
#include <concepts>
16
#include <type_traits>
17
18
namespace
eonc
{
19
23
template
<
class
P>
24
concept
ThreadSafeQueryable
=
requires
(
const
P &p) {
25
{ p.isThreadSafe() } -> std::convertible_to<bool>;
26
};
27
28
template
<
class
P>
29
requires
ThreadSafeQueryable<P>
30
[[nodiscard]]
bool
potIsThreadSafe
(
const
P &p)
noexcept
{
31
return
p.isThreadSafe();
32
}
33
34
template
<
class
P>
35
requires
requires
(
const
P &p) {
36
{ p.isSharedInstanceThreadSafe() } -> std::convertible_to<bool>;
37
}
38
[[nodiscard]]
bool
potAllowsSharedInstance
(
const
P &p)
noexcept
{
39
return
p.isSharedInstanceThreadSafe();
40
}
41
42
}
// namespace eonc
Potential.h
eonc::ThreadSafeQueryable
Duck-typed thread-safety query.
Definition
PotCapabilities.h:24
eonc
RAII resource manager for the ARTn C library with global synchronization.
Definition
ARTnSaddleSearch.cpp:23
eonc::potIsThreadSafe
bool potIsThreadSafe(const P &p) noexcept
Definition
PotCapabilities.h:30
eonc::potAllowsSharedInstance
bool potAllowsSharedInstance(const P &p) noexcept
Definition
PotCapabilities.h:38
include
eon
PotCapabilities.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf