DABC (Data Acquisition Backbone Core)  2.9.9
Data Structures | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
dabc::Queue< T, canexpand > Class Template Reference

Template of circular queue. More...

#include <dabc/Queue.h>

Inheritance diagram for dabc::Queue< T, canexpand >:
dabc::RecordsQueue< dabc::HistoryItem > dabc::RecordsQueue< dabc::Manager::ParamRec >

Data Structures

class  Iterator
 

Public Member Functions

void Allocate (unsigned capacity)
 
T & Back () const
 
Iterator begin ()
 
unsigned Capacity () const
 
virtual void CopyTo (T *tgt)
 Method can be used to copy content of the queue into externally allocated array. More...
 
bool Empty () const
 
Iterator end ()
 
bool Expand (unsigned newcapacity=0)
 
T & Front () const
 
bool Full () const
 
void Init (unsigned capacity)
 
T & Item (unsigned indx) const
 
T * ItemPtr (unsigned indx) const
 
bool MakePlaceForNext ()
 
Pop ()
 
void PopOnly ()
 
void Push (T val)
 
T * PushEmpty ()
 
void PushRef (const T &val)
 
 Queue ()=default
 
 Queue (unsigned capacity)
 
bool Remove (T value)
 
bool RemoveItem (unsigned indx)
 
void Reset ()
 
unsigned Size () const
 
virtual ~Queue ()
 

Protected Member Functions

T * QueueItem (unsigned n)
 

Protected Attributes

T * fBorder {nullptr}
 
unsigned fCapacity {0}
 
T * fHead {nullptr}
 
unsigned fInitSize {0}
 original size of the queue, restored then Reset() method is called More...
 
T * fQueue {nullptr}
 
unsigned fSize {0}
 
T * fTail {nullptr}
 

Friends

class Queue< T, canexpand >::Iterator
 

Detailed Description

template<class T, bool canexpand = false>
class dabc::Queue< T, canexpand >

Template of circular queue.

Definition at line 41 of file Queue.h.

Constructor & Destructor Documentation

◆ Queue() [1/2]

template<class T , bool canexpand = false>
dabc::Queue< T, canexpand >::Queue ( )
default

◆ Queue() [2/2]

template<class T , bool canexpand = false>
dabc::Queue< T, canexpand >::Queue ( unsigned  capacity)
inline

Definition at line 98 of file Queue.h.

◆ ~Queue()

template<class T , bool canexpand = false>
virtual dabc::Queue< T, canexpand >::~Queue ( )
inlinevirtual

Definition at line 103 of file Queue.h.

Member Function Documentation

◆ QueueItem()

template<class T , bool canexpand = false>
T* dabc::Queue< T, canexpand >::QueueItem ( unsigned  n)
inlineprotected

Definition at line 93 of file Queue.h.

◆ Init()

template<class T , bool canexpand = false>
void dabc::Queue< T, canexpand >::Init ( unsigned  capacity)
inline

Definition at line 109 of file Queue.h.

◆ Allocate()

template<class T , bool canexpand = false>
void dabc::Queue< T, canexpand >::Allocate ( unsigned  capacity)
inline

Definition at line 115 of file Queue.h.

◆ CopyTo()

template<class T , bool canexpand = false>
virtual void dabc::Queue< T, canexpand >::CopyTo ( T *  tgt)
inlinevirtual

Method can be used to copy content of the queue into externally allocated array.

Reimplemented in dabc::RecordsQueue< T, canexpand >.

Definition at line 136 of file Queue.h.

◆ Expand()

template<class T , bool canexpand = false>
bool dabc::Queue< T, canexpand >::Expand ( unsigned  newcapacity = 0)
inline

Definition at line 150 of file Queue.h.

◆ Remove()

template<class T , bool canexpand = false>
bool dabc::Queue< T, canexpand >::Remove ( value)
inline

Definition at line 170 of file Queue.h.

◆ RemoveItem()

template<class T , bool canexpand = false>
bool dabc::Queue< T, canexpand >::RemoveItem ( unsigned  indx)
inline

Definition at line 190 of file Queue.h.

◆ MakePlaceForNext()

template<class T , bool canexpand = false>
bool dabc::Queue< T, canexpand >::MakePlaceForNext ( )
inline

Definition at line 210 of file Queue.h.

◆ Push()

