µ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++ distribution.
3 * (https://github.com/micro-os-plus)
4 * Copyright (c) 2016-2023 Liviu Ionescu. All rights reserved.
5 *
6 * Permission to use, copy, modify, and/or distribute this software
7 * for any purpose is hereby granted, under the terms of the MIT license.
8 *
9 * If a copy of the license was not distributed with this file, it can
10 * be obtained from https://opensource.org/licenses/mit/.
11 */
12
13#ifndef CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_
14#define CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_
15
16// ----------------------------------------------------------------------------
17
18#ifdef __cplusplus
19
20// ----------------------------------------------------------------------------
21
23
25
26// ----------------------------------------------------------------------------
27
28#pragma GCC diagnostic push
29#if defined(__clang__)
30#pragma clang diagnostic ignored "-Wc++98-compat"
31#endif
32
33// ----------------------------------------------------------------------------
34
35namespace os
36{
37 namespace rtos
38 {
39 namespace internal
40 {
41
42 // ======================================================================
43
48 {
49
50 public:
51
60 event_flags () = default;
61
66 event_flags (const event_flags&) = delete;
67 event_flags (event_flags&&) = delete;
69 operator= (const event_flags&) = delete;
71 operator= (event_flags&&) = delete;
72
80 ~event_flags () = default;
81
86 public:
87
104
116 bool
118 flags::mode_t mode);
119
129
140
146 mask (void);
147
152 protected:
153
166 flags::mask_t volatile flags_mask_ = 0;
167
176 };
177 /* class event_flags */
178
179 // ------------------------------------------------------------------------
180 } /* namespace internal */
181 } /* namespace rtos */
182} /* namespace os */
183
184namespace os
185{
186 namespace rtos
187 {
188 namespace internal
189 {
190
191 inline flags::mask_t
193 {
194 return flags_mask_;
195 }
196
197 // ------------------------------------------------------------------------
198 } /* namespace internal */
199 } /* namespace rtos */
200} /* namespace os */
201
202#pragma GCC diagnostic pop
203
204// ----------------------------------------------------------------------------
205
206#endif /* __cplusplus */
207
208// ----------------------------------------------------------------------------
209
210#endif /* CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_ */
Internal event flags implementation.
Definition os-flags.h:48
result_t raise(flags::mask_t mask, flags::mask_t *oflags)
Raise event flags.
Definition os-flags.cpp:34
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:64
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:192
uint32_t mode_t
Type of variables holding flags modes.
Definition os-decls.h:275
uint32_t mask_t
Type of variables holding flags masks.
Definition os-decls.h:265
uint32_t result_t
Type of values returned by RTOS functions.
Definition os-decls.h:96
System namespace.