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 (potentially limited by the given timeout) 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 (potentially limited by the given timeout) if there are none.

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.
Blocking read can be interrupted by calling BundleList::notify(). If this is done, the return value will be NULL.

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 Sat Sep 8 08:36:21 2007 for DTN Reference Implementation by  doxygen 1.5.3