GM6000 Digital Heater Controller Branch: main
SDX-1330
EventFlag.h
Go to the documentation of this file.
1#ifndef Cpl_System_EventFlag_h_
2#define Cpl_System_EventFlag_h_
3/*-----------------------------------------------------------------------------
4* This file is part of the Colony.Core Project. The Colony.Core Project is an
5* open source project with a BSD type of licensing agreement. See the license
6* agreement (license.txt) in the top/ directory or on the Internet at
7* http://integerfox.com/colony.core/license.txt
8*
9* Copyright (c) 2014-2022 John T. Taylor
10*
11* Redistributions of the source code must retain the above copyright notice.
12*----------------------------------------------------------------------------*/
13/** @file */
14
15#include "colony_config.h"
16#include <stdint.h>
17
18/// Default the Event Flags data type to 32 Events flags
19#ifndef Cpl_System_EventFlag_T
20#define Cpl_System_EventFlag_T uint32_t
21#endif
22
23///
24namespace Cpl {
25///
26namespace System {
27
28
29
30/** This abstract class defines the interface to generated a 'Event Flag'. Event
31 Flags are used to indicate that an 'event' has occurred. Each Event Flag
32 is represent by a bit the Cpl_System_Event_Flags_T data type.
33
34 Individual event flags can be viewed as binary semaphores with respect
35 to be signaled/waiting (though waiting is done on the thread's entire set
36 of event flags).
37
38 A thread (runnable object) can wait for at least one event to be signaled.
39 When the thread is waiting on event(s) and it is then signaled - all of
40 Events that were in the signaled state when the thread was unblock are
41 cleared.
42 */
44{
45public:
46 /** This operation is called by clients to set one or more Event Flags.
47 Each bit in 'events' is different Event Flag.
48
49 This method can ONLY be called from a thread context.
50 */
51 virtual void notifyEvents( Cpl_System_EventFlag_T events ) noexcept = 0;
52
53 /** This operation is similar to notifyEvents(), except that it sets one
54 event flags. The 'eventNumber' is the bit number (zero based) of the
55 Event Flag to set.
56
57 This method can ONLY be called from a thread context.
58 */
59 virtual void notify( uint8_t eventNumber ) noexcept = 0;
60
61
62public:
63 /** This method is same as notifyEvents() EXCEPT this method can ONLY be
64 called from supervisor mode and/or ISR contexts.
65 */
66 virtual void su_notifyEvents( Cpl_System_EventFlag_T events ) noexcept = 0;
67
68 /** This method is same as notify() EXCEPT this method can ONLY be
69 called from supervisor mode and/or ISR contexts.
70 */
71 virtual void su_notify( uint8_t eventNumber ) noexcept = 0;
72
73
74public:
75 /// Virtual destructor
76 virtual ~EventFlag() {}
77};
78
79}; // end namespaces
80};
81#endif // end header latch
82
#define Cpl_System_EventFlag_T
Default the Event Flags data type to 32 Events flags.
Definition EventFlag.h:20
This abstract class defines the interface to generated a 'Event Flag'.
Definition EventFlag.h:44
virtual void notifyEvents(Cpl_System_EventFlag_T events) noexcept=0
This operation is called by clients to set one or more Event Flags.
virtual void su_notifyEvents(Cpl_System_EventFlag_T events) noexcept=0
This method is same as notifyEvents() EXCEPT this method can ONLY be called from supervisor mode and/...
virtual void su_notify(uint8_t eventNumber) noexcept=0
This method is same as notify() EXCEPT this method can ONLY be called from supervisor mode and/or ISR...
virtual ~EventFlag()
Virtual destructor.
Definition EventFlag.h:76
virtual void notify(uint8_t eventNumber) noexcept=0
This operation is similar to notifyEvents(), except that it sets one event flags.
The 'Cpl' namespace is the root name space for the Colony.
Definition Api16.h:20