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

Holds information about last save for items with non-XML data. More...

Collaboration diagram for OutputDataSaveInfo:
[legend]

Public Member Functions

 OutputDataSaveInfo ()
 
QString fileName () const
 
const SaveLoadInterfaceitem () const
 
bool wasModifiedSinceLastSave () const
 

Static Public Member Functions

static OutputDataSaveInfo createSaved (const SaveLoadInterface *item)
 Static method to create info for just saved item. More...
 

Private Member Functions

bool wasSavedBefore (const QDateTime &dtime) const
 Returns true if IntensityDataItem was saved before given time. More...
 

Private Attributes

const SaveLoadInterfacem_data
 
QString m_file_name
 
QDateTime m_last_saved
 

Detailed Description

Holds information about last save for items with non-XML data.

Definition at line 26 of file OutputDataIOHistory.h.

Constructor & Destructor Documentation

◆ OutputDataSaveInfo()

OutputDataSaveInfo::OutputDataSaveInfo ( )
inline

Definition at line 28 of file OutputDataIOHistory.h.

28 : m_data(nullptr) {}
const SaveLoadInterface * m_data

Member Function Documentation

◆ createSaved()

OutputDataSaveInfo OutputDataSaveInfo::createSaved ( const SaveLoadInterface item)
static

Static method to create info for just saved item.

Definition at line 22 of file OutputDataIOHistory.cpp.

23 {
24  ASSERT(item);
25 
26  OutputDataSaveInfo result;
27  result.m_data = item;
28  result.m_file_name = item->fileName();
30  return result;
31 }
#define ASSERT(condition)
Definition: Assert.h:31
Holds information about last save for items with non-XML data.
const SaveLoadInterface * item() const
virtual QString fileName() const =0
Reports file name to save/load non-XML data.
QString currentDateTime()
Definition: GUIHelpers.cpp:210

References ASSERT, GUIHelpers::currentDateTime(), SaveLoadInterface::fileName(), item(), m_data, m_file_name, and m_last_saved.

Referenced by OutputDataDirHistory::markAsSaved().

Here is the call graph for this function:

◆ fileName()

QString OutputDataSaveInfo::fileName ( ) const
inline

Definition at line 34 of file OutputDataIOHistory.h.

34 { return m_file_name; }

References m_file_name.

◆ item()

const SaveLoadInterface* OutputDataSaveInfo::item ( ) const
inline

Definition at line 32 of file OutputDataIOHistory.h.

32 { return m_data; }

References m_data.

Referenced by createSaved().

◆ wasModifiedSinceLastSave()

bool OutputDataSaveInfo::wasModifiedSinceLastSave ( ) const

Definition at line 33 of file OutputDataIOHistory.cpp.

34 {
36 }
bool wasSavedBefore(const QDateTime &dtime) const
Returns true if IntensityDataItem was saved before given time.
virtual QDateTime lastModified() const =0
Indicates last modification timepoint.

References SaveLoadInterface::lastModified(), m_data, and wasSavedBefore().

Referenced by OutputDataDirHistory::wasModifiedSinceLastSave().

Here is the call graph for this function:

◆ wasSavedBefore()

bool OutputDataSaveInfo::wasSavedBefore ( const QDateTime &  dtime) const
private

Returns true if IntensityDataItem was saved before given time.

Definition at line 40 of file OutputDataIOHistory.cpp.

41 {
42  // positive number means that m_last_saved is older than dtime
43  return m_last_saved.msecsTo(dtime) > 0;
44 }

References m_last_saved.

Referenced by wasModifiedSinceLastSave().

Member Data Documentation

◆ m_data

const SaveLoadInterface* OutputDataSaveInfo::m_data
private

Definition at line 43 of file OutputDataIOHistory.h.

Referenced by createSaved(), item(), and wasModifiedSinceLastSave().

◆ m_file_name

QString OutputDataSaveInfo::m_file_name
private

Definition at line 42 of file OutputDataIOHistory.h.

Referenced by createSaved(), and fileName().

◆ m_last_saved

QDateTime OutputDataSaveInfo::m_last_saved
private

Definition at line 41 of file OutputDataIOHistory.h.

Referenced by createSaved(), and wasSavedBefore().


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