"magic_pdf/pre_proc/remove_footer_header.py.bak" did not exist on "d5ea44f944d73349c6a012fad426cfff0c2a2584"
operation.hpp 878 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef RTG_GUARD_RTGLIB_OPERAND_HPP
#define RTG_GUARD_RTGLIB_OPERAND_HPP

#include <string>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>
#include <rtg/shape.hpp>
#include <rtg/argument.hpp>

namespace rtg {

Paul's avatar
Paul committed
14
15
namespace operation_stream {

Paul's avatar
Paul committed
16
17
template <class T>
auto operator<<(std::ostream& os, const T& x) -> decltype(os << x.name())
Paul's avatar
Paul committed
18
{
Paul's avatar
Paul committed
19
    return os << x.name();
Paul's avatar
Paul committed
20
21
}

Paul's avatar
Paul committed
22
} // namespace operation_stream
Paul's avatar
Paul committed
23

24
<%
Paul's avatar
Paul committed
25
26
27
interface('operation',
    virtual('name', returns='std::string', const=True),
    virtual('compute_shape', returns='shape', input='std::vector<shape>', const=True),
Paul's avatar
Paul committed
28
    virtual('compute', returns='argument', output='shape', input='std::vector<argument>', const=True),
Paul's avatar
Paul committed
29
    friend('operator<<', returns='std::ostream &', os='std::ostream &', op='const operation &', using='rtg::operation_stream::operator<<')
Paul's avatar
Paul committed
30
)
31
%>
Paul's avatar
Paul committed
32
33
34
35

} // namespace rtg

#endif