S3FC project page S3FC home page

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

s3_inplace_fifo_mux::stub_queue Class Template Reference

Stub class representing a virtual queue associated with a single s3_inplace_fifo_mux instance. More...

#include <s3_inplace_fifo_mux.h>

Inheritance diagram for s3_inplace_fifo_mux::stub_queue:

Inheritance graph
[legend]
Collaboration diagram for s3_inplace_fifo_mux::stub_queue:

Collaboration graph
[legend]
List of all members.

Public Methods

 stub_queue (s3_inplace_fifo_mux< T > *n_mux)
 Construct a stub queue with specified controlling mux. More...

virtual bool empty () const
 Interface from s3_inplace_fifo_base<T>. More...

virtual bool full () const
 Interface from s3_inplace_fifo_base<T>. More...

virtual unsigned int size () const
 Interface from s3_inplace_fifo_base<T>. More...

virtual void push (const T &t)
 Interface from s3_inplace_fifo_base<T>. More...

virtual T pop ()
 Interface from s3_inplace_fifo_base<T>. More...

virtual T * open_input ()
 Interface from s3_inplace_fifo_base<T>. More...

virtual T * nbl_open_input ()
 Interface from s3_inplace_fifo_base<T>. More...

virtual void close_input (const T *t)
 Interface from s3_inplace_fifo_base<T>. More...

virtual T * open_output ()
 Interface from s3_inplace_fifo_base<T>. More...

virtual T * nbl_open_output ()
 Interface from s3_inplace_fifo_base<T>. More...

virtual void close_output (const T *t)
 Interface from s3_inplace_fifo_base<T>. More...


Protected Methods

void lock_select ()
 Check to see whether this instance is the current one. More...

void unlock_next ()
 Auto-select next queue in list (if auto_select enabled) and relinquish mux->state_lock. More...


Protected Attributes

s3_condition waiter
s3_inplace_fifo_mux< T > * mux

Detailed Description

template<typename T>
class s3_inplace_fifo_mux< T >::stub_queue

Stub class representing a virtual queue associated with a single s3_inplace_fifo_mux instance.

A number of stub_queue instances, each associated with the same mux inspect and manipulate shared mux state variables.

stub_queue also supports the s3_inplace_fifo_base<T> interface, and either directly forwards certain methods to mux->queue (if it is currently selected) or waits on a condition before forwarding (if it is not selected). After a forwarded call returns, the next virtual queue in mux->vqueue_list is selected if auto_select is true.

Exceptions to this are the close_input and close_output methods which always forwards the call, regardless of selection status, and does not automatically advance the selection.

Definition at line 86 of file s3_inplace_fifo_mux.h.


Constructor & Destructor Documentation

template<typename T>
s3_inplace_fifo_mux< T >::stub_queue::stub_queue s3_inplace_fifo_mux< T > *    n_mux
 

Construct a stub queue with specified controlling mux.

Parameters:
n_mux  Controlling mux.

Definition at line 40 of file s3_inplace_fifo_mux.tcc.

Referenced by full, and size.


Member Function Documentation

