|
Fray Engine
|
Owns a project’s files, state stores, watcher and registered threads. Public operations synchronize their own mutable state unless they return a reference or expose queue-owned pendingStep. Opening, closing and file-change handling are intended for the project’s own thread; callers must keep borrowed references valid and coordinate their use. More...
#include <project_manager.hpp>
Classes | |
| struct | CloseStatus |
| The latest queued close and its result, once finished. More... | |
| struct | RenameStatus |
| The latest queued rename and its result, once finished. More... | |
| struct | RenameRequest |
| Rename arguments captured before the log worker suspends its session. More... | |
| struct | PendingStep |
| Undo/redo request waiting asynchronously for renderer-supplied revisions; used only on the project queue. More... | |
Public Member Functions | |
| ProjectManager ()=default | |
| Constructs an initially closed project manager. | |
| ProjectManager (const ProjectManager &)=delete | |
| Project managers cannot be copied. | |
| ProjectManager & | operator= (const ProjectManager &)=delete |
| Project managers cannot be copy-assigned. | |
| ~ProjectManager () | |
| Closes an open project or cancels a pending database choice, logging close failures. | |
| F_err | open (const std::string &path, const std::string &applicationId, files::ConflictChoice choice=files::ConflictChoice::Ask, threads::ThreadManager *threads=nullptr, std::shared_ptr< threads::TaskQueue > queue=nullptr, files::OpenMode mode=files::OpenMode::OpenOrCreate, std::optional< bool > newProjectPackageDefault=std::nullopt) |
| Opens or creates a project and its Fray state on the calling thread. Intended for the project thread; takes _mutex, acquires project files and may start watching. A database conflict leaves an open attempt pending for resolveDatabase or cancelOpen. | |
| std::vector< std::string > | databaseCandidates () const |
| Returns a locked copy of database stems offered after DATABASE_CONFLICT. | |
| F_err | resolveDatabase (const DatabaseChoice &choice) |
| Resolves a pending database conflict and finishes opening under _mutex. | |
| F_err | cancelOpen () |
| Abandons a pending database choice under _mutex, removing an extracted folder but leaving the archive untouched. | |
| void | beginOpening () |
| Marks the project as opening using an atomic flag. | |
| bool | isOpening () const |
| Returns whether the atomic opening flag is set. | |
| threads::ThreadManager::Id | registerThread (const std::string &name, std::function< void(threads::StopToken)> body) |
| Registers and starts a project-owned thread under _threadMutex. The thread is tagged with the project ID for logging; the project thread remains alive while registered threads run. | |
| void | stopThread (threads::ThreadManager::Id id) |
| Removes a thread from registration, requests its stop and joins it. Releases _threadMutex before joining; do not call from the thread being joined or while holding a lock that thread needs to exit. | |
| void | requestStopThreads () |
| Requests cooperative termination of registered project threads without joining them. | |
| bool | hasThreads () const |
| Returns whether any registered project thread is running, under _threadMutex. | |
| void | setRenameCallback (std::function< void(const std::filesystem::path &)> callback) |
| Replaces the callback invoked with the new working path after a rename. Takes _mutex; the callback runs synchronously under _mutex and must not wait for work requiring it. | |
| void | setClosingCallback (std::function< void()> callback) |
| Replaces the callback invoked at close start before packaging or deletion. Takes _mutex; the callback runs synchronously under _mutex and must not wait for work requiring it. | |
| void | setCloseDispatcher (std::function< F_err(bool)> dispatcher) |
| Installs the owner-provided asynchronous close dispatcher. | |
| void | setLogCloseBarrier (std::function< bool()> callback) |
| Installs the owner-provided project-log close barrier. | |
| watch::FileWatcher & | watcher () |
| Returns a borrowed watcher reference; its lifetime is bounded by this manager. | |
| void | restoreLock () |
| Recreates a renamed or deleted project lock while open, under _mutex. | |
| void | pump () |
| Dispatches queued watcher events on the calling thread while open, under _mutex. | |
| F_err | refreshFiles () |
| Polls the watcher and dispatches changes on the calling thread. | |
| F_err | rename (const std::string &newName) |
| Requests a project rename; managed projects complete it on their queues. | |
| std::optional< RenameStatus > | renameStatus () const |
| Reads the most recent rename state without waiting for its work. | |
| bool | isOpen () const |
| Returns whether the atomic open flag is set. | |
| std::string | name () const |
| Returns a copy of the current project name under _mutex. | |
| std::string | id () const |
| Returns a copy of the persistent project ID under _mutex. | |
| std::string | applicationId () const |
| Returns a copy of the application identifier under _mutex. | |
| files::FileManager & | fileManager () |
| Returns a borrowed file manager reference; callers must coordinate access and lifetime. | |
| F_err | openState (const std::string &name) |
| Opens a named state store if not already open, under _mutex. | |
| state::StateManager & | state (const std::string &name) |
| Returns a borrowed reference to an open named state store under _mutex. The reference is invalidated when its store is replaced or the project closes; coordinate its lifetime with project operations. | |
| history::HistoryManager | history () |
| Returns a history manager borrowing the open Fray state store. | |
| template<typename T> | |
| F_err | set (const std::string &key, const T &value) |
| Writes Fray state under _mutex; project.info.name instead requests a project rename. | |
| template<typename T> | |
| F_err | get (const std::string &key, T &value) |
| Reads Fray state under _mutex. | |
| ProjectMessageResult | handleProjectMessage (const message::InData &incoming) |
| Handles a close, layout-change or history-step message on the selected project queue. May mutate state or return an asynchronous history request rather than waiting for the renderer. | |
| F_err | close (bool forcePackage=false) |
| Requests a project close without waiting for it to finish. Keep a standalone project alive until closeStatus() reports completion. | |
| std::optional< CloseStatus > | closeStatus () const |
| Reads the most recent direct or managed close state. | |
Static Public Member Functions | |
| static bool | validProjectName (const std::string &name) |
| Checks whether a project name is a safe single relative component without a .fry suffix. | |
Public Attributes | |
| std::optional< PendingStep > | pendingStep |
| Pending asynchronous history step, accessed only on the project queue. | |
Private Member Functions | |
| std::string | locateDatabase (const std::filesystem::path &folder) const |
| Finds the database by its recorded file identity, including after a rename. Caller must hold _mutex. | |
| F_err | prepareDatabase () |
| Selects, snapshots or adopts a project database before opening state. Caller must hold _mutex; multiple valid candidates leave a choice pending. | |
| void | abandon (bool removeExtracted) |
| Rolls back an unsuccessful open, releases files and clears pending state. Caller must hold _mutex; cleanup failures are logged. | |
| F_err | reassignProjectId (const std::string &id) |
| Persists a replacement identity for an open copied project. | |
| F_err | applyDefaults (state::StateManager &state) |
| Adds missing application and project defaults without replacing existing settings. Caller must hold _mutex. | |
| F_err | finishOpen () |
| Opens Fray state, applies defaults, commits conflict resolution and starts watching. Caller must hold _mutex; failure abandons the open attempt. | |
| void | startWatching () |
| Watches the project folder and, when configured, starts a watcher thread that posts to the project queue. Caller must hold _mutex; watch failures are logged. | |
| void | stopWatching () |
| Stops and joins the watcher thread, removes its subscription and unwatches the folder. Called during close under _mutex; joining waits for the watcher thread to exit. | |
| F_err | startRename (RenameRequest request) |
| Starts a rename while holding _mutex, or applies it directly for a standalone project. | |
| void | finishRename (F_err result) |
| Records the result of a queued rename. | |
| void | replayRenameChanges () |
| Replays watcher changes received while a rename was in progress. | |
| RenameRequest | refreshRenameRequest (RenameRequest request) |
| Updates a queued rename for folder moves observed while its log was suspended. Caller holds _mutex. | |
| void | onChange (const watch::Change &change) |
| Handles project folder and database rename events on the dispatching thread. Takes _mutex and may rename project resources. | |
| F_err | applyName (const std::string &newName, const std::filesystem::path &workspace, bool renameFolder, std::string databaseStem) |
| Coordinates project folder, database, lock, archive and stored-name changes. Caller must hold _mutex; locks each state store, closes and reopens connections, holds the watcher, and invokes the rename callback under _mutex. File failures trigger rollback attempts. | |
| F_err | closeNow (bool forcePackage=false, bool *packaged=nullptr, bool leaveWorkingFolder=false) |
| Stops watching, closes stores and releases or packages the project under _mutex. Intended for the project thread; invokes the closing callback before packaging or deletion. Failed closes can be retried. | |
Static Private Member Functions | |
| static bool | looksLikeFrayDatabase (const std::filesystem::path &path) |
| Checks read-only for the current Fray state table and its key, type and value columns. | |
| static std::vector< std::string > | databaseFiles (const std::filesystem::path &folder) |
| Lists sorted stems of nonsymlink regular .sqlite files in a folder. | |
| template<typename T> | |
| static F_err | setDefault (state::StateManager &state, const std::string &key, const T &value) |
| Writes a default only if the state key is absent. Runs on the opening thread through the state manager. | |
| static std::string | newProjectId () |
| Generates a hexadecimal project identifier from random-device values. | |
Private Attributes | |
| std::recursive_mutex | _mutex |
| Protects project lifecycle, state map, file operations and callbacks; recursive for nested operations. | |
| files::FileManager | _files |
| Owns project paths, lock and archive operations, normally guarded by _mutex. | |
| std::unordered_map< std::string, std::unique_ptr< state::StateManager > > | _states |
| Owns named state stores; map and lifetimes are guarded by _mutex. | |
| std::string | _applicationId |
| Application identifier used when opening state stores, guarded by _mutex. | |
| std::string | _projectId |
| Persistent project identifier used for logging and identity, guarded by _mutex. | |
| std::atomic< bool > | _open {false} |
| Whether a project is open, readable without _mutex. | |
| std::atomic< bool > | _opening {false} |
| Whether an opening attempt is in progress, readable without _mutex. | |
| std::atomic< bool > | _closePending {false} |
| Whether a managed close has been queued, readable without _mutex. | |
| bool | _closing = false |
| Whether close has begun and can be retried, guarded by _mutex. | |
| bool | _packageOnClose = false |
| Whether the current close attempt packages the project, guarded by _mutex. | |
| std::optional< bool > | _newProjectPackageDefault |
| Packaging default captured for a newly created project. | |
| bool | _archiveComplete = false |
| Whether packaging already succeeded during a retriable close, guarded by _mutex. | |
| bool | _pendingDatabase = false |
| Whether opening awaits a database choice, guarded by _mutex. | |
| std::vector< std::string > | _candidates |
| Candidate database stems for a pending choice, guarded by _mutex. | |
| watch::FileWatcher | _watcher |
| Owns project folder watching and dispatch. | |
| watch::FileId | _databaseId |
| File identity used to recognize the project database across renames, guarded by _mutex. | |
| watch::FileWatcher::Subscription | _subscription = 0 |
| Watcher subscription for project changes, or zero when absent. | |
| threads::ThreadManager * | _threads = nullptr |
| Non-owning thread manager supplied at open; it must outlive registered threads. | |
| std::shared_ptr< threads::TaskQueue > | _queue |
| Shared project queue used to post watcher work. | |
| std::mutex | _threadMutex |
| Protects registered-thread bookkeeping and thread-manager access in thread methods. | |
| std::vector< threads::ThreadManager::Id > | _registered |
| IDs registered for this project, guarded by _threadMutex. | |
| threads::ThreadManager::Id | _watcherThread = 0 |
| Registered watcher thread ID, or zero when none exists. | |
| std::function< void(const std::filesystem::path &)> | _onRenamed |
| Owned callback invoked with the new working path while _mutex is held. | |
| std::function< void()> | _onClosing |
| Owned callback invoked when close starts while _mutex is held. | |
| std::function< bool()> | _prepareLogClose |
| Coordinates the owned log session before project files are closed or packaged. | |
| std::function< bool(RenameRequest)> | _renameDispatcher |
| Dispatches a managed rename to its log and project queues. | |
| std::mutex | _renameStatusMutex |
| Protects the observable rename status. | |
| std::optional< RenameStatus > | _renameStatus |
| Latest managed or standalone rename state, guarded by _renameStatusMutex. | |
| std::atomic< bool > | _renamePending {false} |
| True while a managed rename is in progress. | |
| std::vector< watch::Change > | _renameChanges |
| Watcher changes received while a rename is pending, guarded by _mutex. | |
| std::mutex | _closeDispatchMutex |
| Protects the close dispatcher and the standalone close worker. | |
| std::function< F_err(bool)> | _closeDispatcher |
| Manager-provided dispatcher for closing an owned project. | |
| std::optional< CloseStatus > | _closeStatus |
| Latest close state, guarded by _closeDispatchMutex. | |
| std::shared_ptr< threads::TaskQueue > | _standaloneCloseQueue |
| Queue used for asynchronous closes of standalone projects. | |
| std::thread | _standaloneCloseThread |
| Worker draining the standalone close queue. | |
Friends | |
| class | FrayManager |
Owns a project’s files, state stores, watcher and registered threads. Public operations synchronize their own mutable state unless they return a reference or expose queue-owned pendingStep. Opening, closing and file-change handling are intended for the project’s own thread; callers must keep borrowed references valid and coordinate their use.
Definition at line 66 of file project_manager.hpp.
|
default |
Constructs an initially closed project manager.
|
delete |
Project managers cannot be copied.
|
inline |
Closes an open project or cancels a pending database choice, logging close failures.
Definition at line 820 of file project_manager.hpp.
|
inlineprivate |
Rolls back an unsuccessful open, releases files and clears pending state. Caller must hold _mutex; cleanup failures are logged.
| removeExtracted | Whether to remove an extracted working folder. |
Definition at line 324 of file project_manager.hpp.
|
inline |
Returns a copy of the application identifier under _mutex.
Definition at line 1286 of file project_manager.hpp.
|
inlineprivate |
Adds missing application and project defaults without replacing existing settings. Caller must hold _mutex.
| state | Open Fray state store. |
Definition at line 401 of file project_manager.hpp.
|
inlineprivate |
Coordinates project folder, database, lock, archive and stored-name changes. Caller must hold _mutex; locks each state store, closes and reopens connections, holds the watcher, and invokes the rename callback under _mutex. File failures trigger rollback attempts.
| newName | Desired project name. |
| workspace | Current folder path, including an externally renamed folder. |
| renameFolder | True to rename the folder; false if it was already renamed externally. |
| databaseStem | Current database stem, or empty to locate it by identity. |
Definition at line 694 of file project_manager.hpp.
|
inline |
Marks the project as opening using an atomic flag.
Definition at line 1044 of file project_manager.hpp.
|
inline |
Abandons a pending database choice under _mutex, removing an extracted folder but leaving the archive untouched.
Definition at line 1029 of file project_manager.hpp.
|
inline |
Requests a project close without waiting for it to finish. Keep a standalone project alive until closeStatus() reports completion.
| forcePackage | Force packaging regardless of the stored preference. |
Definition at line 1414 of file project_manager.hpp.
|
inlineprivate |
Stops watching, closes stores and releases or packages the project under _mutex. Intended for the project thread; invokes the closing callback before packaging or deletion. Failed closes can be retried.
| forcePackage | Force packaging regardless of the stored preference. |
| packaged | Optional output set on success to whether packaging occurred. |
| leaveWorkingFolder | Ignore the stored packaging preference when rejecting a restored identity. |
Definition at line 1480 of file project_manager.hpp.
|
inline |
Reads the most recent direct or managed close state.
Definition at line 1465 of file project_manager.hpp.
|
inline |
Returns a locked copy of database stems offered after DATABASE_CONFLICT.
Definition at line 988 of file project_manager.hpp.
|
inlinestaticprivate |
Lists sorted stems of nonsymlink regular .sqlite files in a folder.
| folder | Directory to inspect. |
Definition at line 252 of file project_manager.hpp.
|
inline |
Returns a borrowed file manager reference; callers must coordinate access and lifetime.
Definition at line 1294 of file project_manager.hpp.
|
inlineprivate |
Opens Fray state, applies defaults, commits conflict resolution and starts watching. Caller must hold _mutex; failure abandons the open attempt.
Definition at line 435 of file project_manager.hpp.
|
inlineprivate |
Records the result of a queued rename.
| result | Rename or dispatch result. |
Definition at line 580 of file project_manager.hpp.
|
inline |
Reads Fray state under _mutex.
| T | Expected value type. |
| key | State key to read. |
| value | Output receiving the decoded value. |
Definition at line 1385 of file project_manager.hpp.
|
inline |
Handles a close, layout-change or history-step message on the selected project queue. May mutate state or return an asynchronous history request rather than waiting for the renderer.
Handles a close, layout change, or history step on the project queue. May close the project, record layout history, or resume a pending step; rejects protocol notifications.
| incoming | Incoming framed request and payload. |
Definition at line 218 of file project_message_handler.hpp.
|
inline |
Returns whether any registered project thread is running, under _threadMutex.
Definition at line 1106 of file project_manager.hpp.
|
inline |
Returns a history manager borrowing the open Fray state store.
| std::out_of_range | If Fray state is not open; the returned manager must not outlive that store. |
Definition at line 1342 of file project_manager.hpp.
|
inline |
Returns a copy of the persistent project ID under _mutex.
Definition at line 1252 of file project_manager.hpp.
|
inline |
Returns whether the atomic open flag is set.
Definition at line 1240 of file project_manager.hpp.
|
inline |
Returns whether the atomic opening flag is set.
Definition at line 1048 of file project_manager.hpp.
|
inlineprivate |
Finds the database by its recorded file identity, including after a rename. Caller must hold _mutex.
| folder | Current project working folder. |
Definition at line 277 of file project_manager.hpp.
|
inlinestaticprivate |
Checks read-only for the current Fray state table and its key, type and value columns.
| path | Database file to inspect. |
Definition at line 228 of file project_manager.hpp.
|
inline |
Returns a copy of the current project name under _mutex.
Definition at line 1244 of file project_manager.hpp.
|
inlinestaticprivate |
Generates a hexadecimal project identifier from random-device values.
Definition at line 365 of file project_manager.hpp.
|
inlineprivate |
Handles project folder and database rename events on the dispatching thread. Takes _mutex and may rename project resources.
| change | Watcher event to inspect. |
Definition at line 640 of file project_manager.hpp.
|
inline |
Opens or creates a project and its Fray state on the calling thread. Intended for the project thread; takes _mutex, acquires project files and may start watching. A database conflict leaves an open attempt pending for resolveDatabase or cancelOpen.
| path | Project path to open or create. |
| applicationId | Application identifier stored with state. |
| choice | How to resolve a folder/archive conflict. |
| threads | Optional borrowed thread manager, which must outlive its registered threads. |
| queue | Optional shared project queue for watcher notifications. |
| mode | Whether and how to open or create the project. |
| newProjectPackageDefault | Optional application default used only for a newly created project. |
Definition at line 844 of file project_manager.hpp.
|
inline |
Opens a named state store if not already open, under _mutex.
| name | State namespace to open. |
Definition at line 1301 of file project_manager.hpp.
|
delete |
Project managers cannot be copy-assigned.
|
inlineprivate |
Selects, snapshots or adopts a project database before opening state. Caller must hold _mutex; multiple valid candidates leave a choice pending.
Definition at line 295 of file project_manager.hpp.
|
inline |
Dispatches queued watcher events on the calling thread while open, under _mutex.
Definition at line 1181 of file project_manager.hpp.
|
inlineprivate |
Persists a replacement identity for an open copied project.
| id | New reserved project identity. |
Definition at line 380 of file project_manager.hpp.
|
inline |
Polls the watcher and dispatches changes on the calling thread.
Definition at line 1192 of file project_manager.hpp.
|
inlineprivate |
Updates a queued rename for folder moves observed while its log was suspended. Caller holds _mutex.
| request | Original rename request. |
Definition at line 604 of file project_manager.hpp.
|
inline |
Registers and starts a project-owned thread under _threadMutex. The thread is tagged with the project ID for logging; the project thread remains alive while registered threads run.
| name | Thread name suffix, prefixed with the project name. |
| body | Owned thread function receiving its stop token. |
Definition at line 1057 of file project_manager.hpp.
|
inline |
Requests a project rename; managed projects complete it on their queues.
| newName | Desired project name. |
Definition at line 1204 of file project_manager.hpp.
|
inline |
Reads the most recent rename state without waiting for its work.
Definition at line 1231 of file project_manager.hpp.
|
inlineprivate |
Replays watcher changes received while a rename was in progress.
Definition at line 589 of file project_manager.hpp.
|
inline |
Requests cooperative termination of registered project threads without joining them.
Definition at line 1095 of file project_manager.hpp.
|
inline |
Resolves a pending database conflict and finishes opening under _mutex.
| choice | Candidate to adopt or instruction to create a new database. |
Definition at line 999 of file project_manager.hpp.
|
inline |
Recreates a renamed or deleted project lock while open, under _mutex.
Definition at line 1171 of file project_manager.hpp.
|
inline |
Writes Fray state under _mutex; project.info.name instead requests a project rename.
| T | Value type supported by the state store. |
| key | State key to write. |
| value | Value to persist; project.info.name requires a string-convertible value. |
Definition at line 1355 of file project_manager.hpp.
|
inline |
Installs the owner-provided asynchronous close dispatcher.
| dispatcher | Function accepting the forced-package flag and returning the dispatch result. |
Definition at line 1145 of file project_manager.hpp.
|
inline |
Replaces the callback invoked at close start before packaging or deletion. Takes _mutex; the callback runs synchronously under _mutex and must not wait for work requiring it.
| callback | Owned callback, or empty to disable notification. |
Definition at line 1134 of file project_manager.hpp.
|
inlinestaticprivate |
Writes a default only if the state key is absent. Runs on the opening thread through the state manager.
| T | Type of the default value. |
| state | Open state store. |
| key | Setting to check. |
| value | Default to write if absent. |
Definition at line 349 of file project_manager.hpp.
|
inline |
Installs the owner-provided project-log close barrier.
| callback | Function returning true only when the log session is safely closed. |
Definition at line 1156 of file project_manager.hpp.
|
inline |
Replaces the callback invoked with the new working path after a rename. Takes _mutex; the callback runs synchronously under _mutex and must not wait for work requiring it.
| callback | Owned callback, or empty to disable notification. |
Definition at line 1122 of file project_manager.hpp.
|
inlineprivate |
Starts a rename while holding _mutex, or applies it directly for a standalone project.
| request | Captured project and filesystem rename details. |
Definition at line 535 of file project_manager.hpp.
|
inlineprivate |
Watches the project folder and, when configured, starts a watcher thread that posts to the project queue. Caller must hold _mutex; watch failures are logged.
Definition at line 484 of file project_manager.hpp.
|
inline |
Returns a borrowed reference to an open named state store under _mutex. The reference is invalidated when its store is replaced or the project closes; coordinate its lifetime with project operations.
| name | State namespace to look up. |
| std::out_of_range | If the project or named store is not open. |
Definition at line 1328 of file project_manager.hpp.
|
inline |
Removes a thread from registration, requests its stop and joins it. Releases _threadMutex before joining; do not call from the thread being joined or while holding a lock that thread needs to exit.
| id | Registered thread ID to stop and join. |
Definition at line 1079 of file project_manager.hpp.
|
inlineprivate |
Stops and joins the watcher thread, removes its subscription and unwatches the folder. Called during close under _mutex; joining waits for the watcher thread to exit.
Definition at line 514 of file project_manager.hpp.
|
inlinestatic |
Checks whether a project name is a safe single relative component without a .fry suffix.
| name | Proposed project name. |
Definition at line 90 of file project_manager.hpp.
|
inline |
Returns a borrowed watcher reference; its lifetime is bounded by this manager.
Definition at line 1166 of file project_manager.hpp.
|
friend |
Definition at line 68 of file project_manager.hpp.
|
private |
Application identifier used when opening state stores, guarded by _mutex.
Definition at line 114 of file project_manager.hpp.
|
private |
Whether packaging already succeeded during a retriable close, guarded by _mutex.
Definition at line 142 of file project_manager.hpp.
|
private |
Candidate database stems for a pending choice, guarded by _mutex.
Definition at line 150 of file project_manager.hpp.
|
private |
Manager-provided dispatcher for closing an owned project.
Definition at line 215 of file project_manager.hpp.
|
mutableprivate |
Protects the close dispatcher and the standalone close worker.
Definition at line 213 of file project_manager.hpp.
|
private |
Whether a managed close has been queued, readable without _mutex.
Definition at line 128 of file project_manager.hpp.
|
private |
Latest close state, guarded by _closeDispatchMutex.
Definition at line 217 of file project_manager.hpp.
|
private |
Whether close has begun and can be retried, guarded by _mutex.
Definition at line 132 of file project_manager.hpp.
|
private |
File identity used to recognize the project database across renames, guarded by _mutex.
Definition at line 159 of file project_manager.hpp.
|
private |
Owns project paths, lock and archive operations, normally guarded by _mutex.
Definition at line 106 of file project_manager.hpp.
|
mutableprivate |
Protects project lifecycle, state map, file operations and callbacks; recursive for nested operations.
Definition at line 102 of file project_manager.hpp.
|
private |
Packaging default captured for a newly created project.
Definition at line 138 of file project_manager.hpp.
|
private |
Owned callback invoked when close starts while _mutex is held.
Definition at line 191 of file project_manager.hpp.
|
private |
Owned callback invoked with the new working path while _mutex is held.
Definition at line 187 of file project_manager.hpp.
|
private |
Whether a project is open, readable without _mutex.
Definition at line 122 of file project_manager.hpp.
|
private |
Whether an opening attempt is in progress, readable without _mutex.
Definition at line 126 of file project_manager.hpp.
|
private |
Whether the current close attempt packages the project, guarded by _mutex.
Definition at line 136 of file project_manager.hpp.
|
private |
Whether opening awaits a database choice, guarded by _mutex.
Definition at line 146 of file project_manager.hpp.
|
private |
Coordinates the owned log session before project files are closed or packaged.
Definition at line 193 of file project_manager.hpp.
|
private |
Persistent project identifier used for logging and identity, guarded by _mutex.
Definition at line 118 of file project_manager.hpp.
|
private |
Shared project queue used to post watcher work.
Definition at line 171 of file project_manager.hpp.
|
private |
IDs registered for this project, guarded by _threadMutex.
Definition at line 179 of file project_manager.hpp.
|
private |
Watcher changes received while a rename is pending, guarded by _mutex.
Definition at line 211 of file project_manager.hpp.
|
private |
Dispatches a managed rename to its log and project queues.
Definition at line 203 of file project_manager.hpp.
|
private |
True while a managed rename is in progress.
Definition at line 209 of file project_manager.hpp.
|
private |
Latest managed or standalone rename state, guarded by _renameStatusMutex.
Definition at line 207 of file project_manager.hpp.
|
mutableprivate |
Protects the observable rename status.
Definition at line 205 of file project_manager.hpp.
|
private |
Queue used for asynchronous closes of standalone projects.
Definition at line 219 of file project_manager.hpp.
|
private |
Worker draining the standalone close queue.
Definition at line 221 of file project_manager.hpp.
|
private |
Owns named state stores; map and lifetimes are guarded by _mutex.
Definition at line 110 of file project_manager.hpp.
|
private |
Watcher subscription for project changes, or zero when absent.
Definition at line 163 of file project_manager.hpp.
|
mutableprivate |
Protects registered-thread bookkeeping and thread-manager access in thread methods.
Definition at line 175 of file project_manager.hpp.
|
private |
Non-owning thread manager supplied at open; it must outlive registered threads.
Definition at line 167 of file project_manager.hpp.
|
private |
Owns project folder watching and dispatch.
Definition at line 155 of file project_manager.hpp.
|
private |
Registered watcher thread ID, or zero when none exists.
Definition at line 183 of file project_manager.hpp.
| std::optional<PendingStep> fray::ProjectManager::pendingStep |
Pending asynchronous history step, accessed only on the project queue.
Definition at line 1281 of file project_manager.hpp.