alma::acs::nc::CircularQueue Class Reference

Collaboration diagram for alma::acs::nc::CircularQueue:
Collaboration graph
[legend]

List of all members.

Classes

class  EventDroppedException

Public Member Functions

 CircularQueue (int size)
 CircularQueue ()
void push (StructuredEvent e) throws EventDroppedException
void clear ()
StructuredEvent pop ()

Private Attributes

Vector< StructuredEvent > queue
int length

Detailed Description

Circular Queue implemented to maintain temporally structured events when the Notify Service is down.

See also:
SimpleSupplier.publishCORBAEvent
Author:
Jorge Avarias <javarias [at] nrao.edu>

Constructor & Destructor Documentation

alma::acs::nc::CircularQueue::CircularQueue ( int  size  )  [inline]

Initializes the Queue with custom value size

Parameters:
size the size of the queue

References queue.

alma::acs::nc::CircularQueue::CircularQueue (  )  [inline]

Initializes the Queue with default value = 100


Member Function Documentation

void alma::acs::nc::CircularQueue::clear (  )  [inline]

Remove all the elements of the queue

References length, and queue.

StructuredEvent alma::acs::nc::CircularQueue::pop (  )  [inline]

Remove the first element in the queue and return it. If there is no elements in the queue returns null

Returns:
the first element in the queue

References length, and queue.

Referenced by alma::acs::nc::SimpleSupplier::publishCORBAEvent().

void alma::acs::nc::CircularQueue::push ( StructuredEvent  e  )  throws EventDroppedException [inline]

Insert a structured event at the end of the queue. If the queue is full, inserts the structured event and remove the first event in the queue

Parameters:
e the event to be inserted in the queue
Exceptions:
EventDroppedException if the queue dropped an event, but the object will be inserted anyways in the queue and the removed event will be returned in the exception.

References length, and queue.

Referenced by alma::acs::nc::SimpleSupplier::publishCORBAEvent().


Member Data Documentation

Referenced by clear(), pop(), and push().

Vector<StructuredEvent> alma::acs::nc::CircularQueue::queue [private]

Referenced by CircularQueue(), clear(), pop(), and push().


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

Generated by  doxygen 1.6.2