template<typename T>
void s3_inplace_fifo_mux< T >::stub_queue::close_input const T *    t [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward.

Implements s3_inplace_fifo_base.

Definition at line 128 of file s3_inplace_fifo_mux.tcc.

References mux.

template<typename T>
void s3_inplace_fifo_mux< T >::stub_queue::close_output const T *    t [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward.

Implements s3_inplace_fifo_base.

Definition at line 160 of file s3_inplace_fifo_mux.tcc.

References mux.

template<typename T>
bool s3_inplace_fifo_mux< T >::stub_queue::empty   const [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Implements s3_fifo_base.

Definition at line 48 of file s3_inplace_fifo_mux.tcc.

References CONST_OVERRIDE_THIS, and s3_inplace_fifo_mux::stub_queue.

template<typename T>
bool s3_inplace_fifo_mux< T >::stub_queue::full   const [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Implements s3_fifo_base.

Definition at line 59 of file s3_inplace_fifo_mux.tcc.

References CONST_OVERRIDE_THIS, lock_select, mux, stub_queue, and unlock_next.

template<typename T>
void s3_inplace_fifo_mux< T >::stub_queue::lock_select   [protected]
 

Check to see whether this instance is the current one.

If it is not, wait on waiter until notified. If it is the current one or when it becomes the current one, acquire mux->state_lock and return. Should always appear paired with unlock_next (with lock_select first).

Definition at line 168 of file s3_inplace_fifo_mux.tcc.

References mux, s3_condition::wait, and waiter.

Referenced by full, nbl_open_input, nbl_open_output, open_input, open_output, pop, push, and size.

template<typename T>
T * s3_inplace_fifo_mux< T >::stub_queue::nbl_open_input   [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Implements s3_inplace_fifo_base.

Definition at line 116 of file s3_inplace_fifo_mux.tcc.

References lock_select, mux, and unlock_next.

template<typename T>
T * s3_inplace_fifo_mux< T >::stub_queue::nbl_open_output   [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Implements s3_inplace_fifo_base.

Definition at line 148 of file s3_inplace_fifo_mux.tcc.

References lock_select, mux, and unlock_next.

template<typename T>
T * s3_inplace_fifo_mux< T >::stub_queue::open_input   [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Implements s3_inplace_fifo_base.

Definition at line 104 of file s3_inplace_fifo_mux.tcc.

References lock_select, mux, and unlock_next.

template<typename T>
T * s3_inplace_fifo_mux< T >::stub_queue::open_output   [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Implements s3_inplace_fifo_base.

Definition at line 136 of file s3_inplace_fifo_mux.tcc.

References lock_select, mux, and unlock_next.

template<typename T>
T s3_inplace_fifo_mux< T >::stub_queue::pop   [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Reimplemented from s3_inplace_fifo_base.

Definition at line 92 of file s3_inplace_fifo_mux.tcc.

References lock_select, mux, and unlock_next.

template<typename T>
void s3_inplace_fifo_mux< T >::stub_queue::push const T &    t [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Reimplemented from s3_inplace_fifo_base.

Definition at line 82 of file s3_inplace_fifo_mux.tcc.

References lock_select, mux, and unlock_next.

template<typename T>
unsigned int s3_inplace_fifo_mux< T >::stub_queue::size   const [virtual]
 

Interface from s3_inplace_fifo_base<T>.

Forward or wait, depending on mux->crit_is_selected().

Implements s3_fifo_base.

Definition at line 71 of file s3_inplace_fifo_mux.tcc.

References CONST_OVERRIDE_THIS, lock_select, mux, stub_queue, and unlock_next.

template<typename T>
void s3_inplace_fifo_mux< T >::stub_queue::unlock_next   [protected]
 

Auto-select next queue in list (if auto_select enabled) and relinquish mux->state_lock.

Should always appear paired with lock_select (with unlock_next last).

Definition at line 181 of file s3_inplace_fifo_mux.tcc.

References mux.

Referenced by full, nbl_open_input, nbl_open_output, open_input, open_output, pop, push, and size.


Member Data Documentation

template<typename T>
s3_inplace_fifo_mux<T>* s3_inplace_fifo_mux::stub_queue::mux [protected]
 

Definition at line 92 of file s3_inplace_fifo_mux.h.

Referenced by close_input, close_output, full, lock_select, nbl_open_input, nbl_open_output, open_input, open_output, pop, push, size, and unlock_next.

template<typename T>
s3_condition s3_inplace_fifo_mux::stub_queue::waiter [protected]
 

Definition at line 90 of file s3_inplace_fifo_mux.h.

Referenced by lock_select.


The documentation for this class was generated from the following files:
Send comments to: s3fc@stonethree.com SourceForge Logo