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
crbdb.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; show-trailing-whitespace: t -*-
2 
3  This file is part of the Feel library
4 
5  Author(s): Christophe Prud'homme <christophe.prudhomme@feelpp.org>
6  Date: 2011-06-15
7 
8  Copyright (C) 2011 Université Joseph Fourier (Grenoble I)
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free Software
22  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
29 #ifndef __CRBDB_H
30 #define __CRBDB_H 1
31 
32 #include <string>
33 
34 #include <boost/filesystem/operations.hpp>
35 #include <boost/filesystem/convenience.hpp>
36 #include <boost/filesystem/fstream.hpp>
37 #include <boost/serialization/version.hpp>
38 
39 #include <feel/feelcore/feel.hpp>
40 
41 namespace Feel
42 {
50 class CRBDB
51 {
52 public:
53 
54 
58 
59 
61 
65 
66 
68 
72 
74  CRBDB();
75  CRBDB( std::string prefixdir,
76  std::string name,
77  std::string dbprefix,
78  po::variables_map const& vm );
80  CRBDB( CRBDB const & );
82  virtual ~CRBDB();
83 
85 
89 
91  CRBDB& operator=( CRBDB const & o )
92  {
93  if ( this != &o )
94  {
95  }
96 
97  return *this;
98  }
100 
104 
106  std::string const& prefixDirectory() const
107  {
108  return M_prefixdir;
109  }
110 
112  std::string const& name() const
113  {
114  return M_name;
115  }
116 
118  std::string const& dbFilename() const
119  {
120  return M_dbfilename;
121  }
122 
124  fs::path dbLocalPath() const;
125 
127  fs::path dbSystemPath() const;
128 
130  fs::path lookForDB() const;
131 
133  po::variables_map vm()
134  {
135  return M_vm;
136  }
137 
139  po::variables_map vm() const
140  {
141  return M_vm;
142  }
143 
145  bool isDBLoaded() const
146  {
147  return M_isloaded;
148  }
149 
151 
155 
157  void setDBFilename( std::string const& filename )
158  {
159  M_dbfilename = filename;
160  }
161 
163 
167 
171  virtual void saveDB();
172 
176  virtual bool loadDB();
177 
179 
180 protected:
181  void setIsLoaded( bool isloaded )
182  {
183  M_isloaded = isloaded;
184  }
185 
186  friend class boost::serialization::access;
187  // When the class Archive corresponds to an output archive, the
188  // & operator is defined similar to <<. Likewise, when the class Archive
189  // is a type of input archive the & operator is defined similar to >>.
190  template<class Archive>
191  void save( Archive & ar, const unsigned int version ) const
192  {}
193 
194  template<class Archive>
195  void load( Archive & ar, const unsigned int version )
196  {}
197 
198  BOOST_SERIALIZATION_SPLIT_MEMBER()
199 private:
200 
201  std::string M_prefixdir;
202  std::string M_name;
203  std::string M_dbfilename;
204  po::variables_map M_vm;
205  bool M_isloaded;
206 
207 
208 };
209 }
210 #endif /* __CRBDB_H */

Generated on Sun Oct 20 2013 08:24:55 for Feel++ by doxygen 1.8.4