nidas  v1.2-1520
Public Member Functions | Private Attributes | List of all members
nidas::core::SampleClientList Class Reference

A list of SampleClients. More...

#include <SampleClientList.h>

Public Member Functions

 SampleClientList ()
 
 SampleClientList (const SampleClientList &cl)
 Public copy constructor. More...
 
virtual ~SampleClientList ()
 
SampleClientListoperator= (const SampleClientList &cl)
 Public assignment operator. More...
 
virtual void add (SampleClient *)
 Add a SampleClient to this list. More...
 
virtual void remove (SampleClient *)
 Remove a SampleClient from this SampleSource. More...
 
virtual bool empty () const
 Are there any clients? More...
 
virtual void removeAll ()
 Big cleanup. More...
 
void lock () const throw ()
 Lock this list. More...
 
void unlock () const throw ()
 Unlock this list. More...
 
std::list< SampleClient * >
::const_iterator 
begin () throw ()
 get a const_iterator pointing to first element. More...
 
std::list< SampleClient * >
::const_iterator 
end () throw ()
 get a const_iterator pointing to one-past-last element. More...
 

Private Attributes

nidas::util::Mutex _clistLock
 mutex to prevent simultaneous access to clients list More...
 
std::list< SampleClient * > _clients
 My current clients. More...
 

Detailed Description

A list of SampleClients.

This class is typically used by SampleSources to maintain their client lists.

Constructor & Destructor Documentation

nidas::core::SampleClientList::SampleClientList ( )
inline
SampleClientList::SampleClientList ( const SampleClientList cl)

Public copy constructor.

To support multithreading, this first locks the SampleClientList argument.

References _clients, lock(), and unlock().

virtual nidas::core::SampleClientList::~SampleClientList ( )
inlinevirtual

Member Function Documentation

void SampleClientList::add ( SampleClient client)
virtual

Add a SampleClient to this list.

The pointer to the SampleClient must remain valid, until after it is removed. A nidas::util::Mutex exclusion lock is used to avoid simultaneous access.

References _clients, lock(), and unlock().

Referenced by nidas::core::SampleSourceSupport::addSampleClientForTag().

std::list<SampleClient*>::const_iterator nidas::core::SampleClientList::begin ( )
throw (
)
inline

get a const_iterator pointing to first element.

Does not lock!

References _clients.

Referenced by nidas::core::SampleSourceSupport::distribute().

bool SampleClientList::empty ( ) const
virtual

Are there any clients?

References _clients, lock(), and unlock().

std::list<SampleClient*>::const_iterator nidas::core::SampleClientList::end ( )
throw (
)
inline

get a const_iterator pointing to one-past-last element.

Does not lock!

References _clients.

Referenced by nidas::core::SampleSourceSupport::distribute().

void nidas::core::SampleClientList::lock ( ) const
throw (
)
inline

Lock this list.

References _clistLock, and nidas::util::Mutex::lock().

Referenced by add(), empty(), operator=(), remove(), removeAll(), and SampleClientList().

SampleClientList & SampleClientList::operator= ( const SampleClientList cl)

Public assignment operator.

To support multithreading, this first locks the SampleClientList argument.

References _clients, lock(), and unlock().

void SampleClientList::remove ( SampleClient client)
virtual

Remove a SampleClient from this SampleSource.

A nidas::util::Mutex exclusion lock is used to avoid simultaneous access.

References _clients, lock(), and unlock().

void SampleClientList::removeAll ( )
virtual

Big cleanup.

A nidas::util::Mutex exclusion lock is used to avoid simultaneous access.

References _clients, lock(), and unlock().

Referenced by nidas::core::SampleSourceSupport::removeAllSampleClients().

void nidas::core::SampleClientList::unlock ( ) const
throw (
)
inline

Unlock this list.

References _clistLock, and nidas::util::Mutex::unlock().

Referenced by add(), empty(), operator=(), remove(), removeAll(), and SampleClientList().

Member Data Documentation

std::list<SampleClient*> nidas::core::SampleClientList::_clients
private

My current clients.

Referenced by add(), begin(), empty(), end(), operator=(), remove(), removeAll(), and SampleClientList().

nidas::util::Mutex nidas::core::SampleClientList::_clistLock
mutableprivate

mutex to prevent simultaneous access to clients list

Referenced by lock(), and unlock().


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