F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Os::ConditionVariableInterface Class Referenceabstract

interface for condition variables More...

#include <Os/Condition.hpp>

Inheritance diagram for Os::ConditionVariableInterface:
Os::ConditionVariable Os::Posix::Mutex::PosixConditionVariable Os::Stub::Mutex::StubConditionVariable

Public Member Functions

 ConditionVariableInterface ()=default
 Default constructor. More...
 
virtual ~ConditionVariableInterface ()=default
 Default destructor. More...
 
 ConditionVariableInterface (const ConditionVariableInterface &other)=delete
 copy constructor is forbidden More...
 
virtual ConditionVariableInterfaceoperator= (const ConditionVariableInterface &other)=delete
 assignment operator is forbidden More...
 
virtual void wait (Os::Mutex &mutex)=0
 wait on a condition variable More...
 
virtual void notify ()=0
 notify a single waiter on this condition variable More...
 
virtual void notifyAll ()=0
 notify all waiters on this condition variable More...
 
virtual ConditionVariableHandlegetHandle ()=0
 return the underlying condition variable handle (implementation specific). More...
 

Static Public Member Functions

static ConditionVariableInterfacegetDelegate (ConditionVariableHandleStorage &aligned_new_memory)
 provide a pointer to a Mutex delegate object More...
 

Detailed Description

interface for condition variables

Condition variables allow a program to block on a condition while atomically releasing an Os::Mutex and atomically reacquiring the mutex once the condition has been notified.

Definition at line 20 of file Condition.hpp.

Constructor & Destructor Documentation

◆ ConditionVariableInterface() [1/2]

Os::ConditionVariableInterface::ConditionVariableInterface ( )
default

Default constructor.

◆ ~ConditionVariableInterface()

virtual Os::ConditionVariableInterface::~ConditionVariableInterface ( )
virtualdefault

Default destructor.

◆ ConditionVariableInterface() [2/2]

Os::ConditionVariableInterface::ConditionVariableInterface ( const ConditionVariableInterface other)
delete

copy constructor is forbidden

Member Function Documentation

◆ getDelegate()

ConditionVariableInterface * Os::ConditionVariableInterface::getDelegate ( ConditionVariableHandleStorage aligned_new_memory)
static

provide a pointer to a Mutex delegate object

get a delegate for condition variable

get a delegate for MutexInterface that intercepts calls for Posix

Parameters
aligned_new_memoryaligned memory to fill
Returns
: pointer to delegate

Definition at line 22 of file DefaultMutex.cpp.

◆ getHandle()

virtual ConditionVariableHandle* Os::ConditionVariableInterface::getHandle ( )
pure virtual

return the underlying condition variable handle (implementation specific).

Returns
internal task handle representation

Implemented in Os::Stub::Mutex::StubConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::ConditionVariable.

◆ notify()

virtual void Os::ConditionVariableInterface::notify ( )
pure virtual

notify a single waiter on this condition variable

Notify a single waiter on this condition variable. It is not necessary to hold the mutex supplied by the waiters and it is advantageous not to hold the lock to prevent immediate re-blocking.

Implemented in Os::Stub::Mutex::StubConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::ConditionVariable.

◆ notifyAll()

virtual void Os::ConditionVariableInterface::notifyAll ( )
pure virtual

notify all waiters on this condition variable

Notify all waiters on this condition variable. It is not necessary to hold the mutex supplied by the waiters and it is advantageous not to hold the lock to prevent immediate re-blocking.

Implemented in Os::Stub::Mutex::StubConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::ConditionVariable.

◆ operator=()

virtual ConditionVariableInterface& Os::ConditionVariableInterface::operator= ( const ConditionVariableInterface other)
virtualdelete

◆ wait()

virtual void Os::ConditionVariableInterface::wait ( Os::Mutex mutex)
pure virtual

wait on a condition variable

Wait on a condition variable. This function will atomically unlock the provided mutex and block on the condition in one step. Blocking will occur until a future notify or notifyAll call is made to this variable on another thread of execution.

Parameters
mutexmutex to unlock as part of this operation

Implemented in Os::Stub::Mutex::StubConditionVariable, Os::Posix::Mutex::PosixConditionVariable, and Os::ConditionVariable.


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