diff options
author | 2017-09-12 11:29:37 +0200 | |
---|---|---|
committer | 2017-09-12 11:29:37 +0200 | |
commit | 78d6f15eadfdc6d2d4a166e0e559ebad0a34723e (patch) | |
tree | b0aeca2557da7adff53d6a6d1ee92031f05c4a33 /src/app.cpp | |
parent | 6a10feaafbe80f7c3738535dfd7ca97f00e1f405 (diff) |
App: make a couple of methods private to signal internal use
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/app.cpp')
-rw-r--r-- | src/app.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/app.cpp b/src/app.cpp index e58c85d..cf7b6be 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -169,6 +169,23 @@ int App::dispatch_pending_events() { return -1; } +bool App::pop_pending_events() { + bool x{true}; + return this->pending_events.compare_exchange_strong( + x, false, std::memory_order_consume); +} + +void App::set_pending_events() { + this->pending_events.store(true, std::memory_order_release); +} + +optional<int> App::lookup_id(char const *name) { + return this->id_alloc.lookup(std::string(name)); +} +optional<std::string> App::lookup_name(int id) { + return this->id_alloc.lookup(id); +} + // _ _ _ _ _ ____ // (_)_ __ (_) |_ | | __ _ _ _ ___ _ _| |_ / /\ \ // | | '_ \| | __| | |/ _` | | | |/ _ \| | | | __| | | | @@ -587,6 +604,10 @@ char const *App::api_enddraw(char const *drawing_name) { return "No EndDraw pending for surface"; } +void App::api_ping() { + this->dispatch_pending_events(); +} + // _ _ _____ _ // _ __ _ __ _____ _(_) ___ __| | | ____|_ _____ _ __ | |_ ___ // | '_ \| '__/ _ \ \/ / |/ _ \/ _` | | _| \ \ / / _ \ '_ \| __/ __| |