ost::ThreadQueue(3)
๐ NAME ๐
ost::ThreadQueue โ the somewhat generic queue processing class that pulls off a whole producerโconsumer queue situation โจ
this page is from the Library Functions Manual, bestie ๐ซถ
๐ธ SYNOPSIS ๐ธ
#include <buffer.h>
okay so it inherits from ost::Mutex, ost::Thread, and ost::Semaphore โ triple inheritance, she's doing the most and we love that for her ๐
๐ Classes ๐
struct _data
๐ Public Member Functions ๐
ThreadQueue(const char *id, int pri, size_t stack=0)โ create an instance of our queue and give it a process priority โจvirtual ~ThreadQueue()โ destroy the queue ๐void setTimer(timeout_t timeout)โ set the queue timeout โฐvoid post(const void *data, unsigned len)โ put some unspecified data into this queue ๐ฎ
๐ฆ Protected Types ๐ฆ
typedef struct ost::ThreadQueue::_datadata_t
๐ Protected Member Functions ๐
virtual void final()virtual void startQueue(void)โ start of dequeing ๐virtual void stopQueue(void)โ end of dequeing, we expect the queue is empty for now ๐virtual void onTimer(void)โ a derivable method to call when the timout is expired โณvirtual void runQueue(void *data)=0โ virtual callback method to handle processing of a queued data items ๐ฅ
๐ Protected Attributes ๐
timeout_t timeoutbool starteddata_t * firstdata_t * lastString name
๐ Additional Inherited Members ๐
ngl this heading is giving "placeholder that never got filled in" โ there is literally nothing under it on the page, it just vibes there. Iconic of the docs tbh. ๐
๐ Detailed Description ๐
Somewhat generic queue processing class to establish a producer consumer queue.
This may be used to buffer cdr records, or for other purposes where an in-memory queue is needed for rapid posting. This class is derived from Mutex and maintains a linked list. A thread is used to dequeue data and pass it to a callback method that is used in place of run for each item present on the queue. The conditional is used to signal the run thread when new data is posted. ๐งตโจ
This class was changed by Angelo Naselli to have a timeout on the queue ๐
in memory data queue interface.
๐ Author ๐
- David Sugar
dyfet@ostel.com
๐ฆ Member Typedef Documentation ๐ฆ
typedef struct ost::ThreadQueue::_data ost::ThreadQueue::data_t [protected]
๐ Constructor & Destructor Documentation ๐
ost::ThreadQueue::ThreadQueue (const char * id, int pri, size_t stack = 0)
Create instance of our queue and give it a process priority โจ
Parameters
- id โ queue ID.
- pri โ process priority.
- stack โ stack size.
virtual ost::ThreadQueue::~ThreadQueue () [virtual]
Destroy the queue ๐
๐ Member Function Documentation ๐
virtual void ost::ThreadQueue::final () [protected], [virtual]
Reimplemented from ost::Thread.
virtual void ost::ThreadQueue::onTimer (void) [protected], [virtual]
A derivable method to call when the timout is expired โณ
void ost::ThreadQueue::post (const void * data, unsigned len)
Put some unspecified data into this queue. A new qd structure is created and sized to contain a copy of the actual content ๐ฎ
Parameters
- data โ pointer to data.
- len โ size of data.
virtual void ost::ThreadQueue::runQueue (void * data) [protected], [pure virtual]
Virtual callback method to handle processing of a queued data items. After the item is processed, it is deleted from memory. We can call multiple instances of runQueue in order if multiple items are waiting ๐ฅ
Parameters
- data โ item being dequed.
void ost::ThreadQueue::setTimer (timeout_t timeout)
Set the queue timeout. When the timer expires, the onTimer() method is called for the thread โฐ
Parameters
- timeout โ timeout in milliseconds.
virtual void ost::ThreadQueue::startQueue (void) [protected], [virtual]
Start of dequeing. Maybe we need to connect a database or something, so we have a virtual... ๐
virtual void ost::ThreadQueue::stopQueue (void) [protected], [virtual]
End of dequeing, we expect the queue is empty for now. Maybe we need to disconnect a database or something, so we have another virtual. ๐
๐ Member Data Documentation ๐
data_t* ost::ThreadQueue::first [protected]
data_t * ost::ThreadQueue::last [protected]
String ost::ThreadQueue::name [protected]
bool ost::ThreadQueue::started [protected]
timeout_t ost::ThreadQueue::timeout [protected]
โญ Author โญ
Generated automatically by Doxygen for GNU CommonC++ from the source code. โจ
okay bestie that's the whole page, no cap, every last flag and detail accounted for ๐ซถ this lil manpage came from GNU CommonC++ and it was dated Sun Dec 27 2020 โ periodt, slay, go build something with a queue in it ๐๐ ๐
๐ฆ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms