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

BasicDelegate Class Reference

Inheritance diagram for BasicDelegate:

Inheritance graph
[legend]
Collaboration diagram for BasicDelegate:

Collaboration graph
[legend]
List of all members.

Detailed Description

A simple delegate that computes the number of deadlines missed and passes the value to Broker::RealTimeAdvocate::ReportCPU.

Definition at line 39 of file BasicDelegate.hh.

Public Member Functions

 BasicDelegate (const char *name, unsigned long period, unsigned long deadline)
 Construct a BasicDelegate with the given values.
virtual ~BasicDelegate ()
 Deconstruct a BasicDelegate.
virtual rk_stub_precall_retval_t precall (void)
 Premethod callback that just records the current time.
virtual void postcall (void)
 Postmethod callback that computes how many deadlines have been missed and reports the results to bd_Advocate.

Public Attributes

Broker::TaskParameters bd_TaskDescription
 TaskParameters constructed by the object that can be passed on to Broker::TaskFactory::CreateTask.
Broker::ScheduleParameters bd_CPUSchedule
 ScheduleParameters constructed by the object that can be passed on to Broker::Task::BeginScheduling.
Broker::RealTimeTask_var bd_Advocate
 The process' advocate, this must be set by the code using the object.
Broker::KeyedReportParameters bd_KeyedReportParameters
 The keyed parameters to pass through to ReportCPU.

Protected Attributes

unsigned long bd_Period
 The period of the process in microseconds.
unsigned long bd_Deadline
 The deadline of the process in microseconds and relative to the start of the period.
int bd_AdviseDrop
 The number of data segments to drop in order to get back on schedule.
pid_t bd_PID
 The simulated process ID.
timespec bd_Start
 The "method" starting time as recorded by precall().
rusage bd_RUStart
 The resource usage at the "method" starting time.


Constructor & Destructor Documentation

BasicDelegate::BasicDelegate const char *  name,
unsigned long  period,
unsigned long  deadline
 

Construct a BasicDelegate with the given values.

This includes:

  • Creating the process with rk_stub_mk_pid.
  • Initializing the bd_TaskDescription and bd_CPUSchedule parameter lists.
  • and initializing internal state.
Parameters:
name The name of the process. This will be passed on to rk_stub_mk_pid.
period The period of the process in microseconds.
deadline The deadline of the process in microseconds and relative to the start of the period.

Definition at line 31 of file BasicDelegate.cc.

References bd_AdviseDrop, bd_CPUSchedule, bd_PID, bd_TaskDescription, cxx_delegate_postcall(), cxx_delegate_precall(), require, and rk_stub_mk_pid().

Here is the call graph for this function:


Member Function Documentation

rk_stub_precall_retval_t BasicDelegate::precall void   )  [virtual]
 

Premethod callback that just records the current time.

Returns:
RKSP_OK if the process is on schedule or RKSP_DROP if it is running late and needs to drop data in order to catch up.

Implements FakeDelegate.

Reimplemented in ContractDelegate.

Definition at line 63 of file BasicDelegate.cc.

References bd_AdviseDrop, require, rk_clock_gettime(), rk_stub_getrusage(), and rk_stub_precall_retval_t.

Referenced by ContractDelegate::precall().

Here is the call graph for this function:


Member Data Documentation

int BasicDelegate::bd_AdviseDrop [protected]
 

The number of data segments to drop in order to get back on schedule.

This will be set by postcall() when it detects how many deadlines have been missed.

Definition at line 123 of file BasicDelegate.hh.

Referenced by BasicDelegate(), postcall(), and precall().

Broker::RealTimeTask_var BasicDelegate::bd_Advocate
 

The process' advocate, this must be set by the code using the object.

The user must also call Broker::Task::BeginCPUScheduling and Broker::Task::EndCPUScheduling.

Definition at line 98 of file BasicDelegate.hh.

Referenced by postcall().


The documentation for this class was generated from the following files:
Generated on Fri Oct 22 07:51:00 2004 for CPU Broker by  doxygen 1.3.9.1