DrainTag Class Reference

This little class is used to help us track when workers' output queues are empty. More...

#include <MessageTransceiverThread.h>

Inheritance diagram for DrainTag:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 DrainTag ()
 Constructor.
virtual ~DrainTag ()
 Destructor.
void IncrementRefCount () const
 Increments the counter and returns true iff the new value is zero.
bool DecrementRefCount () const
 Decrements the counter and returns true iff the new value is zero.
void SetManager (AbstractObjectManager *manager)
 Sets the recycle-pointer for this object.
AbstractObjectManagerGetManager () const
 Returns this object's current recyler pointer.
uint32 GetRefCount () const
 Returns this object's current reference count.

Friends

class ThreadSupervisorSession
class ThreadWorkerSession
class MessageTransceiverThread

Detailed Description

This little class is used to help us track when workers' output queues are empty.

When it gets deleted (inside the internal thread), it triggers the supervisor session to send back an MTT_EVENT_OUTPUT_QUEUES_DRAINED event. It's exposed publically here only because certain (ahem) poorly written programs need to subclass it in order to be able to safely block until it has gone away.

Definition at line 70 of file MessageTransceiverThread.h.


Constructor & Destructor Documentation

virtual DrainTag::~DrainTag (  )  [virtual]

Destructor.

Notifies our supervisor that we are being deleted.


Member Function Documentation

void RefCountable::IncrementRefCount (  )  const [inline, inherited]

Increments the counter and returns true iff the new value is zero.

Thread safe.

Definition at line 32 of file RefCount.h.

References AtomicCounter::AtomicIncrement().

bool RefCountable::DecrementRefCount (  )  const [inline, inherited]

Decrements the counter and returns true iff the new value is zero.

Thread safe.

Definition at line 35 of file RefCount.h.

References AtomicCounter::AtomicDecrement().

void RefCountable::SetManager ( AbstractObjectManager manager  )  [inline, inherited]

Sets the recycle-pointer for this object.

If set to non-NULL, this pointer is used by the ObjectPool class to recycle this object when it is no longer in use, so as to avoid the overhead of having to delete it and re-create it later on. The RefCountable class itself does nothing with this pointer. Default value is NULL.

Parameters:
manager Pointer to the new manager object to use, or NULL to use no manager.

Definition at line 44 of file RefCount.h.

uint32 RefCountable::GetRefCount (  )  const [inline, inherited]

Returns this object's current reference count.

Note that the value returned by this method is volatile in multithreaded environments, so it may already be wrong by the time it is returned. Be careful!

Definition at line 54 of file RefCount.h.

References AtomicCounter::GetCount().


The documentation for this class was generated from the following file:
Generated on Thu Jun 5 17:48:03 2008 for MUSCLE by  doxygen 1.5.1