1#ifndef DUNE_FEM_STREAMS_INLINE_HH
2#define DUNE_FEM_STREAMS_INLINE_HH
17 template<
class Traits >
18 inline OutStreamInterface< Traits > &
19 operator<< ( OutStreamInterface< Traits > &out,
22 out.writeDouble( value );
26 template<
class Traits >
27 inline OutStreamInterface< Traits > &
28 operator<< ( OutStreamInterface< Traits > &out,
31 out.writeFloat( value );
35 template<
class Traits >
36 inline OutStreamInterface< Traits > &
37 operator<< ( OutStreamInterface< Traits > &out,
40 out.writeInt( value );
44 template<
class Traits >
45 inline OutStreamInterface< Traits > &
46 operator<< ( OutStreamInterface< Traits > &out,
49 out.writeChar( value );
53 template<
class Traits >
54 inline OutStreamInterface< Traits > &
55 operator<< ( OutStreamInterface< Traits > &out,
58 out.writeBool( value );
62 template<
class Traits >
63 inline OutStreamInterface< Traits > &
64 operator<< ( OutStreamInterface< Traits > &out,
65 const std :: string &s )
71 template<
class Traits >
72 inline OutStreamInterface< Traits > &
73 operator<< ( OutStreamInterface< Traits > &out,
74 const unsigned int value )
76 out.writeUnsignedInt( value );
80 template<
class Traits,
class T >
81 inline OutStreamInterface< Traits > &
82 operator<< ( OutStreamInterface< Traits > &out,
83 const std::complex<T> value )
85 out.writeDouble( std::real(value) );
86 out.writeDouble( std::imag(value) );
90 template<
class Traits >
91 inline OutStreamInterface< Traits > &
92 operator<< ( OutStreamInterface< Traits > &out,
93 const uint64_t value )
95 out.writeUnsignedInt64( value );
99 template<
class Traits >
100 inline OutStreamInterface< Traits > &
101 operator<< ( OutStreamInterface< Traits > &out,
102 const std::conditional< std::is_same<unsigned long, uint64_t>::value,
104 unsigned long >::type& value
107 assert(
sizeof(value) <=
sizeof(uint64_t) );
109 out.writeUnsignedInt64( v );
113 template<
class Traits >
114 inline OutStreamInterface< Traits > &
115 operator<< ( OutStreamInterface< Traits > &out,
116 const int64_t value )
118 out.writeSignedInt64( value );
122 template<
class Traits >
123 inline OutStreamInterface< Traits > &
124 operator<< ( OutStreamInterface< Traits > &out,
125 const std::conditional< std::is_same<long, int64_t>::value,
127 long >::type& value )
129 assert(
sizeof(value) <=
sizeof(int64_t));
131 out.writeSignedInt64( v );
135 template<
class Traits,
class T, std::
size_t N >
136 inline OutStreamInterface< Traits > &
137 operator<< ( OutStreamInterface< Traits > &out,
const std::array< T, N > &value )
139 for( std::size_t i = 0; i < N; ++i )
144 template<
class Traits,
class T,
int N >
145 inline OutStreamInterface< Traits > &
148 for(
int i = 0; i < N; ++i )
153 template<
class Traits,
class T,
class A >
154 inline OutStreamInterface< Traits > &
155 operator<< ( OutStreamInterface< Traits > &out,
156 const std::vector< T, A > & value )
158 const size_t size = value.size();
160 for(
size_t i = 0; i <
size; ++i )
165 template<
class Traits >
166 inline InStreamInterface< Traits > &
170 in.readDouble( value );
174 template<
class Traits >
175 inline InStreamInterface< Traits > &
179 in.readFloat( value );
183 template<
class Traits >
184 inline InStreamInterface< Traits > &
192 template<
class Traits >
193 inline InStreamInterface< Traits > &
197 in.readChar( value );
201 template<
class Traits >
202 inline InStreamInterface< Traits > &
206 in.readBool( value );
210 template<
class Traits >
211 inline InStreamInterface< Traits > &
219 template<
class Traits >
220 inline InStreamInterface< Traits > &
222 unsigned int &value )
224 in.readUnsignedInt( value );
228 template<
class Traits >
229 inline InStreamInterface< Traits > &
233 in.readUnsignedInt64( value );
237 template<
class Traits >
238 inline InStreamInterface< Traits > &
240 std::conditional< std::is_same<unsigned long, uint64_t>::value,
242 unsigned long >::type& value )
245 assert(
sizeof(value) <=
sizeof(uint64_t));
247 in.readUnsignedInt64( v );
252 template<
class Traits >
253 inline InStreamInterface< Traits > &
257 in.readSignedInt64( value );
261 template<
class Traits >
262 inline InStreamInterface< Traits > &
264 std::conditional< std::is_same<long, int64_t>::value,
266 long >::type& value )
269 assert(
sizeof(value) <=
sizeof(int64_t));
271 in.readSignedInt64( v );
276 template<
class Traits,
class T, std::
size_t N >
277 inline InStreamInterface< Traits > &
278 operator>> ( InStreamInterface< Traits > &in, std::array< T, N > &value )
280 for( std::size_t i = 0; i < N; ++i )
285 template<
class Traits,
class T,
int N >
286 inline InStreamInterface< Traits > &
289 for(
int i = 0; i < N; ++i )
294 template<
class Traits,
class T >
295 inline InStreamInterface< Traits > &
297 std::complex<T> &value )
302 value = std::complex<T>(r,i);
306 template<
class Traits,
class T,
class A >
307 inline InStreamInterface< Traits > &
309 std::vector< T, A > & value )
313 value.resize(
size );
314 for(
size_t i = 0; i <
size; ++i )
Implements a vector constructed from a given type representing a field and a compile-time given size.
Stream & operator>>(Stream &stream, std::tuple< Ts... > &t)
Read a std::tuple.
Definition: streamoperators.hh:43
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75