Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
selectables.h
Go to the documentation of this file.
1// Copyright 2026 The Action Engine Authors and the Symbian SDK Authors.
2// Licensed under the Apache License, Version 2.0.
3// Adapted from A11 cpp/thread/thread/selectables.h at
4// fcccb8cb6e1e67d7ba0822ac14cece9ee4c7091b.
5
6#ifndef THREAD_FIBER_SELECTABLES_H_
7#define THREAD_FIBER_SELECTABLES_H_
8
9#include <atomic>
10
11#include "thread/cases.h"
12
13namespace thread {
14
15class PermanentEvent final : public internal::Selectable {
16 public:
17 PermanentEvent() = default;
20 ~PermanentEvent() override;
21
22 void Notify();
23 bool HasBeenNotified() const;
24
25 Case OnEvent() const { return {const_cast<PermanentEvent*>(this)}; }
26
27 bool Handle(internal::CaseInSelectClause* case_state, bool enqueue) override;
28 void Unregister(internal::CaseInSelectClause* case_state) override;
29
30 private:
31 mutable Mutex mu_;
32 std::atomic<bool> notified_{false};
33 internal::CaseInSelectClause* cases_to_be_selected_ = nullptr;
34};
35
38
39} // namespace thread
40
41#endif // THREAD_FIBER_SELECTABLES_H_
Definition boost_primitives.h:34
Definition selectables.h:15
PermanentEvent & operator=(const PermanentEvent &)=delete
bool HasBeenNotified() const
Definition selectables.cc:65
PermanentEvent(const PermanentEvent &)=delete
void Notify()
Definition selectables.cc:41
~PermanentEvent() override
Definition selectables.cc:14
void Unregister(internal::CaseInSelectClause *case_state) override
Definition selectables.cc:34
bool Handle(internal::CaseInSelectClause *case_state, bool enqueue) override
Definition selectables.cc:21
Case OnEvent() const
Definition selectables.h:25
Definition channel.h:29
Case NonSelectableCase()
Definition selectables.cc:91
Case AlwaysSelectableCase()
Definition selectables.cc:95
A Case represents a selectable case in a Select statement.
Definition cases.h:55