FOSSredder 0.5.0
Loading...
Searching...
No Matches
core::application::WorkspaceSession Class Reference

Maintains the editable app state for one workspace and persists it through IStorageManager. More...

#include <WorkspaceSession.h>

Public Types

using StateChanged = std::function<void(const core::application::workspace::WorkspaceSessionState&)>

Public Member Functions

 WorkspaceSession (std::unique_ptr< core::ports::storage::IStorageManager > storageManager)
 Creates a session over an existing storage manager.
const core::application::workspace::WorkspaceSessionState & state () const noexcept
core::application::workspace::WorkspaceSessionState & mutableState () noexcept
const core::domain::catalog::WorkspaceCatalog & catalogState () const noexcept
core::domain::catalog::WorkspaceCatalog & mutableCatalogState () noexcept
const std::string & currentPath () const noexcept
void setStateChangedCallback (StateChanged cb)
void setErrorReporter (std::shared_ptr< core::ports::diagnostics::IErrorReporter > reporter)
void setAtomicStoreSave (core::ports::storage::IStorageManager::AtomicStoreSave saveFn)
void setAtomicStoreLoad (core::ports::storage::IStorageManager::AtomicStoreLoad loadFn)
void setDeletionImpactCallback (core::ports::storage::IStorageManager::DeletionImpactCallback cb)
void openLatest ()
void newFile (const std::string &path)
void openFile (const std::string &path)
void saveFile ()
void saveFileAs (const std::string &path)
void commit ()
 Persists the session when a file is open and notifies listeners.
void notifyState ()

Detailed Description

Maintains the editable app state for one workspace and persists it through IStorageManager.

Definition at line 23 of file WorkspaceSession.h.

Member Typedef Documentation

◆ StateChanged

Constructor & Destructor Documentation

◆ WorkspaceSession()

core::application::WorkspaceSession::WorkspaceSession ( std::unique_ptr< core::ports::storage::IStorageManager > storageManager)
explicit

Creates a session over an existing storage manager.

Exceptions
std::invalid_argumentwhen storageManager is null.

Definition at line 12 of file WorkspaceSession.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ catalogState()

const core::domain::catalog::WorkspaceCatalog & core::application::WorkspaceSession::catalogState ( ) const
inlinenoexcept

Definition at line 35 of file WorkspaceSession.h.

◆ commit()

void core::application::WorkspaceSession::commit ( )

Persists the session when a file is open and notifies listeners.

Definition at line 100 of file WorkspaceSession.cpp.

Here is the call graph for this function:

◆ currentPath()

const std::string & core::application::WorkspaceSession::currentPath ( ) const
noexcept

Definition at line 21 of file WorkspaceSession.cpp.

◆ mutableCatalogState()

core::domain::catalog::WorkspaceCatalog & core::application::WorkspaceSession::mutableCatalogState ( )
inlinenoexcept

Definition at line 36 of file WorkspaceSession.h.

◆ mutableState()

core::application::workspace::WorkspaceSessionState & core::application::WorkspaceSession::mutableState ( )
inlinenoexcept

Definition at line 34 of file WorkspaceSession.h.

◆ newFile()

void core::application::WorkspaceSession::newFile ( const std::string & path)

Definition at line 74 of file WorkspaceSession.cpp.

Here is the call graph for this function:

◆ notifyState()

void core::application::WorkspaceSession::notifyState ( )

Definition at line 115 of file WorkspaceSession.cpp.

Here is the caller graph for this function:

◆ openFile()

void core::application::WorkspaceSession::openFile ( const std::string & path)

Definition at line 80 of file WorkspaceSession.cpp.

Here is the call graph for this function:

◆ openLatest()

void core::application::WorkspaceSession::openLatest ( )

Definition at line 56 of file WorkspaceSession.cpp.

Here is the call graph for this function:

◆ saveFile()

void core::application::WorkspaceSession::saveFile ( )

Definition at line 92 of file WorkspaceSession.cpp.

◆ saveFileAs()

void core::application::WorkspaceSession::saveFileAs ( const std::string & path)

Definition at line 96 of file WorkspaceSession.cpp.

◆ setAtomicStoreLoad()

void core::application::WorkspaceSession::setAtomicStoreLoad ( core::ports::storage::IStorageManager::AtomicStoreLoad loadFn)

Definition at line 37 of file WorkspaceSession.cpp.

◆ setAtomicStoreSave()

void core::application::WorkspaceSession::setAtomicStoreSave ( core::ports::storage::IStorageManager::AtomicStoreSave saveFn)

Definition at line 33 of file WorkspaceSession.cpp.

◆ setDeletionImpactCallback()

void core::application::WorkspaceSession::setDeletionImpactCallback ( core::ports::storage::IStorageManager::DeletionImpactCallback cb)

Definition at line 41 of file WorkspaceSession.cpp.

Here is the caller graph for this function:

◆ setErrorReporter()

void core::application::WorkspaceSession::setErrorReporter ( std::shared_ptr< core::ports::diagnostics::IErrorReporter > reporter)

Definition at line 29 of file WorkspaceSession.cpp.

◆ setStateChangedCallback()

void core::application::WorkspaceSession::setStateChangedCallback ( StateChanged cb)

Definition at line 25 of file WorkspaceSession.cpp.

◆ state()

const core::application::workspace::WorkspaceSessionState & core::application::WorkspaceSession::state ( ) const
inlinenoexcept

Definition at line 33 of file WorkspaceSession.h.


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