|
CPN
Computational Process Networks
|
Definition of the writer portion of the CPN queue class. More...
#include <QueueWriter.h>
Collaboration diagram for CPN::QueueWriter:Public Member Functions | |
| QueueWriter (QueueReleaser *qr, shared_ptr< QueueBase >) | |
| ~QueueWriter () | |
| void * | GetRawEnqueuePtr (unsigned thresh, unsigned chan=0) |
| void | Enqueue (unsigned count) |
| void | RawEnqueue (const void *data, unsigned count, unsigned numChans, unsigned chanStride) |
| void | RawEnqueue (const void *data, unsigned count) |
| void | Flush () |
| bool | Flushed () const |
| unsigned | NumChannels () const |
| unsigned | MaxThreshold () const |
| unsigned | QueueLength () const |
| unsigned | Freespace () const |
| bool | Full () const |
| unsigned | ChannelStride () const |
| const std::string & | GetDatatype () const |
| Key_t | GetKey () const |
| void | Release () |
| void | NotifyTerminate () |
| Called by the node. More... | |
| shared_ptr< QueueBase > | GetQueue () |
Private Attributes | |
| QueueReleaser * | releaser |
| shared_ptr< QueueBase > | queue |
Definition of the writer portion of the CPN queue class.
Definition at line 37 of file QueueWriter.h.
| CPN::QueueWriter::QueueWriter | ( | QueueReleaser * | qr, |
| shared_ptr< QueueBase > | q | ||
| ) |
Definition at line 31 of file QueueWriter.cc.
| CPN::QueueWriter::~QueueWriter | ( | ) |
| unsigned CPN::QueueWriter::ChannelStride | ( | ) | const |
Definition at line 67 of file QueueWriter.cc.
References queue.
| void CPN::QueueWriter::Enqueue | ( | unsigned | count | ) |
This function is used to release the buffer obtained with GetRawEnqueuePtr. The count specifies the number of entries that we want to be placed in the buffer.
| count | the number of bytes to be placed in the buffer |
Definition at line 42 of file QueueWriter.cc.
References queue.
| void CPN::QueueWriter::Flush | ( | ) |
| bool CPN::QueueWriter::Flushed | ( | ) | const |
| unsigned CPN::QueueWriter::Freespace | ( | ) | const |
Get the space available in elements.
Definition at line 63 of file QueueWriter.cc.
References queue.
| bool CPN::QueueWriter::Full | ( | ) | const |
Test if the queue is currently full.
Definition at line 65 of file QueueWriter.cc.
References queue.
| const std::string & CPN::QueueWriter::GetDatatype | ( | ) | const |
| Key_t CPN::QueueWriter::GetKey | ( | ) | const |
Definition at line 71 of file QueueWriter.cc.
References queue.
Referenced by Release().
Here is the caller graph for this function:
|
inline |
Definition at line 156 of file QueueWriter.h.
| void * CPN::QueueWriter::GetRawEnqueuePtr | ( | unsigned | thresh, |
| unsigned | chan = 0 |
||
| ) |
Return a pointer to a buffer of memory that contains thresh entries that we can write into.
| thresh | the number bytes we need in the returned buffer. |
| chan | the channel to use |
| BrokenQueueException | if the reader is released |
Definition at line 39 of file QueueWriter.cc.
References queue.
| unsigned CPN::QueueWriter::MaxThreshold | ( | ) | const |
Definition at line 59 of file QueueWriter.cc.
References queue.
| void CPN::QueueWriter::NotifyTerminate | ( | ) |
| unsigned CPN::QueueWriter::NumChannels | ( | ) | const |
Definition at line 57 of file QueueWriter.cc.
References queue.
| unsigned CPN::QueueWriter::QueueLength | ( | ) | const |
| void CPN::QueueWriter::RawEnqueue | ( | const void * | data, |
| unsigned | count, | ||
| unsigned | numChans, | ||
| unsigned | chanStride | ||
| ) |
This function shall be equivalent to a call to GetRqwEnqueuePtr and a memcpy and then a call to Enqueue
The underlying implementatin may implement ether the GetRawEnqueuePtr and Enqueue or RawEnqueue and then implement the other in terms of the one implemented.
| data | pointer to the memory to enqueue |
| count | the number of bytes to enqueue |
| numChans | the number of channels to write to |
| chanStride | the distance in bytes between the beginning of the channels in data. |
| BrokenQueueException | if the reader is released |
Definition at line 44 of file QueueWriter.cc.
References queue.
| void CPN::QueueWriter::RawEnqueue | ( | const void * | data, |
| unsigned | count | ||
| ) |
A version of RawEnqueue to use when there is only 1 channel.
| data | pointer to the memory to enqueue |
| count | the number of bytes to enqueue |
| BrokenQueueException | if the reader is released |
Definition at line 49 of file QueueWriter.cc.
References queue.
| void CPN::QueueWriter::Release | ( | ) |
Release this queue, will start releasing the resources used.
Definition at line 75 of file QueueWriter.cc.
References GetKey(), queue, releaser, and CPN::QueueReleaser::ReleaseWriter().
Here is the call graph for this function:
|
private |
Definition at line 159 of file QueueWriter.h.
Referenced by ChannelStride(), Enqueue(), Flush(), Flushed(), Freespace(), Full(), GetDatatype(), GetKey(), GetRawEnqueuePtr(), MaxThreshold(), NotifyTerminate(), NumChannels(), QueueLength(), RawEnqueue(), Release(), and ~QueueWriter().
|
private |
Definition at line 158 of file QueueWriter.h.
Referenced by Release().
1.8.5