#include <nPriorizing.h>
Public Types | |
typedef tHeap< nBandwidthTask > | nTaskHeap |
typedef nBandwidthTask::nType | nType |
Public Member Functions | |
nTaskHeap & | Tasks (nType t) |
const nTaskHeap & | Tasks (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] |
Definition at line 88 of file nPriorizing.h.
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.
virtual nBandwidthTaskPriorizer::~nBandwidthTaskPriorizer | ( | ) | [inline, virtual] |
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 }
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 }
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 }
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 }
virtual void nBandwidthTaskPriorizer::OnChange | ( | ) | [inline, private, virtual] |
Reimplemented in nBandwidthArbitrator.
Definition at line 114 of file nPriorizing.h.
Referenced by Insert(), and Next().
nTaskHeap nBandwidthTaskPriorizer::tasks_[nBandwidthTask::Type_Count] [private] |