nBandwidthTaskPriorizer Class Reference

#include <nPriorizing.h>

Inheritance diagram for nBandwidthTaskPriorizer:

Inheritance graph
[legend]
Collaboration diagram for nBandwidthTaskPriorizer:

Collaboration graph
[legend]

List of all members.

Public Types

typedef tHeap< nBandwidthTask > nTaskHeap
typedef nBandwidthTask::nType nType

Public Member Functions

nTaskHeapTasks (nType t)
const nTaskHeapTasks (nType t) const
void Insert (nBandwidthTask *task)
nBandwidthTask * PeekNext (nType type)
virtual ~nBandwidthTaskPriorizer ()

Protected Member Functions

tJUST_CONTROLLED_PTR
< nBandwidthTask > 
Next (nType type)

Private Member Functions

virtual void OnChange ()

Private Attributes

nTaskHeap tasks_ [nBandwidthTask::Type_Count]


Detailed Description

Definition at line 88 of file nPriorizing.h.


Member Typedef Documentation

typedef tHeap< nBandwidthTask > nBandwidthTaskPriorizer::nTaskHeap

Definition at line 91 of file nPriorizing.h.

typedef nBandwidthTask::nType nBandwidthTaskPriorizer::nType

Definition at line 92 of file nPriorizing.h.


Constructor & Destructor Documentation

virtual nBandwidthTaskPriorizer::~nBandwidthTaskPriorizer (  )  [inline, virtual]

Definition at line 110 of file nPriorizing.h.

00110 {}


Member Function Documentation

nTaskHeap& nBandwidthTaskPriorizer::Tasks ( nType  t  )  [inline]

Definition at line 94 of file nPriorizing.h.

References tasks_, and tASSERT.

Referenced by Insert(), Next(), nBandwidthArbitrator::OnChange(), PeekNext(), and nBandwidthArbitrator::Timestep().

00095     {
00096         tASSERT( 0 <= t && t < nBandwidthTask::Type_Count );
00097 
00098         return tasks_[ t ];
00099     }

Here is the caller graph for this function:

const nTaskHeap& nBandwidthTaskPriorizer::Tasks ( nType  t  )  const [inline]

Definition at line 101 of file nPriorizing.h.

References tasks_, and tASSERT.

00102     {
00103         tASSERT( 0 <= t && t < nBandwidthTask::Type_Count );
00104 
00105         return tasks_[ t ];
00106     }

void nBandwidthTaskPriorizer::Insert ( nBandwidthTask *  task  ) 

Definition at line 81 of file nPriorizing.cpp.

References referencing::AddReference(), tHeap< T >::Insert(), OnChange(), and Tasks().

00082 {
00083     nTaskHeap& heap = this->Tasks( task->Type() );
00084 
00085     heap.Insert( task );
00086 
00087     tReferencer< nBandwidthTask >::AddReference( task );
00088 
00089     task->priorizer_ = this;
00090 
00091     task->Priorize();
00092 
00093     this->OnChange();
00094 }

Here is the call graph for this function:

nBandwidthTask * nBandwidthTaskPriorizer::PeekNext ( nType  type  ) 

Definition at line 97 of file nPriorizing.cpp.

References tHeap< T >::Len(), NULL, and Tasks().

Referenced by nBandwidthArbitrator::Fill().

00098 {
00099     nTaskHeap& heap = this->Tasks( type );
00100 
00101     if ( heap.Len() <= 0 )
00102     {
00103         return NULL;
00104     }
00105 
00106     return heap(0);
00107 }

Here is the call graph for this function:

Here is the caller graph for this function:

tJUST_CONTROLLED_PTR< nBandwidthTask > nBandwidthTaskPriorizer::Next ( nType  type  )  [protected]

Definition at line 110 of file nPriorizing.cpp.

References tHeap< T >::Len(), NULL, OnChange(), referencing::ReleaseReference(), tHeap< T >::Remove(), and Tasks().

Referenced by nBandwidthArbitrator::Fill().

00111 {
00112     nTaskHeap& heap = this->Tasks( type );
00113 
00114     if ( heap.Len() <= 0 )
00115     {
00116         return NULL;
00117     }
00118 
00119     tJUST_CONTROLLED_PTR<nBandwidthTask> ret = heap.Remove(0);
00120 
00121     tReferencer< nBandwidthTask >::ReleaseReference( ret );
00122 
00123     ret->priorizer_ = NULL;
00124 
00125     this->OnChange();
00126 
00127     return ret;
00128 }

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nBandwidthTaskPriorizer::OnChange (  )  [inline, private, virtual]

Reimplemented in nBandwidthArbitrator.

Definition at line 114 of file nPriorizing.h.

Referenced by Insert(), and Next().

00114 {};                                                                             // called on every change of data

Here is the caller graph for this function:


Member Data Documentation

nTaskHeap nBandwidthTaskPriorizer::tasks_[nBandwidthTask::Type_Count] [private]

Definition at line 114 of file nPriorizing.h.

Referenced by Tasks().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:46:59 2008 for Armagetron Advanced by  doxygen 1.5.4