rexlib
0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
rexlib
core
operation
operation_id.hpp
1
// SPDX-License-Identifier: GPL-3.0-only
2
3
#pragma once
4
5
#include <typeindex>
6
#include <functional>
7
#include <cstddef>
8
9
namespace
rexlib
10
{
11
15
class
operation_id
16
{
17
public
:
18
explicit
operation_id
(std::type_index
id
)
noexcept
;
19
operation_id
(
const
operation_id
&
other
) =
default
;
20
operation_id
(
operation_id
&&
other
) =
default
;
21
~operation_id
() =
default
;
22
23
operation_id
& operator=(
const
operation_id
&
other
) =
default
;
24
operation_id
& operator=(
operation_id
&&
other
) =
default
;
25
26
friend
bool
27
operator==(
const
operation_id
&
lhs
,
const
operation_id
&
rhs
)
noexcept
28
{
29
return
lhs
.m_id ==
rhs
.m_id;
30
}
31
32
friend
bool
33
operator!=(
const
operation_id
&
lhs
,
const
operation_id
&
rhs
)
noexcept
34
{
35
return
!(
lhs
==
rhs
);
36
}
37
43
std::size_t
hash
()
const
noexcept
;
44
45
template
<
typename
T
>
46
static
operation_id
of()
noexcept
;
47
48
private
:
49
std::
type_index
m_id;
50
};
51
52
}
// namespace rexlib
53
54
namespace
std
55
{
56
57
template
<>
58
struct
hash
<
rexlib
::
operation_id
>
59
{
60
using
key_type =
rexlib::operation_id
;
61
std::size_t operator()(
const
key_type &
k
)
const
noexcept
;
62
};
63
64
}
// namespace std
65
66
#include "operation_id.inl"
rexlib::array
Container for multidimensional numeric data.
Definition
array.hpp:31
rexlib::operation_id
Unique identification for an operation type.
Definition
operation_id.hpp:16
rexlib::operation_id::hash
std::size_t hash() const noexcept
Compute the hash for this operation identifier.
rexlib
Arrays, the operations on them and the devices that run those operations.
Definition
cpu_device.hpp:10
Generated by
1.9.8