#include <reload_controller.hpp>
|
| struct | Baseline |
| | The version the controller compares against: the watched file's mtime and content hash it last acted on (or was seeded with). More...
|
|
| static std::optional< std::uint64_t > | content_hash (const std::filesystem::path &p) |
| | Content fingerprint used for change detection (see hash_file).
|
◆ ReloadController()
| pulp::format::reload::ReloadController::ReloadController |
( |
ReloadSession & | session, |
|
|
std::filesystem::path | logic_path, |
|
|
std::filesystem::path | stage_dir = {}, |
|
|
ReloadTrustPolicy | trust_policy = {} ) |
|
inline |
- Parameters
-
| stage_dir | where versioned copies are staged before loading; must be dlopen-safe. Defaults to the watched file's directory. |
◆ baseline()
| std::optional< Baseline > pulp::format::reload::ReloadController::baseline |
( |
| ) |
const |
|
inline |
◆ content_hash()
| std::optional< std::uint64_t > pulp::format::reload::ReloadController::content_hash |
( |
const std::filesystem::path & | p | ) |
|
|
inlinestatic |
Content fingerprint used for change detection (see hash_file).
◆ path()
| const std::filesystem::path & pulp::format::reload::ReloadController::path |
( |
| ) |
const |
|
inline |
◆ poll()
| std::optional< ReloadOutcome > pulp::format::reload::ReloadController::poll |
( |
| ) |
|
|
inline |
Poll once.
Returns the reload outcome if the file changed since the last poll (and exists), otherwise std::nullopt (no change / missing file / baseline-establishing first call).
◆ reload_attempts()
| std::uint64_t pulp::format::reload::ReloadController::reload_attempts |
( |
| ) |
const |
|
inline |
◆ reload_now()
| ReloadOutcome pulp::format::reload::ReloadController::reload_now |
( |
| ) |
|
|
inline |
Force a reload regardless of mtime (e.g.
a manual "reload now" command), and resync the baseline so the next poll() doesn't double-fire.
◆ set_baseline()
| void pulp::format::reload::ReloadController::set_baseline |
( |
const Baseline & | b | ) |
|
|
inline |
Seed the baseline with the version that is actually live, so the first poll() compares against it instead of adopting whatever the file holds by then.
The shell loads its initial logic at construction and starts polling only after prepare(); without a seed, a build that lands in that gap becomes the baseline and is never reloaded.
The documentation for this class was generated from the following file: