CppELib 1.7.0
Loading...
Searching...
No Matches
StdCppOSWrapper::StdCppEventFlag Class Reference

Public Member Functions

 StdCppEventFlag (bool autoReset)
 
 ~StdCppEventFlag ()
 
OSWrapper::Error waitAny ()
 Block the current thread until any bit of this EventFlag is set ON.
 
OSWrapper::Error waitOne (std::size_t pos)
 Block the current thread until the bit at position pos of this EventFlag is set ON.
 
OSWrapper::Error wait (EventFlag::Pattern bitPattern, Mode waitMode, EventFlag::Pattern *releasedPattern)
 Block the current thread until the condition is satisfied.
 
OSWrapper::Error tryWaitAny ()
 Query without blocking whether any bit of this EventFlag is set ON.
 
OSWrapper::Error tryWaitOne (std::size_t pos)
 Query without blocking whether the bit at position pos of this EventFlag is set ON.
 
OSWrapper::Error tryWait (EventFlag::Pattern bitPattern, Mode waitMode, EventFlag::Pattern *releasedPattern)
 Query without blocking whether the condition is satisfied.
 
OSWrapper::Error timedWaitAny (Timeout tmout)
 Block the current thread until any bit of this EventFlag is set ON but only within the limited time.
 
OSWrapper::Error timedWaitOne (std::size_t pos, Timeout tmout)
 Block the current thread until the bit at position pos of this EventFlag is set ON but only within the limited time.
 
OSWrapper::Error timedWait (EventFlag::Pattern bitPattern, Mode waitMode, EventFlag::Pattern *releasedPattern, Timeout tmout)
 Block the current thread until the condition is satisfied but only within the limited time.
 
OSWrapper::Error setAll ()
 Set all the bits of this EventFlag object ON.
 
OSWrapper::Error setOne (std::size_t pos)
 Set the bit at position pos of this EventFlag object ON.
 
OSWrapper::Error set (EventFlag::Pattern bitPattern)
 Set the bits of bitPattern of this EventFlag object ON.
 
OSWrapper::Error resetAll ()
 Reset all the bits of this EventFlag object OFF.
 
OSWrapper::Error resetOne (std::size_t pos)
 Reset the bit at position pos of this EventFlag object OFF.
 
OSWrapper::Error reset (EventFlag::Pattern bitPattern)
 Reset the bits of bitPattern of this EventFlag object OFF.
 
EventFlag::Pattern getCurrentPattern () const
 Get current bit pattern of this EventFlag object.
 

Additional Inherited Members

- Public Types inherited from OSWrapper::EventFlag
enum  Mode { OR , AND }
 Used as argument of the wait methods. More...
 
typedef Container::BitPattern< unsigned int > Pattern
 Type for bit pattern of EventFlag.
 
- Static Public Member Functions inherited from OSWrapper::EventFlag
static EventFlagcreate (bool autoReset)
 Create an EventFlag object.
 
static void destroy (EventFlag *e)
 Destroy an EventFlag object.
 
- Protected Member Functions inherited from OSWrapper::EventFlag
virtual ~EventFlag ()
 

Constructor & Destructor Documentation

◆ StdCppEventFlag()

StdCppOSWrapper::StdCppEventFlag::StdCppEventFlag ( bool  autoReset)
inlineexplicit

◆ ~StdCppEventFlag()

StdCppOSWrapper::StdCppEventFlag::~StdCppEventFlag ( )
inline

Member Function Documentation

◆ getCurrentPattern()

EventFlag::Pattern StdCppOSWrapper::StdCppEventFlag::getCurrentPattern ( ) const
inlinevirtual

Get current bit pattern of this EventFlag object.

Returns
Current bit pattern

Implements OSWrapper::EventFlag.

◆ reset()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::reset ( EventFlag::Pattern  bitPattern)
inlinevirtual

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)

Parameters
bitPatternRequested bit pattern
Return values
OKAlways success

Implements OSWrapper::EventFlag.

◆ resetAll()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::resetAll ( )
inlinevirtual

Reset all the bits of this EventFlag object OFF.

Return values
OKAlways success

Implements OSWrapper::EventFlag.

◆ resetOne()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::resetOne ( std::size_t  pos)
inlinevirtual

Reset the bit at position pos of this EventFlag object OFF.

Parameters
posPosition of the bit
Return values
OKSuccess
InvalidParameterpos >= EventFlag::Pattern().size()

Implements OSWrapper::EventFlag.

◆ set()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::set ( EventFlag::Pattern  bitPattern)
inlinevirtual

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)

Parameters
bitPatternRequested bit pattern
Return values
OKAlways success

Implements OSWrapper::EventFlag.

◆ setAll()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::setAll ( )
inlinevirtual

Set all the bits of this EventFlag object ON.

Return values
OKAlways success

Implements OSWrapper::EventFlag.

◆ setOne()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::setOne ( std::size_t  pos)
inlinevirtual

Set the bit at position pos of this EventFlag object ON.

Parameters
posPosition of the bit
Return values
OKSuccess
InvalidParameterpos >= EventFlag::Pattern().size()

Implements OSWrapper::EventFlag.

