A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/sync__queue_8hpp_source.html below:

NCBI C++ ToolKit: include/util/sync_queue.hpp Source File

1 #ifndef UTIL___SYNC_QUEUE__HPP 2 #define UTIL___SYNC_QUEUE__HPP 148 template

<

class

Type,

class

Container,

class

Traits>

153 template

<

class

Type,

class

Container>

156 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

159 template

<

class

Type,

class

Container,

class

Traits>

162 template

<

class

Type,

class

Container,

class

Traits>

214 template

<

class

Type,

class

Container = deque<Type>,

215  class

Traits = CSyncQueue_DefaultTraits >

224  typedef typename

Container::size_type

TSize

;

628 template

<

class

Type,

class

Container,

class

Traits>

643 #ifdef NCBI_COMPILER_WORKSHOP 648  typename

TNativeConstIter::iterator_category,

708

typename

TQueue

::TNativeIter, Traits>;

711

typename TQueue::TNativeConstIter, Traits>;

725

template <class Type, class Container, class Traits>

744 #ifdef NCBI_COMPILER_WORKSHOP 749  typename

TNativeIter::iterator_category,

816 template

<

class

Type,

class

NotType>

821 template

<

class

Type>

829 template

<

class

Type,

class

Container>

847 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

862  typedef typename

TNativeIterator::difference_type

TDiff

;

864  typedef typename

TNativeIterator::reference

TRef

;

896  TPtr

operator-> (

void

)

const

;

909  void

Invalidate(

void

);

916  void

CheckValid(

void

)

const

;

920  void

CheckMatched(

const TThisType

& other)

const

;

939 

TNativeIterator x_GetBase()

const

;

1001  virtual const char

* GetErrCodeString(

void

)

const override

;

1014 template

<

class

Key,

1018

:

public set

<Key, Compare, Allocator>

1026

{ TBaseType::insert(elem); }

1027  typename

TBaseType::const_reference

front

()

const 1028 

{

return

*TBaseType::begin(); }

1030

{ TBaseType::erase(TBaseType::begin()); }

1041 template

<

class

Key,

1045

:

public multiset

<Key, Compare, Allocator>

1054

TBaseType::insert(std::upper_bound(TBaseType::begin(),

1057

TBaseType::key_comp()), elem);

1059  typename

TBaseType::const_reference

front

()

const 1060 

{

return

*TBaseType::begin(); }

1062

{ TBaseType::erase(TBaseType::begin()); }

1066

TBaseType::erase(iter);

1073

TBaseType::erase(left, right);

1087 template

<

class Type

,

1088  class

Container = vector<Type>,

1089  class Compare

= less<typename Container::value_type> >

1091

:

public

priority_queue<Type, Container, Compare>

1094  typedef

priority_queue<Type, Container, Compare>

TBaseType

;

1107  typename

TBaseType::const_reference

front

()

const 1108 

{

return

TBaseType::top(); }

1110

{ TBaseType::pop(); }

1127  "Cannot obtain necessary queue state within a given timeout."

);

1135  "The queue has reached its size limit. " 1136  "Cannot push to it anymore."

);

1144  "The queue is empty. Can't pop from it any value."

);

1153 template

<

class

Type,

class

Container,

class

Traits>

1175  if

