BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ProjectManager::ProjectManagerImpl Struct Reference
Collaboration diagram for ProjectManager::ProjectManagerImpl:
[legend]

Public Member Functions

 ProjectManagerImpl (ProjectContext context)
 
void createNewProject ()
 Closes current project. Used in assumption that project was already saved. More...
 
bool isModified () const
 Returns true if project has been modified after the last save. More...
 
bool loadFrom (const std::string &dirname)
 Loads the project from a given directory. More...
 
bool projectHasDir () const
 Returns true if the project has directory already defined. More...
 
bool saveCurrentProject ()
 Saves project in project directory. If directory is not defined. More...
 
bool saveCurrentProjectAs (const std::string &dirname)
 Saves the project into a given directory. More...
 

Public Attributes

std::unique_ptr< ProjectInterfacem_current_project
 
ProjectContext m_project_context
 

Detailed Description

Definition at line 27 of file projectmanager.cpp.

Constructor & Destructor Documentation

◆ ProjectManagerImpl()

ProjectManager::ProjectManagerImpl::ProjectManagerImpl ( ProjectContext  context)
inline

Definition at line 31 of file projectmanager.cpp.

31  : m_project_context(std::move(context))
32  {
34  }
void createNewProject()
Closes current project. Used in assumption that project was already saved.

References ModelView::ProjectManager::createNewProject().

Here is the call graph for this function:

Member Function Documentation

◆ createNewProject()

void ProjectManager::ProjectManagerImpl::createNewProject ( )
inline

Closes current project. Used in assumption that project was already saved.

Definition at line 37 of file projectmanager.cpp.

38  {
40  }
MVVM_MODEL_EXPORT std::unique_ptr< ProjectInterface > CreateUntitledProject(const ProjectContext &context)
Creates new untitled project.
std::unique_ptr< ProjectInterface > m_current_project

References ModelView::ProjectUtils::CreateUntitledProject().

Here is the call graph for this function:

◆ isModified()

bool ProjectManager::ProjectManagerImpl::isModified ( ) const
inline

Returns true if project has been modified after the last save.

Definition at line 58 of file projectmanager.cpp.

58 { return m_current_project->isModified(); }

◆ loadFrom()

bool ProjectManager::ProjectManagerImpl::loadFrom ( const std::string &  dirname)
inline

Loads the project from a given directory.

Definition at line 55 of file projectmanager.cpp.

55 { return m_current_project->load(dirname); }

◆ projectHasDir()

bool ProjectManager::ProjectManagerImpl::projectHasDir ( ) const
inline

Returns true if the project has directory already defined.

Definition at line 43 of file projectmanager.cpp.

43 { return !m_current_project->projectDir().empty(); }

◆ saveCurrentProject()

bool ProjectManager::ProjectManagerImpl::saveCurrentProject ( )
inline

Saves project in project directory. If directory is not defined.

Definition at line 46 of file projectmanager.cpp.

46 { return saveCurrentProjectAs(m_current_project->projectDir()); }
bool saveCurrentProjectAs(const std::string &dirname)
Saves the project into a given directory.

◆ saveCurrentProjectAs()

bool ProjectManager::ProjectManagerImpl::saveCurrentProjectAs ( const std::string &  dirname)
inline

Saves the project into a given directory.

Definition at line 49 of file projectmanager.cpp.

50  {
51  return m_current_project->save(dirname);
52  }

Member Data Documentation

◆ m_current_project

std::unique_ptr<ProjectInterface> ProjectManager::ProjectManagerImpl::m_current_project

Definition at line 28 of file projectmanager.cpp.

◆ m_project_context

ProjectContext ProjectManager::ProjectManagerImpl::m_project_context

Definition at line 29 of file projectmanager.cpp.


The documentation for this struct was generated from the following file: