Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

StrictPolicyImpl Class Reference

List of all members.

Detailed Description

An implementation of the StrictPolicy interface.


Public Member Functions

 StrictPolicyImpl (const char *name)
 Construct a StrictPolicyImpl object with the given values.

virtual ~StrictPolicyImpl ()
 Deconstruct the policy.

char * Name (void) throw (CORBA::SystemException)
 Mostly useful for debugging.

void AddTask (Broker::Task_ptr task) throw (CORBA::SystemException)
 NOTE: This method will be called before the reservation is made, giving the policy a chance to adjust any values.

See also:
RemoveTask
Parameters:
new_task The newly created Task object.
Exceptions:
CORBA::BAD_PARAM if task is nil.
CORBA::BAD_PARAM if task has already been added.
CORBA::BAD_INV_ORDER if the method is called without Activate() being called first.


void RemoveTask (Broker::Task_ptr task) throw (CORBA::SystemException)
 NOTE: This method will be called after the reservation has been destroyed, so it can safely reallocate the newly freed CPU time.

See also:
AddTask
Parameters:
added_task The task to remove.
Exceptions:
CORBA::BAD_PARAM if task is nil.
CORBA::BAD_PARAM if task has already been removed.
CORBA::BAD_INV_ORDER if the method is called without Activate() being called first.


void Activate (const Broker::TaskList &tl) throw (CORBA::SystemException)
 NOTE: The policy is expected to discover and adjust the scheduling parameters of any currently executing tasks.

See also:
Deactivate
Parameters:
tasks The list of tasks the policy needs to manage.
Exceptions:
CORBA::BAD_INV_ORDER if the method is called without intervening calls to Deactivate().


void Deactivate (void) throw (CORBA::SystemException)
 NOTE: The policy should change any scheduling parameters of the currently executing tasks, the next policy to be activated will handle any changes.

See also:
Deactivate
Exceptions:
CORBA::BAD_INV_ORDER if the method is called on an inactive policy.


void ChangeTaskCPU (Broker::RealTimeTask_ptr task, CORBA::ULong ct, CORBA::ULong status, CORBA::ULong advice) throw (CORBA::SystemException, Broker::InvalidState)
 
Parameters:
task The Task object requesting a CPU time change.
ct The Task's current CPU time.
status The status value reported by Task.ReportCPU().
advice The CPU time advice from the Task object.


Broker::TaskListGetTaskList (void) throw (CORBA::SystemException)
 
Parameters:
task The task whose priority should be changed.
Returns:
The task's priority.
Exceptions:
CORBA::BAD_PARAM if task is nil.
CORBA::BAD_PARAM if task is not managed by this policy.


void SetTaskPriority (Broker::Task_ptr task, CORBA::Short priority) throw (CORBA::SystemException)
 
Parameters:
task The task whose priority should be changed.
priority The new priority.
Exceptions:
CORBA::BAD_PARAM if task is nil.
CORBA::BAD_PARAM if task is not managed by this policy.


CORBA::Short GetTaskPriority (Broker::Task_ptr task) throw (CORBA::SystemException)
 
Parameters:
task The task whose priority should be changed.
Returns:
The task's priority.
Exceptions:
CORBA::BAD_PARAM if task is nil.
CORBA::BAD_PARAM if task is not managed by this policy.



Static Public Attributes

const float MAX_USED_CPU = 0.75
 Maximum percentage of CPU to allocate to tasks.

const float MIN_TASK_CPU = 0.05
 Minimum percentage of CPU to allocate to a single task.


Private Member Functions

TaskPriorityFindTaskPriority (Broker::RealTimeTask_ptr task)
 Find the TaskPriority node that corresponds to the given task.

TaskPrioritySubList (const RealTimeSchedule &rts, struct TaskPriority *ignore)
 Construct a list, ordered from lowest to highest priority, of the tasks whose schedule intersects with the given one.

CORBA::ULong TakeCPU (struct TaskPriority *sub_list, CORBA::ULong amount, struct TaskPriority *for_tp)
 Take CPU time from other tasks to give to another.

CORBA::ULong GiveCPU (struct TaskPriority *sub_list, CORBA::ULong amount, struct TaskPriority *for_tp)
 Give CPU time back to the other tasks.


Private Attributes

CORBA::String_var sp_Name
 The name of this object as registered with the NamingService.

float sp_MaxUsedCPU
 The maximum percentage of CPU time that we are allowed to allocate.

float sp_MinTaskCPU
 The minimum percentage of CPU time that a task must have.

lnList sp_List
 A list of TaskPriority objects.


Constructor & Destructor Documentation

StrictPolicyImpl::StrictPolicyImpl const char *  name  ) 
 

Construct a StrictPolicyImpl object with the given values.

Parameters:
name The name of this object as registered with the NamingService.


Member Function Documentation

struct StrictPolicyImpl::TaskPriority * StrictPolicyImpl::FindTaskPriority Broker::RealTimeTask_ptr  task  )  [private]
 

Find the TaskPriority node that corresponds to the given task.

Parameters:
task The Broker::RealTimeTask object to look up.
Returns:
The TaskPriority list node that has the given task object.
Exceptions:
Broker::Internal If no TaskPriority node exists for the given task.

CORBA::ULong StrictPolicyImpl::GiveCPU struct TaskPriority sub_list,
CORBA::ULong  amount,
struct TaskPriority for_tp
[private]
 

Give CPU time back to the other tasks.

Parameters:
sub_list The list of tasks to give CPU time to, typically built with the SubList() method.
amount The amount of CPU time to give out.
for_tp The donating task.
Returns:
XXX ...

struct StrictPolicyImpl::TaskPriority * StrictPolicyImpl::SubList const RealTimeSchedule rts,
struct TaskPriority ignore
[private]
 

Construct a list, ordered from lowest to highest priority, of the tasks whose schedule intersects with the given one.

Parameters:
rts The schedule to match.
ignore The TaskPriority node to ignore when building the list or NULL if no nodes should be ignored.
Returns:
The list of nodes, linked by tp_SubLink, that match the given schedule.

CORBA::ULong StrictPolicyImpl::TakeCPU struct TaskPriority sub_list,
CORBA::ULong  amount,
struct TaskPriority for_tp
[private]
 

Take CPU time from other tasks to give to another.

Parameters:
sub_list The list of tasks to take CPU time from, typically built with the SubList() method.
amount The amount of CPU time to take away.
for_tp The node that will be given the CPU time.
Returns:
The actual amount of CPU time that can be given to the task.


The documentation for this class was generated from the following files:
Generated on Mon Dec 1 16:22:43 2003 for CPUBroker by doxygen 1.3.4