Public Member Functions

base::ThreadList Class Reference

A list of threads. More...

#include <libppbase/base/ThreadList.h>

Inheritance diagram for base::ThreadList:
base::Condition

List of all members.

Public Member Functions

 ThreadList ()
 Constructor for empty thread list.
size_t cancel (int timeout=0, size_t max=0)
 Cancels all threads in this list and waits for the threads to terminate.
bool empty ()
 Checks if the thread list is empty.
bool erase (Thread *thread)
 Remove a thread from the list.
size_t insert (Thread *thread)
 Inserts a thread into the list.
size_t reconfig ()
 Sends a reconfigure request to all threads.
size_t size ()
 Gets the number of threads in the list.
size_t wait (int timeout=0)
 Waits for all threads to terminate.
 DISALLOW_COPY_CONSTRUCTOR_AND_ASSIGNMENT (ThreadList)
 a thread list cannot be duplicated

Detailed Description

A list of threads.

Author:
Christoph Schwarz
Version:
$Id: ThreadList.h 21 2010-09-05 04:18:17Z cschwarz1 $

Member Function Documentation

size_t base::ThreadList::cancel ( int  timeout = 0,
size_t  max = 0 
)

Cancels all threads in this list and waits for the threads to terminate.

Parameters:
timeout timeout in seconds to wait until all threads have been terminated, 0 means infinite, <0 means not to wait at all
max maximum number of threads to cancel, 0 means all
Returns:
number of (remaining) threads in the list
bool base::ThreadList::empty (  ) 

Checks if the thread list is empty.

Returns:
true if empty, false if not
bool base::ThreadList::erase ( Thread thread  ) 

Remove a thread from the list.

Parameters:
thread the thread to remove
Returns:
true if the thread was removed, false if the thread was not in the list
size_t base::ThreadList::insert ( Thread thread  ) 

Inserts a thread into the list.

Parameters:
thread the thread to insert
Returns:
number of threads in the list
size_t base::ThreadList::reconfig (  ) 

Sends a reconfigure request to all threads.

Returns:
the number of threads in the list
size_t base::ThreadList::size (  ) 

Gets the number of threads in the list.

Returns:
the number of threads in the list
size_t base::ThreadList::wait ( int  timeout = 0  ) 

Waits for all threads to terminate.

Parameters:
timeout timeout in seconds to wait until all threads have been terminated, <=0 means infinite
Returns:
number of (remaining) threads in the list

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