Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
TypedQAsync< T >::BlockingWait Class Reference

Helper class for waiting (blocking the current thread) until a message in the queue shows up. More...

Inheritance diagram for TypedQAsync< T >::BlockingWait:
Executable Notifiable QMember Destructable

Public Member Functions

 BlockingWait (TypedQAsync< T > *parent)
 Constructor.
 
T * result ()
 
- Public Member Functions inherited from Executable
void test_deletion ()
 
void notify () override
 Crashes the program – everyone who is expecting notify calls must override this function.
 
- Public Member Functions inherited from QMember
void init ()
 Initiailize a QMember, in place of a public placement construction.
 

Private Member Functions

void alloc_result (QMember *item) OVERRIDE
 Return the result of an alloc_async() from a memory Pool.
 
void run () OVERRIDE
 Entry point.
 

Private Attributes

SyncNotifiable n_
 helps blocking the calling thread until the allocation is complete.
 
T * result_
 Response of the allocation.
 

Additional Inherited Members

- Protected Member Functions inherited from QMember
 QMember ()
 Constructor.
 
 ~QMember ()
 Destructor.
 
- Protected Attributes inherited from QMember
QMembernext
 pointer to the next member in the queue
 

Detailed Description

template<class T>
class TypedQAsync< T >::BlockingWait

Helper class for waiting (blocking the current thread) until a message in the queue shows up.

Todo:
(balazs.racz): add a typed next() command here.

Definition at line 426 of file Queue.hxx.

Constructor & Destructor Documentation

◆ BlockingWait()

template<class T >
TypedQAsync< T >::BlockingWait::BlockingWait ( TypedQAsync< T > *  parent)
inline

Constructor.

Parameters
parentis the queue to take an entry from.

Definition at line 430 of file Queue.hxx.

Member Function Documentation

◆ alloc_result()

template<class T >
void TypedQAsync< T >::BlockingWait::alloc_result ( QMember item)
inlineprivatevirtual

Return the result of an alloc_async() from a memory Pool.

Parameters
itemresult of the the allocation

Reimplemented from Executable.

Definition at line 443 of file Queue.hxx.

◆ result()

template<class T >
T * TypedQAsync< T >::BlockingWait::result ( )
inline
Returns
(typed) result of the queue wait operation.

Definition at line 437 of file Queue.hxx.

◆ run()

template<class T >
void TypedQAsync< T >::BlockingWait::run ( )
inlineprivatevirtual

Entry point.

This funciton will be called when *this gets scheduled on the CPU.

Implements Executable.

Definition at line 449 of file Queue.hxx.

Member Data Documentation

◆ n_

template<class T >
SyncNotifiable TypedQAsync< T >::BlockingWait::n_
private

helps blocking the calling thread until the allocation is complete.

Definition at line 456 of file Queue.hxx.

◆ result_

template<class T >
T* TypedQAsync< T >::BlockingWait::result_
private

Response of the allocation.

Definition at line 458 of file Queue.hxx.


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