BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
OutputDataIOHistory Class Reference

Save history information for set of directories. More...

Public Member Functions

bool hasHistory (const QString &dirname) const
 
QStringList savedFileNames (const QString &dirname) const
 
void setHistory (const QString &dirname, const OutputDataDirHistory &history)
 Sets history for given directory. Previous history will be rewritten. More...
 
bool wasModifiedSinceLastSave (const QString &dirname, const SaveLoadInterface *item)
 

Private Attributes

QMap< QString, OutputDataDirHistorym_dir_history
 < Correspondance of directory name to save history. More...
 

Detailed Description

Save history information for set of directories.

Definition at line 68 of file OutputDataIOHistory.h.

Member Function Documentation

◆ hasHistory()

bool OutputDataIOHistory::hasHistory ( const QString &  dirname) const

Definition at line 97 of file OutputDataIOHistory.cpp.

98 {
99  return m_dir_history.find(dirname) == m_dir_history.end() ? false : true;
100 }
QMap< QString, OutputDataDirHistory > m_dir_history
< Correspondance of directory name to save history.

References m_dir_history.

Referenced by OutputDataIOService::save(), savedFileNames(), and wasModifiedSinceLastSave().

◆ savedFileNames()

QStringList OutputDataIOHistory::savedFileNames ( const QString &  dirname) const

Definition at line 121 of file OutputDataIOHistory.cpp.

122 {
123  if (!hasHistory(dirname))
124  throw GUIHelpers::Error("OutputDataIOHistory::savedFileNames() -> Error. "
125  "No info for directory '"
126  + dirname + "'.");
127 
128  return m_dir_history[dirname].savedFileNames();
129 }
bool hasHistory(const QString &dirname) const

References hasHistory(), and m_dir_history.

Referenced by OutputDataIOService::save().

Here is the call graph for this function:

◆ setHistory()

void OutputDataIOHistory::setHistory ( const QString &  dirname,
const OutputDataDirHistory history 
)

Sets history for given directory. Previous history will be rewritten.

Definition at line 114 of file OutputDataIOHistory.cpp.

115 {
116  ASSERT(dirname.isEmpty() == false);
117 
118  m_dir_history[dirname] = history;
119 }
#define ASSERT(condition)
Definition: Assert.h:31

References ASSERT, and m_dir_history.

Referenced by OutputDataIOService::load(), and OutputDataIOService::save().

◆ wasModifiedSinceLastSave()

bool OutputDataIOHistory::wasModifiedSinceLastSave ( const QString &  dirname,
const SaveLoadInterface item 
)

Definition at line 102 of file OutputDataIOHistory.cpp.

104 {
105  if (!hasHistory(dirname))
106  throw GUIHelpers::Error("OutputDataIOHistory::wasModifiedSinceLastSave() -> Error. "
107  "No info for directory '"
108  + dirname + "'.");
109  return m_dir_history[dirname].wasModifiedSinceLastSave(item);
110 }

References hasHistory(), and m_dir_history.

Referenced by OutputDataIOService::save().

Here is the call graph for this function:

Member Data Documentation

◆ m_dir_history

QMap<QString, OutputDataDirHistory> OutputDataIOHistory::m_dir_history
private

< Correspondance of directory name to save history.

Definition at line 80 of file OutputDataIOHistory.h.

Referenced by hasHistory(), savedFileNames(), setHistory(), and wasModifiedSinceLastSave().


The documentation for this class was generated from the following files: