Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
SharedQueue< maxsize, maxentries > Class Template Reference#include <SharedQueue.h>
Inheritance diagram for SharedQueue< maxsize, maxentries >: ![]() Detailed Descriptiontemplate<unsigned int maxsize, unsigned int maxentries>
SharedQueue is a shared memory message buffer for interprocess communication.
|
Public Member Functions | |
SharedQueue () | |
constructor | |
template<class T> | |
bool | SharedQueue (const T &obj) |
inserts a class into the queue | |
void * | reserve (unsigned int size) |
reserves a number of bytes in the queue, LEAVES QUEUE LOCKED, call done when finished | |
void | done () |
call this when you're finished filling in a buffer you received from reserve | |
bool | clear (unsigned int taken) |
checks to see if the number taken by the reader is the number added, and then clears | |
unsigned int | size () const |
returns current number of entries | |
unsigned int | size (unsigned int i) const |
returns size of entry i | |
const void * | data (unsigned int i) const |
returns data of entry i | |
Static Public Attributes | |
static const unsigned int | MAX_SIZE = maxsize |
maximum capacity of data storage for the queue | |
static const unsigned int | MAX_ENTRIES = maxentries |
maximum number of entries that can be queued | |
Protected Types | |
typedef LockScope< ProcessID::NumProcesses > | AutoLock |
for convenience in locking functions | |
Protected Member Functions | |
unsigned int | buf_end () |
returns the first free byte in buf | |
unsigned int | round_up (unsigned int sz) |
returns sz rounded up to the nearest word (makes sz divisible by sizeof(int)) | |
Protected Attributes | |
MutexLock< ProcessID::NumProcesses > | lock |
provides mutual exclusion on non-const functions | |
char | buf [MAX_SIZE] |
data storage | |
unsigned int | len |
holds number of entries | |
entry_t | entries [MAX_ENTRIES] |
holds entry information | |
Classes | |
struct | entry_t |
entry information More... |
|
for convenience in locking functions
Definition at line 71 of file SharedQueue.h. |
|
constructor
Definition at line 90 of file SharedQueue.h. |
|
inserts a class into the queue
|
|
returns the first free byte in buf
Definition at line 63 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::reserve(). |
|
checks to see if the number taken by the reader is the number added, and then clears This will allow you to process entries without locking the entire queue, but still not worry about missing one (or more) if it was added while you were processing the last one. Definition at line 124 of file SharedQueue.h. Referenced by EventTranslator::translateEvents(). |
|
returns data of entry i
Definition at line 59 of file SharedQueue.h. Referenced by EventTranslator::translateEvents(). |
|
call this when you're finished filling in a buffer you received from reserve
Definition at line 44 of file SharedQueue.h. |
|
reserves a number of bytes in the queue, LEAVES QUEUE LOCKED, call done when finished
Definition at line 111 of file SharedQueue.h. |
|
returns sz rounded up to the nearest word (makes sz divisible by sizeof(int))
Definition at line 66 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::reserve(). |
|
returns size of entry i
Definition at line 56 of file SharedQueue.h. |
|
returns current number of entries
Definition at line 53 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::clear(), and EventTranslator::translateEvents(). |
|
data storage
Definition at line 74 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::reserve(). |
|
holds entry information
Definition at line 86 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::reserve(). |
|
holds number of entries
Definition at line 83 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::clear(), and SharedQueue< maxsize, maxentries >::reserve(). |
|
provides mutual exclusion on non-const functions
Definition at line 69 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::clear(), and SharedQueue< maxsize, maxentries >::reserve(). |
|
maximum number of entries that can be queued
Definition at line 32 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::reserve(). |
|
maximum capacity of data storage for the queue
Definition at line 30 of file SharedQueue.h. Referenced by SharedQueue< maxsize, maxentries >::reserve(). |
Tekkotsu v2.2.2 |
Generated Tue Jan 4 15:45:32 2005 by Doxygen 1.4.0 |