CppELib 1.7.0
|
Abstract class that has functions of common RTOS's event flag. More...
#include <EventFlag.h>
Public Types | |
enum | Mode { OR , AND } |
Used as argument of the wait methods. More... | |
typedef Container::BitPattern< unsigned int > | Pattern |
Type for bit pattern of EventFlag. | |
Public Member Functions | |
virtual Error | waitAny ()=0 |
Block the current thread until any bit of this EventFlag is set ON. | |
virtual Error | waitOne (std::size_t pos)=0 |
Block the current thread until the bit at position pos of this EventFlag is set ON. | |
virtual Error | wait (Pattern bitPattern, Mode waitMode, Pattern *releasedPattern)=0 |
Block the current thread until the condition is satisfied. | |
virtual Error | tryWaitAny ()=0 |
Query without blocking whether any bit of this EventFlag is set ON. | |
virtual Error | tryWaitOne (std::size_t pos)=0 |
Query without blocking whether the bit at position pos of this EventFlag is set ON. | |
virtual Error | tryWait (Pattern bitPattern, Mode waitMode, Pattern *releasedPattern)=0 |
Query without blocking whether the condition is satisfied. | |
virtual Error | timedWaitAny (Timeout tmout)=0 |
Block the current thread until any bit of this EventFlag is set ON but only within the limited time. | |
virtual Error | timedWaitOne (std::size_t pos, Timeout tmout)=0 |
Block the current thread until the bit at position pos of this EventFlag is set ON but only within the limited time. | |
virtual Error | timedWait (Pattern bitPattern, Mode waitMode, Pattern *releasedPattern, Timeout tmout)=0 |
Block the current thread until the condition is satisfied but only within the limited time. | |
virtual Error | setAll ()=0 |
Set all the bits of this EventFlag object ON. | |
virtual Error | setOne (std::size_t pos)=0 |
Set the bit at position pos of this EventFlag object ON. | |
virtual Error | set (Pattern bitPattern)=0 |
Set the bits of bitPattern of this EventFlag object ON. | |
virtual Error | resetAll ()=0 |
Reset all the bits of this EventFlag object OFF. | |
virtual Error | resetOne (std::size_t pos)=0 |
Reset the bit at position pos of this EventFlag object OFF. | |
virtual Error | reset (Pattern bitPattern)=0 |
Reset the bits of bitPattern of this EventFlag object OFF. | |
virtual Pattern | getCurrentPattern () const =0 |
Get current bit pattern of this EventFlag object. | |
Static Public Member Functions | |
static EventFlag * | create (bool autoReset) |
Create an EventFlag object. | |
static void | destroy (EventFlag *e) |
Destroy an EventFlag object. | |
Protected Member Functions | |
virtual | ~EventFlag () |
Abstract class that has functions of common RTOS's event flag.
typedef Container::BitPattern<unsigned int> OSWrapper::EventFlag::Pattern |
Type for bit pattern of EventFlag.
|
inlineprotectedvirtual |
|
static |
|
static |
Destroy an EventFlag object.
e | Pointer of EventFlag object created by EventFlag::create() |
|
pure virtual |
Get current bit pattern of this EventFlag object.
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
Reset the bits of bitPattern of this EventFlag object OFF.
Let selfPattern is the bit pattern of this EventFlag object: Bitwise operation is (selfPattern &= ~bitPattern)
bitPattern | Requested bit pattern |
OK | Always success |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Reset all the bits of this EventFlag object OFF.
OK | Always success |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Reset the bit at position pos of this EventFlag object OFF.
pos | Position of the bit |
OK | Success |
InvalidParameter | pos >= EventFlag::Pattern().size() |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
Set the bits of bitPattern of this EventFlag object ON.
Let selfPattern is the bit pattern of this EventFlag object: Bitwise operation is (selfPattern |= bitPattern)
bitPattern | Requested bit pattern |
OK | Always success |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Set all the bits of this EventFlag object ON.
OK | Always success |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Set the bit at position pos of this EventFlag object ON.
pos | Position of the bit |
OK | Success |
InvalidParameter | pos >= EventFlag::Pattern().size() |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Block the current thread until the condition is satisfied but only within the limited time.
Let selfPattern is the bit pattern of this EventFlag object:
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
bitPattern | Requested bit pattern |
waitMode | Specify EventFlag::OR or EventFlag::AND |
releasedPattern | Pointer of variable that stores the bit pattern of this EventFlag when the condition is satisfied. If null pointer, not accessed |
tmout | The limited time |
OK | Success. The condition is satisfied |
TimedOut | The limited time was elapsed |
CalledByNonThread | Called from non thread context (interrupt handler, timer, etc) |
InvalidParameter | All the bits of bitPattern are OFF, or waitMode is invalid value |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
Block the current thread until any bit of this EventFlag is set ON but only within the limited time.
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
tmout | The limited time |
OK | Success. Any bit is set ON |
TimedOut | The limited time was elapsed |
CalledByNonThread | Called from non thread context (interrupt handler, timer, etc) |
Implemented in TestDoubleOSWrapper::TestDoubleEventFlag, and StdCppOSWrapper::StdCppEventFlag.
Block the current thread until the bit at position pos of this EventFlag is set ON but only within the limited time.
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
pos | Position of the bit |
tmout | The limited time |
OK | Success. The bit at position pos is set ON |
TimedOut | The limited time was elapsed |
CalledByNonThread | Called from non thread context (interrupt handler, timer, etc) |
InvalidParameter | pos >= EventFlag::Pattern().size() |
Implemented in TestDoubleOSWrapper::TestDoubleEventFlag, and StdCppOSWrapper::StdCppEventFlag.
|
pure virtual |
Query without blocking whether the condition is satisfied.
The condition is the same as timedWait().
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
bitPattern | Requested bit pattern |
waitMode | Specify EventFlag::OR or EventFlag::AND |
releasedPattern | Pointer of variable that stores the bit pattern of this EventFlag when the condition is satisfied. If null pointer, not accessed |
OK | Success. The condition is satisfied |
TimedOut | The bit pattern of this EventFlag object is not satisfied the condition |
InvalidParameter | All the bits of bitPattern are OFF, or waitMode is invalid value |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Query without blocking whether any bit of this EventFlag is set ON.
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
OK | Success. Any bit is set ON |
TimedOut | All the bits of this EventFlag object are OFF |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Query without blocking whether the bit at position pos of this EventFlag is set ON.
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
pos | Position of the bit |
OK | Success. The bit at position pos is set ON |
TimedOut | The bit at position pos of this EventFlag object is OFF |
InvalidParameter | pos >= EventFlag::Pattern().size() |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Block the current thread until the condition is satisfied.
The condition is the same as timedWait().
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
bitPattern | Requested bit pattern |
waitMode | Specify EventFlag::OR or EventFlag::AND |
releasedPattern | Pointer of variable that stores the bit pattern of this EventFlag when the condition is satisfied. If null pointer, not accessed |
OK | Success. The condition is satisfied |
CalledByNonThread | Called from non thread context (interrupt handler, timer, etc) |
InvalidParameter | All the bits of bitPattern are OFF, or waitMode is invalid value |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Block the current thread until any bit of this EventFlag is set ON.
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
OK | Success. Any bit is set ON |
CalledByNonThread | Called from non thread context (interrupt handler, timer, etc) |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.
|
pure virtual |
Block the current thread until the bit at position pos of this EventFlag is set ON.
If this EventFlag object has created with auto reset flag, when this method succeeds, the bit pattern of this EventFlag object is all reset OFF.
pos | Position of the bit |
OK | Success. The bit at position pos is set ON |
CalledByNonThread | Called from non thread context (interrupt handler, timer, etc) |
InvalidParameter | pos >= EventFlag::Pattern().size() |
Implemented in StdCppOSWrapper::StdCppEventFlag, and TestDoubleOSWrapper::TestDoubleEventFlag.