Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Aws::DataFlow::ObservedQueue< T, Allocator > Class Template Reference

#include <observed_queue.h>

Inheritance diagram for Aws::DataFlow::ObservedQueue< T, Allocator >:
Inheritance graph
[legend]

Public Member Functions

void clear () override
 
bool dequeue (T &data, const std::chrono::microseconds &) override
 
bool empty () const override
 
bool enqueue (T &&value) override
 
bool enqueue (T &value) override
 
void setStatusMonitor (std::shared_ptr< StatusMonitor > status_monitor) override
 
size_t size () const override
 
bool tryEnqueue (T &value, const std::chrono::microseconds &) override
 
bool tryEnqueue (T &&value, const std::chrono::microseconds &) override
 
 ~ObservedQueue () override=default
 
- Public Member Functions inherited from Aws::DataFlow::Source< T >
virtual ~Source ()=default
 

Protected Member Functions

void notifyMonitor (const Status &status)
 

Protected Attributes

std::deque< T, Allocator > dequeue_
 
std::shared_ptr< StatusMonitorstatus_monitor_
 

Detailed Description

template<class T, class Allocator = std::allocator<T>>
class Aws::DataFlow::ObservedQueue< T, Allocator >

An observed queue is a dequeue wrapper which notifies an observer when a task is added.

Template Parameters
Ttype of data
Allocator

Definition at line 52 of file observed_queue.h.

Constructor & Destructor Documentation

template<class T, class Allocator = std::allocator<T>>
Aws::DataFlow::ObservedQueue< T, Allocator >::~ObservedQueue ( )
overridedefault

Member Function Documentation

template<class T, class Allocator = std::allocator<T>>
void Aws::DataFlow::ObservedQueue< T, Allocator >::clear ( )
inlineoverridevirtual
template<class T, class Allocator = std::allocator<T>>
bool Aws::DataFlow::ObservedQueue< T, Allocator >::dequeue ( T &  data,
const std::chrono::microseconds &   
)
inlineoverridevirtual

Dequeue data and notify the observer of data unavailable if the queue is empty.

Returns
the front of the dequeue

Implements Aws::DataFlow::Source< T >.

Reimplemented in Aws::DataFlow::ObservedBlockingQueue< T, Allocator >, and Aws::DataFlow::ObservedSynchronizedQueue< T, Allocator >.

Definition at line 108 of file observed_queue.h.

template<class T, class Allocator = std::allocator<T>>
bool Aws::DataFlow::ObservedQueue< T, Allocator >::empty ( ) const
inlineoverridevirtual
template<class T, class Allocator = std::allocator<T>>
bool Aws::DataFlow::ObservedQueue< T, Allocator >::enqueue ( T &&  value)
inlineoverridevirtual

Enqueue data and notify the observer of data available.

Parameters
valueto enqueue

Implements Aws::DataFlow::Sink< T >.

Reimplemented in Aws::DataFlow::ObservedBlockingQueue< T, Allocator >, and Aws::DataFlow::ObservedSynchronizedQueue< T, Allocator >.

Definition at line 72 of file observed_queue.h.

template<class T, class Allocator = std::allocator<T>>
bool Aws::DataFlow::ObservedQueue< T, Allocator >::enqueue ( T &  value)
inlineoverridevirtual

Enqueue data and notify the observer of data available.

Parameters
valueto enqueue

Implements Aws::DataFlow::Sink< T >.

Reimplemented in Aws::DataFlow::ObservedBlockingQueue< T, Allocator >, and Aws::DataFlow::ObservedSynchronizedQueue< T, Allocator >.

Definition at line 83 of file observed_queue.h.

template<class T, class Allocator = std::allocator<T>>
void Aws::DataFlow::ObservedQueue< T, Allocator >::notifyMonitor ( const Status status)
inlineprotected

Notify the monitor if it exists.

Parameters
statusthe status to notify the monitor of.

Definition at line 152 of file observed_queue.h.

template<class T, class Allocator = std::allocator<T>>
void Aws::DataFlow::ObservedQueue< T, Allocator >::setStatusMonitor ( std::shared_ptr< StatusMonitor status_monitor)
inlineoverridevirtual

Set the observer for the queue.

Parameters
status_monitor

Implements Aws::DataFlow::IObservedQueue< T, Allocator >.

Definition at line 63 of file observed_queue.h.

template<class T, class Allocator = std::allocator<T>>
size_t Aws::DataFlow::ObservedQueue< T, Allocator >::size ( ) const
inlineoverridevirtual
template<class T, class Allocator = std::allocator<T>>
bool Aws::DataFlow::ObservedQueue< T, Allocator >::tryEnqueue ( T &  value,
const std::chrono::microseconds &   
)
inlineoverridevirtual
template<class T, class Allocator = std::allocator<T>>
bool Aws::DataFlow::ObservedQueue< T, Allocator >::tryEnqueue ( T &&  value,
const std::chrono::microseconds &   
)
inlineoverridevirtual

Member Data Documentation

template<class T, class Allocator = std::allocator<T>>
std::deque<T, Allocator> Aws::DataFlow::ObservedQueue< T, Allocator >::dequeue_
protected

The dequeue to store data.

Definition at line 166 of file observed_queue.h.

template<class T, class Allocator = std::allocator<T>>
std::shared_ptr<StatusMonitor> Aws::DataFlow::ObservedQueue< T, Allocator >::status_monitor_
protected

The status monitor observer.

Definition at line 161 of file observed_queue.h.


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


dataflow_lite
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:22