Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
marker.hpp
1 /*
2  This file is part of the Feel library
3  Copyright (C) 2001,2002,2003,2004 EPFL, INRIA and Politechnico di Milano
4  Copyright (C) 2006 Université Joseph Fourier (UJF)
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 3.0 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
27 #ifndef HH_MARKERS_HH_
28 #define HH_MARKERS_HH_
29 
30 #include <limits>
31 
32 #include <boost/serialization/serialization.hpp>
33 
34 #include <feel/feelcore/feel.hpp>
35 #include <boost/detail/identifier.hpp>
36 
37 namespace Feel
38 {
40 class Marker1 : public boost::detail::identifier< size_type, Marker1 >
41 {
42 public:
43  typedef boost::detail::identifier< size_type, Marker1 >::value_type value_type;
44  Marker1() : boost::detail::identifier<size_type,Marker1>( 0 ) {}
45  explicit Marker1( value_type v ) : boost::detail::identifier<size_type,Marker1>( v ) {}
46  Marker1 & operator=( value_type v )
47  {
48  this->assign( v );
49  return *this;
50  }
51  bool isOn() const { return value() != 0; }
52  bool isOff() const { return value() == 0; }
53 
54 private:
55 
56  friend class boost::serialization::access;
57  // When the class Archive corresponds to an output archive, the
58  // & operator is defined similar to <<. Likewise, when the class Archive
59  // is a type of input archive the & operator is defined similar to >>.
60  template<class Archive>
61  void save( Archive & ar, const unsigned int version ) const
62  {
63  size_type v = this->value();
64  ar & v;
65  }
66 
67  template<class Archive>
68  void load( Archive & ar, const unsigned int version )
69  {
70  size_type v;
71  ar & v;
72  this->assign( v );
73  }
74 
75  BOOST_SERIALIZATION_SPLIT_MEMBER()
76 
77 };
78 
79 class Marker2 : public boost::detail::identifier< size_type, Marker2 >
80 {
81 public:
82  typedef boost::detail::identifier< size_type, Marker2 >::value_type value_type;
83  Marker2() : boost::detail::identifier<size_type,Marker2>( 0 ) {}
84  explicit Marker2( value_type v ) : boost::detail::identifier<size_type,Marker2>( v ) {}
85  Marker2 & operator=( value_type v )
86  {
87  this->assign( v );
88  return *this;
89  }
90  bool isOn() const { return value() != 0; }
91  bool isOff() const { return value() == 0; }
92 
93 private:
94 
95  friend class boost::serialization::access;
96  // When the class Archive corresponds to an output archive, the
97  // & operator is defined similar to <<. Likewise, when the class Archive
98  // is a type of input archive the & operator is defined similar to >>.
99  template<class Archive>
100  void save( Archive & ar, const unsigned int version ) const
101  {
102  size_type v = this->value();
103  ar & v;
104  }
105 
106  template<class Archive>
107  void load( Archive & ar, const unsigned int version )
108  {
109  size_type v;
110  ar & v;
111  this->assign( v );
112  }
113 
114  BOOST_SERIALIZATION_SPLIT_MEMBER()
115 
116 };
117 class Marker3 : public boost::detail::identifier< size_type, Marker3 >
118 {
119 public:
120  typedef boost::detail::identifier< size_type, Marker3 >::value_type value_type;
121  Marker3() : boost::detail::identifier<size_type,Marker3>( 0 ) {}
122  explicit Marker3( value_type v ) : boost::detail::identifier<size_type,Marker3>( v ) {}
123  Marker3 & operator=( value_type v )
124  {
125  this->assign( v );
126  return *this;
127  }
128  bool isOn() const { return value() != 0; }
129  bool isOff() const { return value() == 0; }
130 
131 private:
132 
133  friend class boost::serialization::access;
134  // When the class Archive corresponds to an output archive, the
135  // & operator is defined similar to <<. Likewise, when the class Archive
136  // is a type of input archive the & operator is defined similar to >>.
137  template<class Archive>
138  void save( Archive & ar, const unsigned int version ) const
139  {
140  size_type v = this->value();
141  ar & v;
142  }
143 
144  template<class Archive>
145  void load( Archive & ar, const unsigned int version )
146  {
147  size_type v;
148  ar & v;
149  this->assign( v );
150  }
151 
152  BOOST_SERIALIZATION_SPLIT_MEMBER()
153 
154 };
155 
156 
157 namespace detail
158 {
159 struct by_marker {};
160 struct by_marker2 {};
161 struct by_marker3 {};
162 struct by_interprocessdomain {};
163 struct by_location {};
164 struct by_pid {};
165 struct by_element {};
166 struct by_entity {};
167 struct by_ghostcell {};
168 }
170 } // Feel
171 #endif
172 

Generated on Fri Oct 25 2013 14:24:17 for Feel++ by doxygen 1.8.4