(!Lock(pqueue, timeout)) {

1226 template

<

class

Type,

class

Container,

class

Traits>

1230

m_MaxSize(max_size),

1238  if

(max_size == 0) {

1240  "Maximum size of the queue must be greater than zero"

);

1245

Traits::CSyncQueue_Traits_Must_Be_Inherited_From_CSyncQueue_DefaultTraits();

1249 template

<

class

Type,

class

Container,

class

Traits>

1261 template

<

class

Type,

class

Container,

class

Traits>

1270 template

<

class

Type,

class

Container,

class

Traits>

1278 template

<

class

Type,

class

Container,

class

Traits>

1282  return

m_Size >= m_MaxSize;

1286 template

<

class

Type,

class

Container,

class

Traits>

1291  if

( !m_TrigLock.TryWait(

CTimeout

(*timeout)) ) {

1303 template

<

class

Type,

class

Container,

class

Traits>

1307  if

(!IsFull() && m_CntWaitNotFull.Get() > 0) {

1308

m_TrigNotFull.Post();

1310  if

(!IsEmpty() && m_CntWaitNotEmpty.Get() > 0) {

1311

m_TrigNotEmpty.Post();

1318 template

<

class

Type,

class

Container,

class

Traits>

1327  bool

is_success =

false

;

1328  if

(

this

< &other_obj) {

1329

is_success = my_lock->

Lock

(

this

) && other_lock->

Lock

(&other_obj);

1332

is_success = other_lock->

Lock

(&other_obj) && my_lock->

Lock

(

this

);

1341 template

<

class

Type,

class

Container,

class

Traits>

1347

TCheckFunc func_to_check,

1350

TErrorThrower throw_error)

1354

unique_ptr<CTimeSpan> real_timeout;

1357

real_timeout.reset(

new CTimeSpan

(*full_tmo));

1359  #if defined(NCBI_THREADS) 1360  else if

(!Traits::IsUsedConcurrently()) {

1363

real_timeout.reset(

new CTimeSpan

(0.0));

1368

real_timeout.reset(

new CTimeSpan

(0.0));

1372  if

(real_timeout.get()) {

1375  if

(!lock->

Lock

(

this

, service_tmo)) {

1379  while

( (this->*func_to_check)() ) {

1396  if

( !is_success ) {

1405  if

(!lock->

Lock

(

this

, &tmo)) {

1413

lock->

Lock

(

this

, service_tmo);

1414  while

( (this->*func_to_check)() ) {

1423

lock->

Lock

(

this

);

1429 template

<

class

Type,

class

Container,

class

Traits>

1437

x_LockAndWait(lock, full_tmo, service_tmo, &TThisType::IsFull,

1442 template

<

class

Type,

class

Container,

class

Traits>

1450

x_LockAndWait(lock, full_tmo, service_tmo, &TThisType::IsEmpty,

1455 template

<

class

Type,

class

Container,

class

Traits>

1460  if

(x_IsGuarded()) {

1464  if

(!

x_Lock

(timeout)) {

1478 template

<

class

Type,

class

Container,

class

Traits>

1485  if

(0 == m_LockCount) {

1494 template

<

class

Type,

class

Container,

class

Traits>

1505 template

<

class

Type,

class

Container,

class

Traits>

1514

m_Store.push_back(elem);

1519 template

<

class

Type,

class

Container,

class

Traits>

1529  TValue

elem = m_Store.front();

1530

m_Store.pop_front();

1536 template

<

class

Type,

class

Container,

class

Traits>

1545 template

<

class

Type,

class

Container,

class

Traits>

1553  if

( !x_IsGuarded() ) {

1554

x_LockAndWaitWhileFull(&lock, full_tmo, service_tmo);

1557

x_Push_NonBlocking(elem);

1561 template

<

class

Type,

class

Container,

class

Traits>

1566

Push(elem, timeout, timeout);

1570 template

<

class

Type,

class

Container,

class

Traits>

1578  if

( !x_IsGuarded() ) {

1579

x_LockAndWaitWhileEmpty(&lock, full_tmo, service_tmo);

1582  return

x_Pop_NonBlocking();

1586 template

<

class

Type,

class

Container,

class

Traits>

1591  return

Pop(timeout, timeout);

1595 template

<

class

Type,

class

Container,

class

Traits>

1601  if

( !x_IsGuarded() ) {

1602  if

(!lock.

Lock

(

this

, timeout)) {

1607

x_Clear_NonBlocking();

1611 template

<

class

Type,

class

Container,

class

Traits>

1615  if

(

this

!= other) {

1621  if

( x_IsGuarded() ) {

1623  if

(!other_lock.

Lock

(other)) {

1630  "Cannot copy queue to another queue locked with " 1631  "access guardian"

);

1634

x_DoubleLock(&my_lock, &other_lock, *other);

1639  "Queue copy cannot be done due to the lack of " 1640  "room in the destination queue."

);

1643  copy

(m_Store.begin(), m_Store.end(), back_inserter(other->

m_Store

));

1644

other->

m_Size

+= m_Size;

1649 template

<

class

Type,

class

Container,

class

Traits>

1654  return

m_Store.begin();

1658 template

<

class

Type,

class

Container,

class

Traits>

1663  return

m_Store.begin();

1667 template

<

class

Type,

class

Container,

class

Traits>

1672  return

m_Store.end();

1676 template

<

class

Type,

class

Container,

class

Traits>

1681  return

m_Store.end();

1685 template

<

class

Type,

class

Container,

class

Traits>

1696 template

<

class

Type,

class

Container,

class

Traits>

1706  while

(srch_iter != m_Store.end() && srch_iter != to_iter) {

1711  if

(to_iter != srch_iter) {

1713  "The beginning of interval must be less or equal " 1714  "to the end of interval."

);

1717  TNativeIter

res = m_Store.erase(from_iter, to_iter);

1727 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1740 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1745

m_Guard->x_RemoveIter(

this

);

1749 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1759 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1763

: m_Guard(other.m_Guard),

1764

m_Iter (other.m_Iter),

1765

m_Valid(other.m_Valid)

1772 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1779

m_Guard->x_RemoveIter(

this

);

1786

m_Guard->x_AddIter(

this

);

1792 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1796

m_Guard->x_RemoveIter(

this

);

1799

m_Iter = TNativeIterator();

1803 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1808  if

(m_Guard != guard) {

1810  "Cannot work with iterators from another access guards."

);

1814 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1817

TNativeIterator, Traits>::CheckValid(

void

)

const 1821  "Iterator can't be used after " 1822  "destroying related access guard."

);

1827 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1832  if

(m_Guard != other.

m_Guard

) {

1834  "Cannot compare iterators from different queue guards."

);

1839 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1848 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1860 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1873 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1885 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1898 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1911 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1924 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1938 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1948 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1962 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1970

CheckMatched(other);

1972  return

m_Iter - other.

m_Iter

;

1977 template

<

class Type

,

class

Container,

1978  class

TNativeIterL,

class

TNativeIterR,

class

Traits>

1988  return

TConstIterator(left) - TConstIterator(right);

1992 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

1996

TNativeIterator, Traits>::operator* (void)

const 2004 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2008

TNativeIterator, Traits>::operator-> (void)

const 2012  return

m_Iter.operator->();

2016 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2028 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2033

CheckMatched(other);

2035  return

m_Iter == other.

m_Iter

;

2039 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2044  return

!(*

this

== other);

2048 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2053

CheckMatched(other);

2055  return

m_Iter < other.

m_Iter

;

2059 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2064  return

other < *

this

;

2068 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2073  return

!(other < *

this

);

2077 template

<

class

Type,

class

Container,

class

TNativeIterator,

class

Traits>

2082  return

!(*

this

< other);

2088 template

<

class Type

,

class

Container,

2089  class

TNativeIterL,

class

TNativeIterR,

class

Traits>

2092

TNativeIterL, Traits>& left,

2094

TNativeIterR, Traits>& right)

2100  return

TConstIterator(left) == TConstIterator(right);

2104 template

<

class Type

,

class

Container,

2105  class

TNativeIterL,

class

TNativeIterR,

class

Traits>

2108

TNativeIterL, Traits>& left,

2110

TNativeIterR, Traits>& right)

2112  return

!(left == right);

2116 template

<

class Type

,

class

Container,

2117  class

TNativeIterL,

class

TNativeIterR,

class

Traits>

2120

TNativeIterL, Traits>& left,

2122

TNativeIterR, Traits>& right)

2128  return

TConstIterator(left) < TConstIterator(right);

2132 template

<

class Type

,

class

Container,

2133  class

TNativeIterL,

class

TNativeIterR,

class

Traits>

2136

TNativeIterL, Traits>& left,

2138

TNativeIterR, Traits>& right)

2140  return

right < left;

2144 template

<

class Type

,

class

Container,

2145  class

TNativeIterL,

class

TNativeIterR,

class

Traits>

2148

TNativeIterL, Traits>& left,

2150

TNativeIterR, Traits>& right)

2152  return

!(right < left);

2156 template

<

class Type

,

class

Container,

2157  class

TNativeIterL,

class

TNativeIterR,

class

Traits>

2160

TNativeIterL, Traits>& left,

2162

TNativeIterR, Traits>& right)

2164  return

!(left < right);

2171 template

<

class

Type,

class

Container,

class

Traits>

2175

: m_Queue(queue_to_guard)

2181 template

<

class

Type,

class

Container,

class

Traits>

2184

Traits>::~CSyncQueue_ConstAccessGuard()

2188

(*it)->Invalidate();

2195 template

<

class

Type,

class

Container,

class

Traits>

2200

m_Iters.push_back(iter);

2204 template

<

class

Type,

class

Container,

class

Traits>

2209

m_Iters.remove(iter);

2213 template

<

class

Type,

class

Container,

class

Traits>

2222 template

<

class

Type,

class

Container,

class

Traits>

2231 template

<

class

Type,

class

Container,

class

Traits>

2240 template

<

class

Type,

class

Container,

class

Traits>

2253 template

<

class

Type,

class

Container,

class

Traits>

2265 template

<

class

Type,

class

Container,

class

Traits>

2273 template

<

class

Type,

class

Container,

class

Traits>

2282 template

<

class

Type,

class

Container,

class

Traits>

2292 template

<

class

Type,

class

Container,

class

Traits>

2306 template

<

class

Type,

class

Container,

class

Traits>

2315 template

<

class

Type,

class

Container,

class

Traits>

2324 template

<

class

Type,

class

Container,

class

Traits>

2333 template

<

class

Type,

class

Container,

class

Traits>

@ eEmpty

no filtering at all.

CAtomicCounter_WithAutoInit –.

Exception object used throughout all CSyncQueue classes.

@ eTimeout

Cannot push or pop within the given timeout.

@ eIterNotValid

Iterator belongs to an already destroyed access guardian.

@ eNoRoom

An attempt to push element to an already full queue while the latter is locked by an access guardian.

@ eWrongInterval

An attempt to specify the interval with iterators when "from" iterator is greater than "to" iterator.

@ eMismatchedIters

An attempt to subtract or compare iterators from different access guardians.

@ eWrongGuardIter

An attempt to erase element via iterator that belongs to another access guardian.

@ eEmpty

An attempt to pop element from an already empty queue while the latter is locked by an access guardia...

@ eWrongMaxSize

Maximum size given is equal to zero.

NCBI_EXCEPTION_DEFAULT(CSyncQueueException, CException)

Access guard to non-constant CSyncQueue.

TRevIterator RBegin(void)

Get reverse iterator pointing to the tail of the queue.

CSyncQueue_AccessGuard< Type, Container, Traits > TThisType

TIterator End(void)

Get iterator pointing to the tail of the queue.

TIterator Begin(void)

Get iterator pointing to the head of the queue.

reverse_iterator< TIterator > TRevIterator

Type of reverse iterator returned from this guard.

TQueue::TIterator TIterator

Type of iterator returned from this guard.

CSyncQueue_AccessGuard(TQueue &queue_to_guard)

Constructor locking given queue.

TQueue & Queue(void) const

Get reference to queue which this object guards to use its constant access methods.

TIterator Erase(TIterator iter)

Erase one element in the queue.

TBaseType::TRevIterator TRevConstIterator

Type of reverse constant iterator returned from this guard.

CSyncQueue_AccessGuard(const TThisType &)

CSyncQueue_ConstAccessGuard< Type, Container, Traits > TBaseType

Short name of the ancestor class.

CSyncQueue< Type, Container, Traits > TQueue

Queue type that this object can guard.

TRevIterator REnd(void)

Get reverse iterator pointing to the head of the queue.

TQueue::TValue TValue

Type of values stored in the queue.

TQueue::TSize TSize

Type of size of the queue.

TQueue::TConstIterator TConstIterator

Type of constant iterator returned from this guard.

Access guard to a constant CSyncQueue.

CSyncQueue_ConstAccessGuard< Type, Container, Traits > TThisType

const CSyncQueue< Type, Container, Traits > TQueue

Queue type that this object can guard.

void x_RemoveIter(TIterBase *iter)

Remove iterator from the list of iterators owned by this object.

TQueue::TValue TValue

Type of values stored in the queue.

void x_AddIter(TIterBase *iter)

Add iterator to the list of iterators owned by this object.

TIterator Begin(void)

Get iterator pointing to the head of the queue.

TQueue & m_Queue

The queue object that this guard locks.

TQueue::TConstIterator TIterator

Type of iterator returned from this guard.

TThisType & operator=(const TThisType &)

TRevIterator TRevConstIterator

For convinience - type of reverse constant iterator.

~CSyncQueue_ConstAccessGuard()

Destructor – unlocks the guarded queue.

CSyncQueue_ConstAccessGuard(const TThisType &)

TQueue::TSize TSize

Type of size of the queue.

TRevIterator RBegin(void)

Get reverse iterator pointing to the tail of the queue.

CSyncQueue_I_Base< Type, Container > TIterBase

Base type for iterator and const_iterator for the queue.

reverse_iterator< TIterator > TRevIterator

Type of reverse iterator returned from this guard.

list< TIterBase * > m_Iters

List of iterators owned by this guard.

TIterator TConstIterator

For convinience - type of constant iterator.

TIterator End(void)

Get iterator pointing to the tail of the queue.

CSyncQueue_ConstAccessGuard(TQueue &queue_to_guard)

Constructor – locks a queue.

TQueue & Queue(void) const

Get reference to queue which this object guards to use its constant access methods.

TRevIterator REnd(void)

Get reverse iterator pointing to the head of the queue.

Default traits for the CSyncQueue class.

static bool IsUsedConcurrently(void)

Tells if the queue can be used from many threads.

static void CSyncQueue_Traits_Must_Be_Inherited_From_CSyncQueue_DefaultTraits(void)

At the moment the only requirement to the traits is to provide a static function which tells f the qu...

Base class for both iterator and const_iterator for SyncQueue Used internally for unifying storage of...

virtual ~CSyncQueue_I_Base(void)

Virtual destructor.

virtual void Invalidate(void)=0

Invalidate this iterator.

Iterator for CSyncQueue (constant or non-constant depending on template parameters).

TNativeIterator m_Iter

Underlying native iterator.

TThisType & operator=(const TThisType &other)

TNativeIterator::reference TRef

Type of reference to stored value.

void CheckMatched(const TThisType &other) const

Check if this iterator can be compared to or subtracted from another iterator.

TNativeIterator::difference_type TDiff

Type of the difference between to iterators.

GetTypeWhenNotEqual< typename TQueue::TNativeConstIter, TNativeIterator >::Result TIntrnNativeConstIter

TNativeIterator::value_type value_type

CSyncQueue_ConstAccessGuard< Type, Container, Traits > TConstAccessGuard

Type of constant access guardian.

bool operator>(const TThisType &other) const

GetTypeWhenNotEqual< TNonConstIter, TThisType >::Result TInternalNonConst

Type for internal use only: non-constant iterator type if this iterator is constant and nothing if th...

TNativeIterator::iterator_category iterator_category

TRef operator[](TDiff offset) const

CSyncQueue_I< Type, Container, TNativeIterator, Traits > TThisType

Short name for this type.

TThisType & operator--(void)

void CheckGuard(TConstAccessGuard *guard) const

Check that this iterator belongs to given access guardian.

TQueue::TIterator TNonConstIter

Version of this class for non-constant iterating.

CSyncQueue_AccessGuard< Type, Container, Traits > TAccessGuard

Type of access guardian.

TNativeIterator x_GetBase() const

Get underlying native iterator.

TThisType & operator++(void)

bool operator<(const TThisType &other) const

bool operator==(const TThisType &other) const

bool m_Valid

The iterator validity flag.

CSyncQueue_I(const TThisType &other)

TThisType operator+(TDiff offset) const

TThisType operator-(TDiff offset) const

void CheckValid(void) const

Check if the iterator is valid. Throw CSyncQueueException if it is not.

bool operator<=(const TThisType &other) const

void Invalidate(void)

Invalidate this iterator.

TNativeIterator::pointer TPtr

Type of pointer to stored value.

bool operator!=(const TThisType &other) const

bool operator>=(const TThisType &other) const

CSyncQueue< Type, Container, Traits > TQueue

Queue type that this object will iterate over.

TConstAccessGuard * m_Guard

Access guard which owns this iterator.

Auto-lock the queue and unlock it when object will be destroyed.

CSyncQueue_InternalAutoLock()

Default ctor.

CSyncQueue_InternalAutoLock< Type, Container, Traits > TMyType

const TQueue * m_Queue

The queue that this object locks.

void Unlock()

Unlock the queue.

CSyncQueue< Type, Container, Traits > TQueue

Short name for queue type that this object can lock.

bool Lock(const TQueue *pqueue, const CTimeSpan *timeout=NULL)

Lock a queue.

CSyncQueue_InternalAutoLock(const TQueue *pqueue, const CTimeSpan *timeout=NULL)

Constructor – lock the queue and waiting for its lock for a given timeout.

CSyncQueue_InternalAutoLock(const TMyType &)

~CSyncQueue_InternalAutoLock()

Destructor – unlock the queue.

Convenience trait implementation which tells that the queue cannot be used from many threads.

static bool IsUsedConcurrently(void)

Convenience trait implementation which tells that the queue can be used from many threads.

static bool IsUsedConcurrently(void)

Adaptor class to use STL multiset<> in CSyncQueue.

TBaseType::iterator erase(typename TBaseType::iterator left, typename TBaseType::iterator right)

void push_back(const typename TBaseType::value_type &elem)

TBaseType::iterator erase(typename TBaseType::iterator iter)

TBaseType::const_reference front() const

multiset< Key, Compare, Allocator > TBaseType

Adaptor class to use STL priority_queue<> in CSyncQueue.

Container::pointer pointer

Container::difference_type difference_type

void push_back(const typename TBaseType::value_type &elem)

CSyncQueue_priority_queue()

Container::iterator iterator

Container::const_pointer const_pointer

priority_queue< Type, Container, Compare > TBaseType

TBaseType::const_reference front() const

Container::const_iterator const_iterator

Adaptor class to use STL set<> in CSyncQueue.

void push_back(const typename TBaseType::value_type &elem)

TBaseType::const_reference front() const

set< Key, Compare, Allocator > TBaseType

Thread-safe queue object with a blocking mechanism.

CAtomicCounter_WithAutoInit m_CntWaitNotFull

Number of threads waiting for the queue to become non-full.

@ kThreadSystemID_None

Value of thread system id that cannot be equal to any thread's id.

CAtomicCounter_WithAutoInit m_CntWaitNotEmpty

Number of threads waiting for the queue to become non-empty.

TNativeIter x_Erase(TNativeIter from_iter, TNativeIter to_iter)

Erase several elements from the underlying container.

void x_LockAndWaitWhileFull(TAutoLock *lock, const CTimeSpan *full_tmo, const CTimeSpan *service_tmo) const

Lock the queue and wait until it has room for more elements.

bool x_Lock(const CTimeSpan *timeout=NULL) const

Lock access to the queue.

CSyncQueue_I< Type, Container, TNativeConstIter, Traits > TConstIterator

Constant iterator on this queue.

Container::value_type TValue

Type of values stored in the queue.

int m_LockCount

Number of lockings of this queue with access guardians in one thread.

TSize GetSize(void) const

Get count of elements already stored in the queue.

atomic< TSize > m_Size

Current number of elements in the queue.

void x_Unlock(void) const

Unlock access to queue.

void x_Push_NonBlocking(const TValue &elem)

Add new element to the end of queue – without locking and blocking.

CSemaphore m_TrigNotFull

Semaphore to signal that the queue has become not full.

CSyncQueue(const TThisType &)

void(* TErrorThrower)(void)

Function to throw an exception; usually points to ThrowSyncQueueNoRoom() or ThrowSyncQueueEmpty()

TValue Pop(const CTimeSpan *full_tmo, const CTimeSpan *service_tmo)

Retrieve an element from the queue.

Container::size_type TSize

Type of size of the queue.

void x_GuardedUnlock(void) const

Unlock the queue by an access guard.

CSemaphore m_TrigNotEmpty

Semaphore to signal that the queue has become not empty.

void x_LockAndWaitWhileEmpty(TAutoLock *lock, const CTimeSpan *full_tmo, const CTimeSpan *service_tmo) const

Lock the queue and wait until it has at least one element.

TThisType & operator=(const TThisType &)

bool IsFull(void) const

Check if the queue is full (has maxSize elements)

void Push(const TValue &elem, const CTimeSpan *timeout=NULL)

Add new element to the end of queue.

Container m_Store

Underlying container to store queue elements.

void x_Clear_NonBlocking(void)

Clear the queue – without locking and blocking.

CSyncQueue_AccessGuard< Type, Container, Traits > TAccessGuard

Type of access guardian for non-constant queue.

TNativeIter x_End(void)

Get iterator pointing to the end of underlying container.

void Push(const TValue &elem, const CTimeSpan *full_tmo, const CTimeSpan *service_tmo)

Add new element to the end of queue.

Container::iterator TNativeIter

Type of underlying iterator.

const TSize m_MaxSize

Maximum size of the queue.

CSemaphore m_TrigLock

Semaphore to signal that the queue can be safely modified.

TValue x_Pop_NonBlocking(void)

Get first element from the queue – without locking and blocking.

void x_DoubleLock(TAutoLock *my_lock, TAutoLock *other_lock, const TThisType &other_obj) const

Lock two queues simultaneously to guard against otherwise possible inter-thread dead-lock.

bool x_IsGuarded(void) const

Check if this queue is locked by some access guard in current thread.

void x_LockAndWait(TAutoLock *lock, const CTimeSpan *full_tmo, const CTimeSpan *service_tmo, TCheckFunc func_to_check, CSemaphore *trigger, CAtomicCounter *counter, TErrorThrower throw_error) const

Lock the queue and wait until the condition function returns FALSE.

void CopyTo(TThisType *other) const

Copy (add) all queue elements to another queue.

bool IsEmpty(void) const

Check if the queue is empty.

TNativeConstIter x_Begin(void) const

Get constant iterator pointing to the start of underlying container.

TValue Pop(const CTimeSpan *timeout=NULL)

Retrieve an element from the queue.

TSize GetMaxSize(void) const

Get the maximum # of elements allowed to be kept in the queue.

CSyncQueue_ConstAccessGuard< Type, Container, Traits > TConstAccessGuard

Type of access guardian for constant queue.

CSyncQueue_InternalAutoLock< Type, Container, Traits > TAutoLock

Short name of auto-lock for this queue type.

TNativeConstIter x_End(void) const

Get constant iterator pointing to the end of underlying container.

atomic< TThreadSystemID > m_CurGuardTID

ID of the thread in which the queue has been locked by a guardian.

CSyncQueue_I< Type, Container, TNativeIter, Traits > TIterator

Non-constant iterator on this queue.

TNativeIter x_Begin(void)

Get iterator pointing to the start of underlying container.

void Clear(const CTimeSpan *timeout=NULL)

Remove all elements from the queue.

Container::const_iterator TNativeConstIter

Type of underlying constant iterator.

CSyncQueue(TSize max_size=numeric_limits< TSize >::max())

Construct queue.

TNativeIter x_Erase(TNativeIter iter)

Erase one element from the underlying container.

bool(CSyncQueue::* TCheckFunc)(void) const

Function to check condition; usually points to IsFull() or IsEmpty()

void x_GuardedLock(const CTimeSpan *timeout=NULL) const

Lock the queue by an access guard.

CSyncQueue< Type, Container, Traits > TThisType

Short name of this queue type.

CTimeout – Timeout interval.

parent_type::value_type value_type

parent_type::iterator iterator

Concept for allocating, resizing and freeing memory block.

parent_type::value_type value_type

Include a standard set of the NCBI C++ Toolkit most basic headers.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

@ ePositive

Value is positive.

TValue Add(int delta) THROWS_NONE

Atomically add value (=delta), and return new counter value.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

EErrCode

Error types that an application can generate.

CVect2< NCBI_PROMOTE(int,U) > operator*(int v1, const CVect2< U > &v2)

CBeginInfo Begin(C &obj)

Get starting point of object hierarchy.

sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)

Returns the sequence::ECompare containment relationship between CSeq_locs.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

void Wait(void)

Wait on semaphore.

static unsigned int GetThreadsCount()

Get total amount of threads This amount does not contain main thread.

pthread_t TThreadSystemID

Define platform-dependent thread ID type.

bool TryWait(unsigned int timeout_sec=0, unsigned int timeout_nsec=0)

Timed wait.

static TThreadSystemID GetCurrentThreadSystemID(void)

Get the current thread ID.

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

ESign GetSign(void) const

Get sign of time span.

@ eStart

Start timer immediately after creating.

#define NCBI_XNCBI_EXPORT

CNcbiMatrix< T > & operator+=(CNcbiMatrix< T > &, const CNcbiMatrix< U > &)

global addition: matrix += matrix

CNcbiMatrix< T > & operator-=(CNcbiMatrix< T > &, const CNcbiMatrix< U > &)

global subtraction: matrix -= matrix

vector< CSeq_align const * >::const_iterator TIterator

constexpr bool empty(list< Ts... >) noexcept

double value_type

The numeric datatype used by the parser.

const GenericPointer< typename T::ValueType > & pointer

static string x_Lock(EMT_Lock how)

NCBI C++ auxiliary debug macros.

Defines NCBI C++ exception handling.

Multi-threading – mutexes; rw-locks; semaphore.

Multi-threading – classes, functions, and features.

Defines: CTimeFormat - storage class for time format.

S & operator--(CNetRef< S > &r, int)

Int4 delta(size_t dimension_, const Int4 *score_)

void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)

int Queue(const string &service, shared_ptr< CPSG_Request > request, CTimeout timeout)

GetTypeWhenNotEqual< Type, Type > Result

Helper template returning some Type when it's not equal to NotType.

CSyncQueue_I< Type, Container, TNativeIterator, Traits > operator+(typename CSyncQueue_I< Type, Container, TNativeIterator, Traits >::TDiff offset, const CSyncQueue_I< Type, Container, TNativeIterator, Traits > &iter)

bool operator!=(const CSyncQueue_I< Type, Container, TNativeIterL, Traits > &left, const CSyncQueue_I< Type, Container, TNativeIterR, Traits > &right)

bool operator<=(const CSyncQueue_I< Type, Container, TNativeIterL, Traits > &left, const CSyncQueue_I< Type, Container, TNativeIterR, Traits > &right)

CSyncQueue_I< Type, Container, TNativeIterL, Traits >::TDiff operator-(const CSyncQueue_I< Type, Container, TNativeIterL, Traits > &left, const CSyncQueue_I< Type, Container, TNativeIterR, Traits > &right)

bool operator<(const CSyncQueue_I< Type, Container, TNativeIterL, Traits > &left, const CSyncQueue_I< Type, Container, TNativeIterR, Traits > &right)

bool operator>=(const CSyncQueue_I< Type, Container, TNativeIterL, Traits > &left, const CSyncQueue_I< Type, Container, TNativeIterR, Traits > &right)

bool operator>(const CSyncQueue_I< Type, Container, TNativeIterL, Traits > &left, const CSyncQueue_I< Type, Container, TNativeIterR, Traits > &right)

void ThrowSyncQueueEmpty(void)

Throw an exception about empty queue with standard message.

void ThrowSyncQueueNoRoom(void)

Throw an exception about no room in a queue with standard message.

bool operator==(const CSyncQueue_I< Type, Container, TNativeIterL, Traits > &left, const CSyncQueue_I< Type, Container, TNativeIterR, Traits > &right)

void ThrowSyncQueueTimeout(void)

Throw an exception about expired timeout with standard message.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4