µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
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 
36 
37 #include <cmsis-plus/diag/trace.h>
38 
39 namespace os
40 {
41  namespace rtos
42  {
43  namespace internal
44  {
45 
46  // ======================================================================
47 
52  {
53 
54  public:
55 
64  event_flags () = default;
65 
70  event_flags (const event_flags&) = delete;
71  event_flags (event_flags&&) = delete;
73  operator= (const event_flags&) = delete;
75  operator= (event_flags&&) = delete;
76 
84  ~event_flags () = default;
85 
90  public:
91 
106  result_t
107  raise (flags::mask_t mask, flags::mask_t* oflags);
108 
120  bool
122  flags::mode_t mode);
123 
132  get (flags::mask_t mask, flags::mode_t mode);
133 
142  result_t
143  clear (flags::mask_t mask, flags::mask_t* oflags);
144 
150  mask (void);
151 
156  protected:
157 
170  flags::mask_t volatile flags_mask_ = 0;
171 
180  };
181  /* class event_flags */
182 
183  // ------------------------------------------------------------------------
184  } /* namespace internal */
185  } /* namespace rtos */
186 } /* namespace os */
187 
188 namespace os
189 {
190  namespace rtos
191  {
192  namespace internal
193  {
194 
195  inline flags::mask_t
197  {
198  return flags_mask_;
199  }
200 
201  // ------------------------------------------------------------------------
202  } /* namespace internal */
203  } /* namespace rtos */
204 } /* namespace os */
205 
206 #endif /* __cplusplus */
207 
208 #endif /* CMSIS_PLUS_RTOS_INTERNAL_OS_FLAGS_H_ */
event_flags()=default
Construct an internal event flags object instance.
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:66
System namespace.
flags::mask_t mask(void)
Get the flags mask.
Definition: os-flags.h:196
Internal event flags implementation.
Definition: os-flags.h:51
~event_flags()=default
Destruct the internal event flags object instance.
result_t clear(flags::mask_t mask, flags::mask_t *oflags)
Clear event flags.
Definition: os-flags.cpp:137
uint32_t mask_t
Type of variables holding flags masks.
Definition: os-decls.h:265
uint32_t mode_t
Type of variables holding flags modes.
Definition: os-decls.h:275
uint32_t result_t
Type of values returned by RTOS functions.
Definition: os-decls.h:96