TypeOfObservation.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <iosfwd>
7 
9 
10 namespace observers {
11 /*!
12  * \ingroup ObserversGroup
13  * \brief Specifies the type of observation.
14  *
15  * Below `sender` is the component passing the data, reduction or volume, to the
16  * observer component.
17  */
18 enum class TypeOfObservation {
19  /// The sender will only perform reduction observations
20  Reduction,
21  /// The sender will only perform volume observations
22  Volume,
23  /// The sender will perform both reduction and volume observations
25 };
26 
27 std::ostream& operator<<(std::ostream& os, const TypeOfObservation& t) noexcept;
28 
29 // @{
30 /// Inherits off of `std::true_type` if `T` has a member variable
31 /// `RegisterWithObserver`
32 template <class T, class = cpp17::void_t<>>
34 
35 /// \cond
36 template <class T>
38  T, cpp17::void_t<decltype(T::RegisterWithObserver)>> : std::true_type {};
39 /// \endcond
40 
41 template <class T>
42 constexpr bool has_register_with_observer_v =
44 // @}
45 } // namespace observers
Definition: Actions.hpp:20
Inherits off of std::true_type if T has a member variable RegisterWithObserver
Definition: TypeOfObservation.hpp:33
The sender will perform both reduction and volume observations.
void void_t
Given a set of types, returns void
Definition: TypeTraits.hpp:214
The sender will only perform reduction observations.
TypeOfObservation
Specifies the type of observation.
Definition: TypeOfObservation.hpp:18
Defines type traits, some of which are future STL type_traits header.
The sender will only perform volume observations.