Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class 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 Member Functions

 EventQueue (long size=1023)
virtual ~EventQueue ()
void setFilter (Filter *filter)
void append (CORBA::Any *event)

Private Attributes

long _next
 Always points to the next slot to which an event will be written.
long _size
CORBA::Any ** _queue
auto_ptr< Filter_filter

Friends

class Reader

Classes

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 56 of file EventQueue.h.


Constructor & Destructor Documentation

OmniEvents::EventQueue::EventQueue long  size = 1023  ) 
 

Definition at line 43 of file EventQueue.cc.

References _queue, _size, and DB.

OmniEvents::EventQueue::~EventQueue  )  [virtual]
 

Definition at line 57 of file EventQueue.cc.

References _queue, and _size.


Member Function Documentation

void OmniEvents::EventQueue::append CORBA::Any *  event  )  [inline]
 

Definition at line 78 of file EventQueue.h.

References _filter, _next, _queue, and _size.

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

void OmniEvents::EventQueue::setFilter Filter filter  )  [inline]
 

Definition at line 72 of file EventQueue.h.

References _filter.

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


Friends And Related Function Documentation

friend class Reader [friend]
 

Definition at line 95 of file EventQueue.h.


Member Data Documentation

auto_ptr<Filter> OmniEvents::EventQueue::_filter [private]
 

Definition at line 93 of file EventQueue.h.

Referenced by append(), and setFilter().

long OmniEvents::EventQueue::_next [private]
 

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

Definition at line 90 of file EventQueue.h.

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

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

Definition at line 92 of file EventQueue.h.

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

long OmniEvents::EventQueue::_size [private]
 

Definition at line 91 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 Aug 26 20:56:16 2005 for OmniEvents by  doxygen 1.4.3-20050530