include
ecl
containers
stencil
stencil/formatters.hpp
Go to the documentation of this file.
1
8
/*****************************************************************************
9
** Ifdefs
10
*****************************************************************************/
11
12
#ifndef ECL_CONTAINERS_STENCIL_FORMATTERS_HPP_
13
#define ECL_CONTAINERS_STENCIL_FORMATTERS_HPP_
14
15
/*****************************************************************************
16
** Includes
17
*****************************************************************************/
18
19
#include <cmath>
20
#include <
ecl/config/macros.hpp
>
21
#include <
ecl/formatters/common.hpp
>
22
#include <
ecl/formatters/number.hpp
>
23
#include <
ecl/formatters/floats.hpp
>
24
#include <
ecl/mpl/enable_if.hpp
>
25
#include <
ecl/type_traits/fundamental_types.hpp
>
26
#include "../common/formatters.hpp"
27
28
/*****************************************************************************
29
** Namespaces
30
*****************************************************************************/
31
32
namespace
ecl
33
{
34
35
/*****************************************************************************
36
** Forward Declarations
37
*****************************************************************************/
38
39
template
<
typename
Container>
40
class
Stencil;
41
42
/*****************************************************************************
43
** Namespaces
44
*****************************************************************************/
45
46
namespace
formatters
47
{
48
49
/*****************************************************************************
50
** Using
51
*****************************************************************************/
52
71
template
<
typename
ValueType,
typename
Container,
typename
Enable =
void
>
72
class
ECL_PUBLIC
StencilFormatter
73
{
74
public
:
75
virtual
~StencilFormatter()
76
{}
83
const
ecl::Stencil< Container >
& operator()(
const
ecl::Stencil< Container >
&stencil) {
84
return
stencil;
85
}
86
//ecl::Stencil< Container >& operator()(const ecl::Stencil< Container > &stencil) { return stencil;} // this was the old version - couldn't do in place format(xxx.stencil()) commands
87
};
88
89
/*****************************************************************************
90
** Specialisations
91
*****************************************************************************/
92
102
template
<
typename
ValueType,
typename
Container>
103
class
ECL_PUBLIC
StencilFormatter
< ValueType, Container, typename
ecl
::
enable_if
< ecl::is_float<ValueType> >::type > :
public
FloatContainerFormatter
< ecl::Stencil< Container > >
104
{
105
public
:
114
StencilFormatter
(
const
int
p=2,
const
int
w=-1) :
FloatContainerFormatter< ecl::Stencil< Container >
>(p,w) {};
115
virtual
~StencilFormatter()
116
{}
117
};
118
119
}
// namespace formatters
120
}
// namespace ecl
121
122
#endif
/* ECL_CONTAINERS_STENCIL_FORMATTERS_HPP_ */
ecl::formatters::StencilFormatter
Pseudo formatter for stencils.
Definition:
stencil/formatters.hpp:80
ecl::Stencil< Container >
floats.hpp
common.hpp
number.hpp
enable_if.hpp
fundamental_types.hpp
ecl::formatters::FloatContainerFormatter
Parent interface for formatters of fixed size float/double containers.
Definition:
common/formatters.hpp:79
ecl::enable_if
macros.hpp
ecl
Embedded control libraries.
ECL_PUBLIC
#define ECL_PUBLIC
ecl_containers
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:34