#include <stellarlib/stellarlib.hpp>
#include <cassert>
#include <optional>
#include <string>
#include <vector>
using namespace stellarlib;
namespace
{
{
assert(ctx.
metadata().name() ==
"healthcheck");
assert(ctx.
metadata().version() ==
"0.1.0");
assert(ctx.
metadata().identifier() ==
"org.stellarlib.healthcheck");
assert(ctx.
metadata().creator() ==
"Domán Zana");
assert(ctx.
metadata().copyright() ==
"Copyright (C) 2025-2026 Domán Zana");
assert(ctx.
metadata().url() ==
"https://zanadoman.github.io/stellarlib/examples_2healthcheck_8cpp-example.html");
assert(ctx.
metadata().type() ==
"application");
}
{
assert(0.0F < ctx.
clock().now());
assert(ctx.
clock().target_frequency() == 60.0F);
ctx.
clock().set_target_frequency(120.0F);
assert(ctx.
clock().target_frequency() == 120.0F);
assert(ctx.
clock().max_delta() == 0.05F);
ctx.
clock().set_max_delta(0.025F);
assert(ctx.
clock().max_delta() == 0.025F);
assert(!
static_cast<bool>(ctx.
clock().delta()));
}
{
assert(ctx.
window().title() ==
"org.stellarlib.healthcheck");
ctx.
window().set_title(
"healthcheck");
assert(ctx.
window().title() ==
"healthcheck");
}
}
auto app::init(
const std::vector<std::string> &args)
-> std::optional<info>
{
assert(!args.empty());
assert(!args.front().empty());
return {{
.metadata = {
.name = "healthcheck",
.version = "0.1.0",
.identifier = "org.stellarlib.healthcheck",
.creator = "Domán Zana",
.copyright = "Copyright (C) 2025-2026 Domán Zana",
.url = "https://zanadoman.github.io/stellarlib/examples_2healthcheck_8cpp-example.html",
.type = "application"
},
.clock = {
.target_frequency = 60.0F,
.max_delta = 0.05F
},
.window = {
.title = "org.stellarlib.healthcheck"
},
.entry = [] [[nodiscard]] (context &ctx) -> auto {
check_metadata(ctx);
check_clock(ctx);
check_window(ctx);
return nullptr;
}
}};
}
Application context.
Definition context.hpp:51
auto window() const -> const app::window &
Returns a reference to the window subsystem.
auto clock() const -> const app::clock &
Returns a reference to the clock subsystem.
auto metadata() const -> const app::metadata &
Returns a reference to the metadata subsystem.
auto init(const std::vector< std::string > &args) -> std::optional< info >
External entry point (implement this for interactive applications).
Definition healthcheck.cpp:72