Flow123d  jenkins-Flow123d-windows-release-multijob-285
reader_instances.cc
Go to the documentation of this file.
1 /*
2  * reader_instances.hh
3  *
4  * Created on: Feb 13, 2014
5  * Author: jb
6  */
7 
9 
12  return instance;
13 }
14 
15 std::shared_ptr<GmshMeshReader> ReaderInstances::get_reader(const FilePath &file_path) {
16  ReaderTable::iterator it = reader_table_.find( string(file_path) );
17  if (it == reader_table_.end()) {
18  std::shared_ptr<GmshMeshReader> reader_ptr = std::make_shared<GmshMeshReader>(file_path);
19  reader_table_.insert( std::pair<string, std::shared_ptr<GmshMeshReader>>(string(file_path), reader_ptr) );
20  return reader_ptr;
21  } else {
22  return (*it).second;
23  }
24 }
ReaderTable reader_table_
Table of readers.
ReaderInstances()
Constructor.
Dedicated class for storing path to input and output files.
Definition: file_path.hh:32
std::shared_ptr< GmshMeshReader > get_reader(const FilePath &file_path)
static ReaderInstances * instance()
Returns singleton instance.