Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* Operator.inl
*
* Created on: Oct 18, 2017
* Author: William F Godoy godoywf@ornl.gov
*/
#ifndef ADIOS2_CORE_OPERATOR_INL_
#define ADIOS2_CORE_OPERATOR_INL_
#ifndef ADIOS2_CORE_OPERATOR_H_
#error "Inline file should only be included from it's header, never on it's own"
#endif
#include "adios2/core/Callback.h"
namespace adios2
{
template <class R, class... Args>
std::function<R(Args...)> Operator::GetCallback()
{
if (m_DebugMode && m_Type != "Callback")
{
throw std::invalid_argument(
"ERROR: operator of type " + m_Type +
" doesn't support GetCallback, it's "
" only allowed for Callback Operator types\n");
}
Callback<R, Args...> *callback = dynamic_cast<Callback<R, Args...> *>(this);
return callback->m_Function;
}
} // end namespace adios2
#endif /* ADIOS2_CORE_OPERATOR_INL_ */