µ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 Liviu Ionescu.
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use,
10 * copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom
12 * the Software is furnished to do so, subject to the following
13 * conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27
28#ifndef CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_
29#define CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_
30
31// ----------------------------------------------------------------------------
32
33#ifdef __cplusplus
34
35// ----------------------------------------------------------------------------
36
38
40
41// ----------------------------------------------------------------------------
42
43#pragma GCC diagnostic push
44
45#if defined(__clang__)
46#pragma clang diagnostic ignored "-Wc++98-compat"
47#endif
48
49// ----------------------------------------------------------------------------
50
51namespace os
52{
53 namespace rtos
54 {
55 namespace internal
56 {
57
58 // ======================================================================
59
64 {
65
66 public:
67
76 event_flags () = default;
77
82 event_flags (const event_flags&) = delete;
83 event_flags (event_flags&&) = delete;
85 operator= (const event_flags&) = delete;
87 operator= (event_flags&&) = delete;
88
96 ~event_flags () = default;
97
102 public:
103
120
132 bool
134 flags::mode_t mode);
135
145
156
162 mask (void);
163
168 protected:
169
182 flags::mask_t volatile flags_mask_ = 0;
183
192 };
193 /* class event_flags */
194
195 // ------------------------------------------------------------------------
196 } /* namespace internal */
197 } /* namespace rtos */
198} /* namespace os */
199
200namespace os
201{
202 namespace rtos
203 {
204 namespace internal
205 {
206
207 inline flags::mask_t
209 {
210 return flags_mask_;
211 }
212
213 // ------------------------------------------------------------------------
214 } /* namespace internal */
215 } /* namespace rtos */
216} /* namespace os */
217
218#pragma GCC diagnostic pop
219
220// ----------------------------------------------------------------------------
221
222#endif /* __cplusplus */
223
224// ----------------------------------------------------------------------------
225
226#endif /* CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_ */
Internal event flags implementation.
Definition os-flags.h:64
result_t raise(flags::mask_t mask, flags::mask_t *oflags)
Raise event flags.
Definition os-flags.cpp:49
flags::mask_t get(flags::mask_t mask, flags::mode_t mode)
Get (and possibly clear) event flags.
Definition os-flags.cpp:124
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:77
result_t clear(flags::mask_t mask, flags::mask_t *oflags)
Clear event flags.
Definition os-flags.cpp:158
~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:208
uint32_t mode_t
Type of variables holding flags modes.
Definition os-decls.h:289
uint32_t mask_t
Type of variables holding flags masks.
Definition os-decls.h:279
uint32_t result_t
Type of values returned by RTOS functions.
Definition os-decls.h:110
System namespace.