Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Sched_Priority_Iterator Class Reference

An iterator over the OS-defined scheduling priorities. More...

#include <Sched_Params.h>

List of all members.

Public Methods

 ACE_Sched_Priority_Iterator (const ACE_Sched_Params::Policy &policy, int scope=ACE_SCOPE_THREAD)
 Initialize the iterator, the arguments define the scheduling policy and scope for the priorities (see ACE_Sched_Param). More...

 ~ACE_Sched_Priority_Iterator (void)
 Default dtor. More...

int more (void) const
 Check if there are more priorities. More...

int priority (void) const
 Return the current priority. More...

void next (void)
 Move to the next priority. The iteration is from lowest to highest importance. More...

const ACE_Sched_Params::Policypolicy (void) const
 Accessor for the scheduling policy over which we are iterating. More...

int scope (void) const
 Accessor for the scheduling. More...


Private Attributes

ACE_Sched_Params::Policy policy_
 The Scheduling policy (FIFO, RR, etc.) and scheduling scope (PROCESS, SYSTEM) we are iterating on. More...

int scope_
int priority_
 The current priority. More...

int done_


Detailed Description

An iterator over the OS-defined scheduling priorities.

The order of priorities (numeric value vs. importance) is OS dependant, it can be the case that the priorities are not even contigous. This class permits iteration over priorities using the iterator pattern.

Definition at line 176 of file Sched_Params.h.


Constructor & Destructor Documentation

ACE_INLINE ACE_Sched_Priority_Iterator::ACE_Sched_Priority_Iterator const ACE_Sched_Params::Policy   policy,
int    scope = ACE_SCOPE_THREAD
 

Initialize the iterator, the arguments define the scheduling policy and scope for the priorities (see ACE_Sched_Param).

Definition at line 98 of file Sched_Params.i.

References ACE_Sched_Params::Policy, priority_, ACE_Sched_Params::priority_min, and scope.

00100  : policy_ (policy),
00101    scope_ (scope),
00102    priority_ (0),
00103    done_ (0)
00104 {
00105   priority_ = ACE_Sched_Params::priority_min (this->policy (), this->scope ());
00106 }

ACE_INLINE ACE_Sched_Priority_Iterator::~ACE_Sched_Priority_Iterator void   
 

Default dtor.

Definition at line 109 of file Sched_Params.i.

00110 {
00111 }


Member Function Documentation

ACE_INLINE int ACE_Sched_Priority_Iterator::more void    const
 

Check if there are more priorities.

Definition at line 114 of file Sched_Params.i.

References done_.

00115 {
00116   return !this->done_;
00117 }

ACE_INLINE void ACE_Sched_Priority_Iterator::next void   
 

Move to the next priority. The iteration is from lowest to highest importance.

Definition at line 126 of file Sched_Params.i.

References done_, ACE_Sched_Params::next_priority, priority, priority_, and scope.

00127 {
00128   if (this->done_)
00129     return;
00130 
00131   int old_priority = this->priority_;
00132   priority_ = ACE_Sched_Params::next_priority (this->policy (),
00133                                                this->priority (),
00134                                                this->scope ());
00135   this->done_ = old_priority == priority_;
00136 }

ACE_INLINE const ACE_Sched_Params::Policy & ACE_Sched_Priority_Iterator::policy void    const
 

Accessor for the scheduling policy over which we are iterating.

Definition at line 86 of file Sched_Params.i.

References policy_.

00087 {
00088   return this->policy_;
00089 }

ACE_INLINE int ACE_Sched_Priority_Iterator::priority void    const
 

Return the current priority.

Definition at line 120 of file Sched_Params.i.

References priority_.

Referenced by next.

00121 {
00122   return this->priority_;
00123 }

ACE_INLINE int ACE_Sched_Priority_Iterator::scope void    const
 

Accessor for the scheduling.

Definition at line 92 of file Sched_Params.i.

References scope_.

Referenced by ACE_Sched_Priority_Iterator, and next.

00093 {
00094   return this->scope_;
00095 }


Member Data Documentation

int ACE_Sched_Priority_Iterator::done_ [private]
 

This is set to 1 when there are no more priorities. Cannot easily compare against the highest priority on platforms were priorities are non-contigous or descending.

Definition at line 217 of file Sched_Params.h.

Referenced by more, and next.

ACE_Sched_Params::Policy ACE_Sched_Priority_Iterator::policy_ [private]
 

The Scheduling policy (FIFO, RR, etc.) and scheduling scope (PROCESS, SYSTEM) we are iterating on.

Definition at line 206 of file Sched_Params.h.

Referenced by policy.

int ACE_Sched_Priority_Iterator::priority_ [private]
 

The current priority.

Definition at line 210 of file Sched_Params.h.

Referenced by ACE_Sched_Priority_Iterator, next, and priority.

int ACE_Sched_Priority_Iterator::scope_ [private]
 

Definition at line 207 of file Sched_Params.h.

Referenced by scope.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:55:31 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002