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

StubPolicy Class Reference

List of all members.

Detailed Description

A Broker::Policy subclass that can be used for testing.

Definition at line 26 of file StubPolicy.hh.

Public Member Functions

 StubPolicy (const char *name)
 Construct a StubPolicy object with the given value.

virtual ~StubPolicy ()
 Deconstruct a StubPolicy object.

char * Name (void) throw (CORBA::SystemException)
void AddTask (Broker::Task_ptr task, const Broker::ScheduleParameters &sp) throw (CORBA::SystemException, Broker::DuplicateScheduleParameter, Broker::InvalidScheduleParameter, Broker::MissingScheduleParameter)
 Add a task to the sp_Tasks list.

void RemoveTask (Broker::Task_ptr task) throw (CORBA::SystemException)
 Remove a task from the sp_Tasks list.

Broker::TaskListGetTaskList (void) throw (CORBA::SystemException)
void Activate (const Broker::TaskList &tasks) throw (CORBA::SystemException)
 Activate the policy and add the given list of tasks to sp_Tasks.

void Deactivate (void) throw (CORBA::SystemException)
 Deactivate the policy and set the length of sp_Tasks to zero.

Broker::CPUReserve ChangeTaskCPU (Broker::RealTimeTask_ptr task, const Broker::CPUReserve &advice) throw (CORBA::SystemException, Broker::InvalidState)
 Change the compute time for the given task to the given advice.

virtual CORBA::Float GetMaxCPUAllocation (void) throw (CORBA::SystemException)
 
Returns:
The maximum percentage of CPU that can be allocated to all of the tasks.


virtual void SetMaxCPUAllocation (CORBA::Float amount) throw (CORBA::SystemException)
 
Parameters:
amount The maximum percentage of CPU that can be allocated to all of the tasks.


int TaskIndex (Broker::Task_ptr task)
 Find a task in the sp_Tasks list.


Public Attributes

CORBA::String_var sp_Name
 The policy's name.

Broker::TaskList sp_Tasks
 The list of tasks being managed by this policy.

CORBA::Float sp_MaxCPUAllocation
 The maximum CPU allocation.


Constructor & Destructor Documentation

StubPolicy::StubPolicy const char *  name  )  [inline]
 

Construct a StubPolicy object with the given value.

Parameters:
name The policy name.

Definition at line 36 of file StubPolicy.hh.

References sp_Name.


Member Function Documentation

void StubPolicy::Activate const Broker::TaskList tasks  )  throw (CORBA::SystemException) [inline]
 

Activate the policy and add the given list of tasks to sp_Tasks.

Parameters:
tasks The existing tasks being handled by the broker.

Definition at line 117 of file StubPolicy.hh.

References sp_Tasks, and Broker::TaskList.

void StubPolicy::AddTask Broker::Task_ptr  task,
const Broker::ScheduleParameters sp
throw (CORBA::SystemException, Broker::DuplicateScheduleParameter, Broker::InvalidScheduleParameter, Broker::MissingScheduleParameter) [inline]
 

Add a task to the sp_Tasks list.

Parameters:
task The task to add to the policy.
sp The task's scheduling parameters.

Definition at line 66 of file StubPolicy.hh.

References Broker::ScheduleParameters, and sp_Tasks.

Broker::CPUReserve StubPolicy::ChangeTaskCPU Broker::RealTimeTask_ptr  task,
const Broker::CPUReserve advice
throw (CORBA::SystemException, Broker::InvalidState) [inline]
 

Change the compute time for the given task to the given advice.

Parameters:
task The task whose compute time should be changed.
advice The advocate's advice.

Definition at line 144 of file StubPolicy.hh.

References Broker::CPUReserve::Compute.

Broker::TaskList* StubPolicy::GetTaskList void   )  throw (CORBA::SystemException) [inline]
 

Returns:
The list of tasks that have been added to this policy.

Definition at line 103 of file StubPolicy.hh.

References Broker::TaskList.

char* StubPolicy::Name void   )  throw (CORBA::SystemException) [inline]
 

Returns:
The name passed to the constructor.

Definition at line 51 of file StubPolicy.hh.

References sp_Name.

void StubPolicy::RemoveTask Broker::Task_ptr  task  )  throw (CORBA::SystemException) [inline]
 

Remove a task from the sp_Tasks list.

Parameters:
task The task to remove from the policy.

Definition at line 84 of file StubPolicy.hh.

References sp_Tasks, and TaskIndex().

Here is the call graph for this function:

int StubPolicy::TaskIndex Broker::Task_ptr  task  )  [inline]
 

Find a task in the sp_Tasks list.

Parameters:
task The task to find.
Returns:
The index of the task in sp_Tasks or -1 if it could not be found.

Definition at line 176 of file StubPolicy.hh.

References sp_Tasks.

Referenced by RemoveTask().


The documentation for this class was generated from the following file:
Generated on Tue Jun 22 14:52:06 2004 for CPU Broker by doxygen 1.3.6