µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os-flags.h
Go to the documentation of this file.
1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2016-2025 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software
6 * for any purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can
9 * be obtained from https://opensource.org/licenses/mit.
10 */
11
12#ifndef CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_
13#define CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_
14
15// ----------------------------------------------------------------------------
16
17#ifdef __cplusplus
18
19// ----------------------------------------------------------------------------
20
22
24
25// ----------------------------------------------------------------------------
26
27#pragma GCC diagnostic push
28#if defined(__clang__)
29#pragma clang diagnostic ignored "-Wc++98-compat"
30#endif
31
32// ----------------------------------------------------------------------------
33
34namespace os
35{
36 namespace rtos
37 {
38 namespace internal
39 {
40
41 // ======================================================================
42
47 {
48
49 public:
58 event_flags () = default;
59
64 event_flags (const event_flags&) = delete;
65 event_flags (event_flags&&) = delete;
67 operator= (const event_flags&)
68 = delete;
70 operator= (event_flags&&)
71 = delete;
72
80 ~event_flags () = default;
81
86 public:
103
115 bool
117 flags::mode_t mode);
118
128
139
145 mask (void);
146
151 protected:
164 flags::mask_t volatile flags_mask_ = 0;
165
173 };
174 /* class event_flags */
175
176 // ----------------------------------------------------------------------
177 } /* namespace internal */
178 } /* namespace rtos */
179} /* namespace os */
180
181namespace os
182{
183 namespace rtos
184 {
185 namespace internal
186 {
187
188 inline flags::mask_t
190 {
191 return flags_mask_;
192 }
193
194 // ----------------------------------------------------------------------
195 } /* namespace internal */
196 } /* namespace rtos */
197} /* namespace os */
198
199#pragma GCC diagnostic pop
200
201// ----------------------------------------------------------------------------
202
203#endif /* __cplusplus */
204
205// ----------------------------------------------------------------------------
206
207#endif /* CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_ */
Internal event flags implementation.
Definition os-flags.h:47
result_t raise(flags::mask_t mask, flags::mask_t *oflags)
Raise event flags.
Definition os-flags.cpp:33
flags::mask_t get(flags::mask_t mask, flags::mode_t mode)
Get (and possibly clear) event flags.
Definition os-flags.cpp:113
bool check_raised(flags::mask_t mask, flags::mask_t *oflags, flags::mode_t mode)
Check if expected flags are raised.
Definition os-flags.cpp:63
result_t clear(flags::mask_t mask, flags::mask_t *oflags)
Clear event flags.
Definition os-flags.cpp:149
~event_flags()=default
Destruct the internal event flags object instance.
event_flags()=default
Construct an internal event flags object instance.
flags::mask_t mask(void)
Get the flags mask.
Definition os-flags.h:189
uint32_t mode_t
Type of variables holding flags modes.
Definition os-decls.h:277
uint32_t mask_t
Type of variables holding flags masks.
Definition os-decls.h:266
uint32_t result_t
Type of values returned by RTOS functions.
Definition os-decls.h:95
System namespace.