◆ timedWait()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::timedWait ( EventFlag::Pattern  bitPattern,
Mode  waitMode,
EventFlag::Pattern releasedPattern,
Timeout  tmout 
)
inlinevirtual

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 waitMode is EventFlag::OR, the condition is (selfPattern & bitPattern) != 0
  • If waitMode is EventFlag::AND, the condition is (selfPattern & bitPattern) == bitPattern

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.

Parameters
bitPatternRequested bit pattern
waitModeSpecify EventFlag::OR or EventFlag::AND
releasedPatternPointer of variable that stores the bit pattern of this EventFlag when the condition is satisfied. If null pointer, not accessed
tmoutThe limited time
Return values
OKSuccess. The condition is satisfied
TimedOutThe limited time was elapsed
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
InvalidParameterAll the bits of bitPattern are OFF, or waitMode is invalid value
Note
If tmout is Timeout::POLLING then this method queries whether the condition has been satisfied without blocking.
If tmout is Timeout::FOREVER then this method waits forever until the condition is satisfied.

Implements OSWrapper::EventFlag.

◆ timedWaitAny()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::timedWaitAny ( Timeout  tmout)
inlinevirtual

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.

Parameters
tmoutThe limited time
Return values
OKSuccess. Any bit is set ON
TimedOutThe limited time was elapsed
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
Note
If tmout is Timeout::POLLING then this method queries whether the condition has been satisfied without blocking.
If tmout is Timeout::FOREVER then this method waits forever until the condition is satisfied.

Implements OSWrapper::EventFlag.

◆ timedWaitOne()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::timedWaitOne ( std::size_t  pos,
Timeout  tmout 
)
inlinevirtual

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.

Parameters
posPosition of the bit
tmoutThe limited time
Return values
OKSuccess. The bit at position pos is set ON
TimedOutThe limited time was elapsed
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
InvalidParameterpos >= EventFlag::Pattern().size()
Note
If tmout is Timeout::POLLING then this method queries whether the condition has been satisfied without blocking.
If tmout is Timeout::FOREVER then this method waits forever until the condition is satisfied.

Implements OSWrapper::EventFlag.

◆ tryWait()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::tryWait ( EventFlag::Pattern  bitPattern,
Mode  waitMode,
EventFlag::Pattern releasedPattern 
)
inlinevirtual

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.

Parameters
bitPatternRequested bit pattern
waitModeSpecify EventFlag::OR or EventFlag::AND
releasedPatternPointer of variable that stores the bit pattern of this EventFlag when the condition is satisfied. If null pointer, not accessed
Return values
OKSuccess. The condition is satisfied
TimedOutThe bit pattern of this EventFlag object is not satisfied the condition
InvalidParameterAll the bits of bitPattern are OFF, or waitMode is invalid value
Note
Same as timedWait(bitPattern, waitMode, releasedPattern, Timeout::POLLING)

Implements OSWrapper::EventFlag.

◆ tryWaitAny()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::tryWaitAny ( )
inlinevirtual

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.

Return values
OKSuccess. Any bit is set ON
TimedOutAll the bits of this EventFlag object are OFF
Note
Same as timedWaitAny(Timeout::POLLING)

Implements OSWrapper::EventFlag.

◆ tryWaitOne()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::tryWaitOne ( std::size_t  pos)
inlinevirtual

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.

Parameters
posPosition of the bit
Return values
OKSuccess. The bit at position pos is set ON
TimedOutThe bit at position pos of this EventFlag object is OFF
InvalidParameterpos >= EventFlag::Pattern().size()
Note
Same as timedWaitOne(pos, Timeout::POLLING)

Implements OSWrapper::EventFlag.

◆ wait()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::wait ( EventFlag::Pattern  bitPattern,
Mode  waitMode,
EventFlag::Pattern releasedPattern 
)
inlinevirtual

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.

Parameters
bitPatternRequested bit pattern
waitModeSpecify EventFlag::OR or EventFlag::AND
releasedPatternPointer of variable that stores the bit pattern of this EventFlag when the condition is satisfied. If null pointer, not accessed
Return values
OKSuccess. The condition is satisfied
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
InvalidParameterAll the bits of bitPattern are OFF, or waitMode is invalid value
Note
Same as timedWait(bitPattern, waitMode, releasedPattern, Timeout::FOREVER)

Implements OSWrapper::EventFlag.

◆ waitAny()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::waitAny ( )
inlinevirtual

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.

Return values
OKSuccess. Any bit is set ON
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
Note
Same as timedWaitAny(Timeout::FOREVER)

Implements OSWrapper::EventFlag.

◆ waitOne()

OSWrapper::Error StdCppOSWrapper::StdCppEventFlag::waitOne ( std::size_t  pos)
inlinevirtual

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.

Parameters
posPosition of the bit
Return values
OKSuccess. The bit at position pos is set ON
CalledByNonThreadCalled from non thread context (interrupt handler, timer, etc)
InvalidParameterpos >= EventFlag::Pattern().size()
Note
Same as timedWaitOne(pos, Timeout::FOREVER)

Implements OSWrapper::EventFlag.


The documentation for this class was generated from the following file: