|
Mantid
|
Class used to load a grouping information from .map file. More...
#include <LoadDetectorsGroupingFile.h>
Public Member Functions | |
| std::map< int, std::vector< int > > | getGroupSpectraMap () |
| Return the map parsed from file. More... | |
| LoadGroupMapFile (const std::string &fileName, Kernel::Logger &log) | |
| Constructor. Opens a file. More... | |
| void | parseFile () |
| Parses grouping information from .map file. More... | |
| ~LoadGroupMapFile () | |
| Desctructor. Closes a file. More... | |
Private Member Functions | |
| bool | nextDataLine (std::string &line) |
| Skips all the empty lines and comment lines, and returns next line with real data. More... | |
Private Attributes | |
| std::ifstream | m_file |
| The file being parsed. More... | |
| const std::string | m_fileName |
| The name of the file being parsed. More... | |
| std::map< int, std::vector< int > > | m_groupSpectraMap |
| group_id -> [list of spectra] More... | |
| int | m_lastLineRead |
| Number of the last line parsed. More... | |
| Kernel::Logger & | m_log |
| Logger used. More... | |
Class used to load a grouping information from .map file.
Definition at line 161 of file LoadDetectorsGroupingFile.h.
| Mantid::DataHandling::LoadGroupMapFile::LoadGroupMapFile | ( | const std::string & | fileName, |
| Kernel::Logger & | log | ||
| ) |
Constructor. Opens a file.
Constructor.
Opens a file.
| fileName | Full path to the .map file |
| log | Logger to use |
Definition at line 593 of file LoadDetectorsGroupingFile.cpp.
References m_file, and m_fileName.
| Mantid::DataHandling::LoadGroupMapFile::~LoadGroupMapFile | ( | ) |
Desctructor. Closes a file.
Destructor.
Closes the file.
Definition at line 604 of file LoadDetectorsGroupingFile.cpp.
References m_file.
|
inline |
Return the map parsed from file.
Should only be called after the file is parsed, otherwise a map will always be empty.
Definition at line 175 of file LoadDetectorsGroupingFile.h.
Referenced by Mantid::DataHandling::LoadDetectorsGroupingFile::exec().
|
private |
Skips all the empty lines and comment lines, and returns next line with real data.
Returns a next data line.
By "data line" I mean not empty and not a comment line.
| line | Where a line string will be stored |
Definition at line 681 of file LoadDetectorsGroupingFile.cpp.
References m_file, and m_lastLineRead.
Referenced by parseFile().
| void Mantid::DataHandling::LoadGroupMapFile::parseFile | ( | ) |
Parses grouping information from .map file.
Creates a group -> [spectra list] map by parsing the input file.
Definition at line 613 of file LoadDetectorsGroupingFile.cpp.
References Mantid::Kernel::Strings::convert(), m_fileName, m_groupSpectraMap, m_lastLineRead, m_log, nextDataLine(), Mantid::Kernel::Strings::parseRange(), and Mantid::Kernel::Logger::warning().
Referenced by Mantid::DataHandling::LoadDetectorsGroupingFile::exec().
|
private |
The file being parsed.
Definition at line 192 of file LoadDetectorsGroupingFile.h.
Referenced by LoadGroupMapFile(), nextDataLine(), and ~LoadGroupMapFile().
|
private |
The name of the file being parsed.
Definition at line 183 of file LoadDetectorsGroupingFile.h.
Referenced by LoadGroupMapFile(), and parseFile().
|
private |
group_id -> [list of spectra]
Definition at line 189 of file LoadDetectorsGroupingFile.h.
Referenced by parseFile().
|
private |
Number of the last line parsed.
Definition at line 195 of file LoadDetectorsGroupingFile.h.
Referenced by nextDataLine(), and parseFile().
|
private |