dtn::BlockingBundleList Class Reference

#include <BundleList.h>

Inheritance diagram for dtn::BlockingBundleList:

dtn::BundleList oasys::Logger List of all members.

Detailed Description

A simple derivative to the BundleList class that hooks in an oasys Notifier, which thereby allows inter-thread signalling via a pop_blocking() method.

This allows one thread to block until another has added a bundle to the list.

Definition at line 285 of file BundleList.h.

Public Member Functions

 BlockingBundleList (const std::string &name)
virtual ~BlockingBundleList ()
BundleRef pop_blocking (int timeout=-1)
 Remove (and return) the first bundle on the list, blocking if there are none.
oasys::Notifiernotifier ()
 Accessor for the internal notifier.


Constructor & Destructor Documentation

dtn::BlockingBundleList::BlockingBundleList ( const std::string &  name  ) 

Definition at line 476 of file BundleList.cc.

References oasys::Logger::logpath_, and dtn::BundleList::notifier_.

dtn::BlockingBundleList::~BlockingBundleList (  )  [virtual]

Definition at line 482 of file BundleList.cc.

References dtn::BundleList::notifier_.


Member Function Documentation

BundleRef dtn::BlockingBundleList::pop_blocking ( int  timeout = -1  ) 

Remove (and return) the first bundle on the list, blocking if there are none.

Returns:
a reference to the bundle or a reference to NULL if the list is empty.

Definition at line 496 of file BundleList.cc.

References ASSERT, oasys::Lock::is_locked_by_me(), dtn::BundleList::list_, oasys::SpinLock::lock(), dtn::BundleList::lock_, log_debug, dtn::BundleList::name_, dtn::BundleList::notifier_, dtn::BundleList::pop_front(), oasys::SpinLock::unlock(), and oasys::Notifier::wait().

oasys::Notifier* dtn::BlockingBundleList::notifier (  )  [inline]

Accessor for the internal notifier.

Definition at line 303 of file BundleList.h.

References dtn::BundleList::notifier_.

Referenced by dtn::APIClient::wait_for_bundle().


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 12:54:32 2007 for DTN Reference Implementation by  doxygen 1.5.1