Flow123d  last_with_con_2.0.0-663-gd0e2296
reader_instances.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file reader_instances.hh
15  * @brief
16  */
17 
18 #ifndef READER_INSTANCES_HH_
19 #define READER_INSTANCES_HH_
20 
21 
22 #include "mesh/msh_gmshreader.h"
23 #include "system/file_path.hh"
24 
25 
26 /**
27  * Auxiliary class to map filepaths to instances of readers.
28  */
30 public:
32 
33  /// Returns singleton instance
34  static ReaderInstances * instance();
35 
36  /**
37  * Returns mesh reader of get filepath. If reader doesn't exist, creates its.
38  */
39  std::shared_ptr<GmshMeshReader> get_reader(const FilePath &file_path);
40 
41 private:
42  /// Constructor
44 
45  /// Table of readers
46  ReaderTable reader_table_;
47 };
48 
49 
50 #endif /* READER_INSTANCES_HH_ */
std::map< string, std::shared_ptr< GmshMeshReader > > ReaderTable
ReaderTable reader_table_
Table of readers.
ReaderInstances()
Constructor.
Dedicated class for storing path to input and output files.
Definition: file_path.hh:48
std::shared_ptr< GmshMeshReader > get_reader(const FilePath &file_path)
static ReaderInstances * instance()
Returns singleton instance.