eq::net::CommandQueue Class Reference

#include <commandQueue.h>

Inheritance diagram for eq::net::CommandQueue:

[legend]
Collaboration diagram for eq::net::CommandQueue:

[legend]

List of all members.


Detailed Description

A CommandQueue is a thread-safe queue for command packets.

Definition at line 24 of file net/commandQueue.h.


Public Member Functions

virtual void push (Command &packet)
 Push a command to the queue.
virtual void pushFront (Command &packet)
 Push a command to the front of the queue.
virtual void wakeup ()
 Wake up the command queue, pop() will return 0.
virtual Commandpop ()
 Pop a command from the queue.
virtual CommandtryPop ()
 Try to pop a command from the queue.
void release (Command *command)
 Release a command obtained by pop() or tryPop().
Commandback () const
 Peek the command at the end of the queue.
bool empty () const
virtual void flush ()
 Flush all cached commands.
size_t size () const
 CHECK_THREAD_DECLARE (_thread)

Member Function Documentation

void eq::net::CommandQueue::push ( Command packet  )  [virtual]

Push a command to the queue.

Parameters:
packet the command packet.

Reimplemented in eq::CommandQueue.

Definition at line 45 of file net/commandQueue.cpp.

References eq::net::Command::_dispatched, eq::net::CommandCache::alloc(), eq::net::Command::isValid(), eq::base::Lock::set(), and eq::base::Lock::unset().

Referenced by eq::CommandQueue::push().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::net::CommandQueue::pushFront ( Command packet  )  [virtual]

Push a command to the front of the queue.

Reimplemented in eq::CommandQueue.

Definition at line 58 of file net/commandQueue.cpp.

References eq::net::Command::_dispatched, eq::net::CommandCache::alloc(), eq::net::Command::isValid(), eq::base::Lock::set(), and eq::base::Lock::unset().

Referenced by eq::CommandQueue::pushFront().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void eq::net::CommandQueue::wakeup (  )  [inline, virtual]

Wake up the command queue, pop() will return 0.

Reimplemented in eq::CommandQueue.

Definition at line 41 of file net/commandQueue.h.

Referenced by eq::CommandQueue::wakeup().

Here is the caller graph for this function:

Command * eq::net::CommandQueue::pop (  )  [virtual]

Pop a command from the queue.

The returned packet has to be released after usage.

Returns:
the next command in the queue.

Reimplemented in eq::CommandQueue.

Definition at line 71 of file net/commandQueue.cpp.

Referenced by eq::CommandQueue::pop().

Here is the caller graph for this function:

Command * eq::net::CommandQueue::tryPop (  )  [virtual]

Try to pop a command from the queue.

The returned packet has to be released after usage.

Returns:
the next command in the queue, or 0 if no command is queued.

Reimplemented in eq::CommandQueue.

Definition at line 78 of file net/commandQueue.cpp.

Referenced by eq::CommandQueue::tryPop().

Here is the caller graph for this function:

void eq::net::CommandQueue::release ( Command command  ) 

Release a command obtained by pop() or tryPop().

Definition at line 84 of file net/commandQueue.cpp.

References eq::net::CommandCache::release(), eq::base::Lock::set(), and eq::base::Lock::unset().

Referenced by eq::Config::exit(), eq::Config::nextEvent(), eq::Client::processCommand(), and eq::Config::tryNextEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

Command * eq::net::CommandQueue::back (  )  const

Peek the command at the end of the queue.

Returns:
the last command in the queue, or 0 if no command is queued.

Definition at line 94 of file net/commandQueue.cpp.

bool eq::net::CommandQueue::empty (  )  const [inline]

Returns:
true if the command queue is empty, false if not.

Definition at line 75 of file net/commandQueue.h.

Referenced by flush(), eq::CommandQueue::pop(), and eq::Node::~Node().

Here is the caller graph for this function:

void eq::net::CommandQueue::flush (  )  [virtual]

Flush all cached commands.

Reimplemented in eq::CommandQueue.

Definition at line 26 of file net/commandQueue.cpp.

References empty(), eq::net::CommandCache::flush(), eq::net::CommandCache::release(), eq::base::Lock::set(), and eq::base::Lock::unset().

Referenced by eq::CommandQueue::flush().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t eq::net::CommandQueue::size (  )  const [inline]

Returns:
the size of the queue.

Definition at line 81 of file net/commandQueue.h.


The documentation for this class was generated from the following files:
Generated on Sat Dec 6 12:01:51 2008 for Equalizer 0.6 by  1.5.5