xorp

UpdateQueue< A > Class Template Reference

Update Queue for RIP Route entries. More...

#include <update_queue.hh>

List of all members.

Public Types

typedef ref_ptr< ReaderReadIterator
typedef RouteEntryRef< A > RouteUpdate

Public Member Functions

void push_back (const RouteUpdate &ru)
 Add update to back of queue.
void flush ()
 Remove all queued entries and reset all read iterators to the front of the queue.
ReadIterator create_reader ()
 Create a read iterator.
void destroy_reader (ReadIterator &r)
 Destroy read iterator.
bool reader_valid (const ReadIterator &r)
 Check ReadIterator's validity.
const RouteEntry< A > * next (ReadIterator &r)
 Increment iterator and return pointer to entry if available.
const RouteEntry< A > * get (ReadIterator &r) const
 Get the RouteEntry associated with the read iterator.
void ffwd (ReadIterator &r)
 Advance read iterator to end of update queue.
void rwd (ReadIterator &r)
 Move read iterator to first entry of update queue.
uint32_t updates_queued () const
 Return number of updates held.

Protected Types

typedef UpdateQueueReader< A > Reader

Protected Attributes

UpdateQueueImpl< A > * _impl

Detailed Description

template<typename A>
class UpdateQueue< A >

Update Queue for RIP Route entries.

The Update Queue has is conceptually a single writer multi-reader queue. It is used to store state for triggered updates and may be used unsolicited responses (routing table announcements).


Member Function Documentation

template<typename A >
UpdateQueue< A >::ReadIterator UpdateQueue< A >::create_reader ( )

Create a read iterator.

These are reference counted entities that need to be stored in order to operate. The newly created reader is set to the end of the update queue.

template<typename A >
void UpdateQueue< A >::destroy_reader ( ReadIterator r)

Destroy read iterator.

This method detaches the iterator from the update queue. Use of the iterator after this call is unsafe.

template<typename A >
void UpdateQueue< A >::ffwd ( ReadIterator r)

Advance read iterator to end of update queue.

Calls to next and get will return 0 until further updates occur.

template<typename A >
const RouteEntry< A > * UpdateQueue< A >::get ( ReadIterator r) const

Get the RouteEntry associated with the read iterator.

Returns:
A pointer to a RouteEntry if available, 0 otherwise.
template<typename A >
const RouteEntry< A > * UpdateQueue< A >::next ( ReadIterator r)

Increment iterator and return pointer to entry if available.

Returns:
A pointer to a RouteEntry if available, 0 otherwise.
template<typename A >
bool UpdateQueue< A >::reader_valid ( const ReadIterator r)

Check ReadIterator's validity.

Parameters:
rreader to be checked.
Returns:
true if r is an active read iterator, false if iterator does not belong to this instance or has been destroyed.
template<typename A >
uint32_t UpdateQueue< A >::updates_queued ( ) const

Return number of updates held.

Note: this may be more than are available for reading since there is internal buffering and UpdateQueue iterators attach at the end of the UpdateQueue.

Returns:
number of updates queued.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations