OmniEvents
OmniEvents::EventQueue Class Reference

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

#include <EventQueue.h>

Classes

class  Reader
 

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
 

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

◆ EventQueue()

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

Definition at line 43 of file EventQueue.cc.

References _queue, _size, and DB.

◆ ~EventQueue()

OmniEvents::EventQueue::~EventQueue ( )
virtual

Definition at line 57 of file EventQueue.cc.

References _queue, and _size.

Member Function Documentation

◆ append()

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().

◆ setFilter()

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 Symbol Documentation

◆ Reader

Definition at line 95 of file EventQueue.h.

Member Data Documentation

◆ _filter

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

Definition at line 93 of file EventQueue.h.

Referenced by append(), and setFilter().

◆ _next

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(), OmniEvents::EventQueue::Reader::moreEvents(), and OmniEvents::EventQueue::Reader::nextEvent().

◆ _queue

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

Definition at line 92 of file EventQueue.h.

Referenced by append(), EventQueue(), and ~EventQueue().

◆ _size

long OmniEvents::EventQueue::_size
private

Definition at line 91 of file EventQueue.h.

Referenced by append(), EventQueue(), and ~EventQueue().


The documentation for this class was generated from the following files: