dune-fem 2.12-git
Loading...
Searching...
No Matches
gridobjectstreams.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_GRIDOBJECTSTREAMS_HH
2#define DUNE_FEM_GRIDOBJECTSTREAMS_HH
3
4#include <type_traits>
6
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 // DummyObjectStream
17 // -----------------
18
20 {
21 class EOFException {};
22
23 template< class T >
24 void read ( T & ) const { DUNE_THROW( NotImplemented, "DummyObjectStream::read not implemented." ); }
25
26 template< class T >
27 void readObject ( T & ) { DUNE_THROW( NotImplemented, "DummyObjectStream::readObject not implemented." ); }
28
29 void readObject ( int ) { DUNE_THROW( NotImplemented, "DummyObjectStream::readObject not implemented." ); }
30 void readObject ( double ) { DUNE_THROW( NotImplemented, "DummyObjectStream::readObject not implemented." ); }
31
32 template< class T >
33 void write ( const T & ) { DUNE_THROW( NotImplemented, "DummyObjectStream::write not implemented." ); }
34
35 template< class T >
36 void writeObject ( T & ) { DUNE_THROW( NotImplemented, "DummyObjectStream::writeObject not implemented." ); }
37
38 void writeObject ( int ) { DUNE_THROW( NotImplemented, "DummyObjectStream::writeObject not implemented." ); }
39 void writeObject ( double ) { DUNE_THROW( NotImplemented, "DummyObjectStream::writeObject not implemented." ); }
40 };
41
42
43
44 // GridObjectStreamTraits
45 // ----------------------
46
47 template< class Grid >
49 {
50 // generates a check for whether Grid has a type ObjectStreamType or not
51 // the resulting class is hasMember_ObjectStreamType
53
54 // for grids that export ObjectStreamType (e.g. ALUGrid etc)
55 template <class G, bool >
56 struct Selector
57 {
58 typedef typename G::ObjectStreamType type;
59 };
60
61 // for other grids that DO NOT export ObjectStreamType (e.g. YaspGrid etc)
62 template <class G >
63 struct Selector< G, false >
64 {
66 };
67
69
72 };
73
74 // const version
75 template< class Grid >
81
82 } // namespace Fem
83
84} // namespace Dune
85
86#endif // #ifndef DUNE_FEM_GRIDOBJECTSTREAMS_HH
#define DUNE_THROW(E,...)
Definition gridobjectstreams.hh:20
void writeObject(int)
Definition gridobjectstreams.hh:38
void readObject(int)
Definition gridobjectstreams.hh:29
void writeObject(double)
Definition gridobjectstreams.hh:39
void readObject(T &)
Definition gridobjectstreams.hh:27
void readObject(double)
Definition gridobjectstreams.hh:30
void write(const T &)
Definition gridobjectstreams.hh:33
void writeObject(T &)
Definition gridobjectstreams.hh:36
void read(T &) const
Definition gridobjectstreams.hh:24
Definition gridobjectstreams.hh:21
Definition gridobjectstreams.hh:49
GENERATE_MEMBER_CHECK(ObjectStreamType)
Selector< Grid, hasMember_ObjectStreamType< Grid >::value >::type ObjectStreamType
Definition gridobjectstreams.hh:68
ObjectStreamType InStreamType
Definition gridobjectstreams.hh:70
ObjectStreamType OutStreamType
Definition gridobjectstreams.hh:71
Definition gridobjectstreams.hh:57
G::ObjectStreamType type
Definition gridobjectstreams.hh:58
DummyObjectStream type
Definition gridobjectstreams.hh:65
GridObjectStreamTraits< Grid >::InStreamType InStreamType
Definition gridobjectstreams.hh:78
GridObjectStreamTraits< Grid >::OutStreamType OutStreamType
Definition gridobjectstreams.hh:79