template<class T , bool canexpand = false>
void dabc::Queue< T, canexpand >::Push ( val)
inline

Definition at line 215 of file Queue.h.

◆ PushEmpty()

template<class T , bool canexpand = false>
T* dabc::Queue< T, canexpand >::PushEmpty ( )
inline

Definition at line 226 of file Queue.h.

◆ PushRef()

template<class T , bool canexpand = false>
void dabc::Queue< T, canexpand >::PushRef ( const T &  val)
inline

Definition at line 240 of file Queue.h.

◆ PopOnly()

template<class T , bool canexpand = false>
void dabc::Queue< T, canexpand >::PopOnly ( )
inline

Definition at line 251 of file Queue.h.

◆ Pop()

template<class T , bool canexpand = false>
T dabc::Queue< T, canexpand >::Pop ( )
inline

Definition at line 259 of file Queue.h.

◆ Front()

template<class T , bool canexpand = false>
T& dabc::Queue< T, canexpand >::Front ( ) const
inline

Definition at line 270 of file Queue.h.

◆ Item()

template<class T , bool canexpand = false>
T& dabc::Queue< T, canexpand >::Item ( unsigned  indx) const
inline

Definition at line 280 of file Queue.h.

◆ ItemPtr()

template<class T , bool canexpand = false>
T* dabc::Queue< T, canexpand >::ItemPtr ( unsigned  indx) const
inline

Definition at line 291 of file Queue.h.

◆ Back()

template<class T , bool canexpand = false>
T& dabc::Queue< T, canexpand >::Back ( ) const
inline

Definition at line 304 of file Queue.h.

◆ Reset()

template<class T , bool canexpand = false>
void dabc::Queue< T, canexpand >::Reset ( )
inline

Definition at line 312 of file Queue.h.

◆ Capacity()

template<class T , bool canexpand = false>
unsigned dabc::Queue< T, canexpand >::Capacity ( ) const
inline

Definition at line 319 of file Queue.h.

◆ Size()

template<class T , bool canexpand = false>
unsigned dabc::Queue< T, canexpand >::Size ( ) const
inline

Definition at line 321 of file Queue.h.

◆ Full()

template<class T , bool canexpand = false>
bool dabc::Queue< T, canexpand >::Full ( ) const
inline

Definition at line 323 of file Queue.h.

◆ Empty()

template<class T , bool canexpand = false>
bool dabc::Queue< T, canexpand >::Empty ( ) const
inline

Definition at line 325 of file Queue.h.

◆ begin()

template<class T , bool canexpand = false>
Iterator dabc::Queue< T, canexpand >::begin ( )
inline

Definition at line 327 of file Queue.h.

◆ end()

template<class T , bool canexpand = false>
Iterator dabc::Queue< T, canexpand >::end ( )
inline

Definition at line 328 of file Queue.h.

Friends And Related Function Documentation

◆ Queue< T, canexpand >::Iterator

template<class T , bool canexpand = false>
friend class Queue< T, canexpand >::Iterator
friend

Definition at line 83 of file Queue.h.

Field Documentation

◆ fQueue

template<class T , bool canexpand = false>
T* dabc::Queue< T, canexpand >::fQueue {nullptr}
protected

Definition at line 85 of file Queue.h.

◆ fBorder

template<class T , bool canexpand = false>
T* dabc::Queue< T, canexpand >::fBorder {nullptr}
protected

Definition at line 86 of file Queue.h.

◆ fCapacity

template<class T , bool canexpand = false>
unsigned dabc::Queue< T, canexpand >::fCapacity {0}
protected

Definition at line 87 of file Queue.h.

◆ fSize

template<class T , bool canexpand = false>
unsigned dabc::Queue< T, canexpand >::fSize {0}
protected

Definition at line 88 of file Queue.h.

◆ fHead

template<class T , bool canexpand = false>
T* dabc::Queue< T, canexpand >::fHead {nullptr}
protected

Definition at line 89 of file Queue.h.

◆ fTail

template<class T , bool canexpand = false>
T* dabc::Queue< T, canexpand >::fTail {nullptr}
protected

Definition at line 90 of file Queue.h.

◆ fInitSize

template<class T , bool canexpand = false>
unsigned dabc::Queue< T, canexpand >::fInitSize {0}
protected

original size of the queue, restored then Reset() method is called

Definition at line 91 of file Queue.h.


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