NQueueHost Class Reference

QListViewItem for Host connections. More...

#include <nqueue.h>


Public Member Functions

 NQueueHost (QListView *parent, int hostId, NHostInfo hostInfo)
 Creates a new toplevel entry in the list view for the given hostInfo.

virtual ~NQueueHost ()
 Destroys the host entry, but does not properly update NQueue's data structures.

void dieNow ()
 Destroys the host entry, and properly cleans up NQueue's data structures.

virtual QString text (int c) const
 Return a serialized value for the content of column c.

virtual const QPixmap * pixmap (int c) const
 Returns 0.

virtual int rtti () const
 Returns 2301, the arbitrary rtti chosen for this QListViewItem type.

const int id () const
 Returns the id of this host entry.

const NHostInfo hostInfo () const
 Returns the host information for this host.

const bool isDone () const
 Boolean affirmation that the host is done.

const bool inUse () const
 Boolean affirmation that the host is in use.

const bool failed () const
 Boolean affirmation that the host has failed.

const int numCurrentConns () const
 Returns the number of connections open to this host.

void setInUse (bool s=true)
 Marks the host as in use if s is true.

void setDone (bool s=true)
 Marks the host as done and not in use if s is true.

void setFailed (bool s=true)
 Marks the host as failed if s is true.

void incCurrentConns ()
 Increases the number of connections opened to this host.

void decCurrentConns ()
 Decreases the number of connections opened to this host.

void setXferStats (uint size, int time, double rate)
 Set the total transfer statistics for the host.

void reset ()
 Reset any failed status of the host entry and all children.

void childDone (bool removed=false)
 A child entry was marked done, decrease the remaining children count.

void addChild ()
 Add statistics for new child.

void childReset ()
 Forces a statistics regeneration.

void killChildren (int prune=0)
 Summarily destroy any children that fit the desired kill parameters.


Detailed Description

QListViewItem for Host connections.


One NQueueHost item will exist per prot://user:pass@host:port combination in the Queue.


Constructor & Destructor Documentation

NQueueHost::NQueueHost QListView *  parent,
int  hostId,
NHostInfo  hostInfo
 

Creates a new toplevel entry in the list view for the given hostInfo.

NQueueHost::~NQueueHost  )  [virtual]
 

Destroys the host entry, but does not properly update NQueue's data structures.

Use dieNow() rather than delete where possible.


Member Function Documentation

void NQueueHost::addChild  ) 
 

Add statistics for new child.

Automatically sets the done flag to false.

void NQueueHost::childDone bool  removed = false  ) 
 

A child entry was marked done, decrease the remaining children count.

If removed is true, update the childTotal as well. If the remaining children count is reduced to zero, perform setDone().

void NQueueHost::childReset  ) 
 

Forces a statistics regeneration.

Called when a child at any depth was reset.
If the resultant remaining child count is greater than zero, the done flag is set to false.

void NQueueHost::decCurrentConns  )  [inline]
 

Decreases the number of connections opened to this host.

If this drops the current connections to zero, and our child count is zero, call setDone().

void NQueueHost::dieNow  ) 
 

Destroys the host entry, and properly cleans up NQueue's data structures.

Use this rather than delete where possible.

const bool NQueueHost::failed  )  const [inline]
 

Boolean affirmation that the host has failed.

Failure occurs when a child entry fails to transfer successfully.

const NHostInfo NQueueHost::hostInfo  )  const [inline]
 

Returns the host information for this host.

const int NQueueHost::id  )  const [inline]
 

Returns the id of this host entry.

void NQueueHost::incCurrentConns  )  [inline]
 

Increases the number of connections opened to this host.

If none were previously open, mark this host as now in use.

const bool NQueueHost::inUse  )  const [inline]
 

Boolean affirmation that the host is in use.

In use simply means that the host has a connection open, which may or may not also imply that a child entry is transferring.

const bool NQueueHost::isDone  )  const [inline]
 

Boolean affirmation that the host is done.

Done in this case, implies that there are no children waiting for transfer and no open connections to this host.

void NQueueHost::killChildren int  prune = 0  ) 
 

Summarily destroy any children that fit the desired kill parameters.

If prune is 1, the child must be Done and Not Failed.
If prune is 0, the child must not currently be in use.
If prune is -1, all children will be destroyed.
This function is recursive, so if a child fails the test, but has its own children, they will be tested as well.

const int NQueueHost::numCurrentConns  )  const [inline]
 

Returns the number of connections open to this host.

const QPixmap * NQueueHost::pixmap int  c  )  const [virtual]
 

Returns 0.

void NQueueHost::reset  ) 
 

Reset any failed status of the host entry and all children.

virtual int NQueueHost::rtti  )  const [inline, virtual]
 

Returns 2301, the arbitrary rtti chosen for this QListViewItem type.

void NQueueHost::setDone bool  s = true  )  [inline]
 

Marks the host as done and not in use if s is true.

If s is false, setFailed() is called.

void NQueueHost::setFailed bool  s = true  )  [inline]
 

Marks the host as failed if s is true.

void NQueueHost::setInUse bool  s = true  )  [inline]
 

Marks the host as in use if s is true.

void NQueueHost::setXferStats uint  size,
int  time,
double  rate
[inline]
 

Set the total transfer statistics for the host.

Parameters:
size Total bytes transferred.
time Time elapsed.
rate Transfer rate in kilobytes per second.

QString NQueueHost::text int  c  )  const [virtual]
 

Return a serialized value for the content of column c.


The documentation for this class was generated from the following files:
Generated on Wed Oct 22 20:32:05 2003 for nvemftp by doxygen1.3