Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

OmniEvents::EventQueue Class Reference

The EventQueue is a circular buffer, that contains _size-1 events. More...

#include <EventQueue.h>

List of all members.

Public Methods

 EventQueue (long size=1023)
virtual ~EventQueue ()
void append (list< CORBA::Any * > &events)

Private Attributes

long _next
 Always points to the next slot to which an event will be written. More...

long _size
CORBA::Any ** _queue

Friends

class Reader


Detailed Description

The EventQueue is a circular buffer, that contains _size-1 events.

Events are stored as pointers to CORBA::Any. The Reader class is a mix-in for classes that need to consume events from the queue. Readers that cannot keep up with the flow of messages into the queue will skip _size events whenever the back of the queue catches up with them. This implements the usual 'fresh business first' pattern for deciding what to discard.

Events are not scavenged from the queue. This means that once the queue has filled up, it will never contain fewer than _size-1 events. This strategy is usually somewhat wasteful of memory, but guarantees that the worst-case memory usage will never rise above the defined maximum.

Definition at line 50 of file EventQueue.h.


Constructor & Destructor Documentation

OmniEvents::EventQueue::EventQueue long    size = 1023
 

Definition at line 33 of file EventQueue.cc.

References _queue, _size, and size.

OmniEvents::EventQueue::~EventQueue   [virtual]
 

Definition at line 45 of file EventQueue.cc.

References _queue, and _size.


Member Function Documentation

void OmniEvents::EventQueue::append list< CORBA::Any * > &    events
 

Definition at line 53 of file EventQueue.cc.

References _next, _queue, and _size.

Referenced by OmniEvents::ConsumerAdmin_i::send().


Friends And Related Function Documentation

friend class Reader [friend]
 

Definition at line 77 of file EventQueue.h.


Member Data Documentation

long OmniEvents::EventQueue::_next [private]
 

Always points to the next slot to which an event will be written.

Definition at line 73 of file EventQueue.h.

Referenced by append(), and OmniEvents::EventQueue::Reader::moreEvents().

CORBA::Any** OmniEvents::EventQueue::_queue [private]
 

Definition at line 75 of file EventQueue.h.

Referenced by append(), EventQueue(), OmniEvents::EventQueue::Reader::nextEvent(), and ~EventQueue().

long OmniEvents::EventQueue::_size [private]
 

Definition at line 74 of file EventQueue.h.

Referenced by append(), EventQueue(), OmniEvents::EventQueue::Reader::nextEvent(), and ~EventQueue().


The documentation for this class was generated from the following files:
Generated on Fri Dec 12 10:53:13 2003 for OmniEvents by doxygen1.2.15