TAO_EC_Kokyu_Scheduling Class Reference

A scheduling strategy that uses TAO's real-time scheduler. More...

#include <EC_Kokyu_Scheduling.h>

Inheritance diagram for TAO_EC_Kokyu_Scheduling:

Inheritance graph
[legend]
Collaboration diagram for TAO_EC_Kokyu_Scheduling:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_EC_Kokyu_Scheduling (RtecScheduler::Scheduler_ptr scheduler)
 Constructor.
virtual ~TAO_EC_Kokyu_Scheduling (void)
 Destructor.
virtual void add_proxy_supplier_dependencies (TAO_EC_ProxyPushSupplier *supplier, TAO_EC_ProxyPushConsumer *consumer)
 Add all the dependencies between supplier and consumer.
virtual void schedule_event (const RtecEventComm::EventSet &event, TAO_EC_ProxyPushConsumer *consumer, TAO_EC_Supplier_Filter *filter)

Private Member Functions

 TAO_EC_Kokyu_Scheduling (const TAO_EC_Kokyu_Scheduling &)
TAO_EC_Kokyu_Schedulingoperator= (const TAO_EC_Kokyu_Scheduling &)
void init_rt_info (void)
 Initialize our RT_Info handle and dependencies.

Private Attributes

RtecScheduler::Scheduler_var scheduler_
 The scheduler we are going to use.

Detailed Description

A scheduling strategy that uses TAO's real-time scheduler.

This implementation of the Scheduling_Strategy uses TAO's real-time scheduler.

Definition at line 40 of file EC_Kokyu_Scheduling.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_EC_Kokyu_Scheduling::TAO_EC_Kokyu_Scheduling ( RtecScheduler::Scheduler_ptr  scheduler  ) 

Constructor.

Definition at line 8 of file EC_Kokyu_Scheduling.inl.

00010   :  scheduler_ (RtecScheduler::Scheduler::_duplicate (scheduler))
00011 {
00012 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_EC_Kokyu_Scheduling::~TAO_EC_Kokyu_Scheduling ( void   )  [virtual]

Destructor.

Definition at line 17 of file EC_Kokyu_Scheduling.cpp.

00018 {
00019 }

TAO_EC_Kokyu_Scheduling::TAO_EC_Kokyu_Scheduling ( const TAO_EC_Kokyu_Scheduling  )  [private]


Member Function Documentation

void TAO_EC_Kokyu_Scheduling::add_proxy_supplier_dependencies ( TAO_EC_ProxyPushSupplier supplier,
TAO_EC_ProxyPushConsumer consumer 
) [virtual]

Add all the dependencies between supplier and consumer.

Implements TAO_EC_Scheduling_Strategy.

Definition at line 22 of file EC_Kokyu_Scheduling.cpp.

References TAO_EC_ProxyPushSupplier::add_dependencies(), RtecEventChannelAdmin::SupplierQOS::publications, and TAO_EC_ProxyPushConsumer::publications().

00025 {
00026   const RtecEventChannelAdmin::SupplierQOS& qos =
00027     consumer->publications ();
00028 
00029   for (CORBA::ULong i = 0; i < qos.publications.length (); ++i)
00030     {
00031       const RtecEventComm::EventHeader &header =
00032         qos.publications[i].event.header;
00033       TAO_EC_QOS_Info qos_info;
00034       qos_info.rt_info = qos.publications[i].dependency_info.rt_info;
00035 
00036       RtecScheduler::OS_Priority os_priority;
00037       RtecScheduler::Preemption_Subpriority_t p_subpriority;
00038       RtecScheduler::Preemption_Priority_t p_priority;
00039       this->scheduler_->priority (qos_info.rt_info,
00040                                   os_priority,
00041                                   p_subpriority,
00042                                   p_priority);
00043       qos_info.preemption_priority = p_priority;
00044 
00045       supplier->add_dependencies (header, qos_info);
00046     }
00047 }

void TAO_EC_Kokyu_Scheduling::init_rt_info ( void   )  [private]

Initialize our RT_Info handle and dependencies.

TAO_EC_Kokyu_Scheduling& TAO_EC_Kokyu_Scheduling::operator= ( const TAO_EC_Kokyu_Scheduling  )  [private]

void TAO_EC_Kokyu_Scheduling::schedule_event ( const RtecEventComm::EventSet event,
TAO_EC_ProxyPushConsumer consumer,
TAO_EC_Supplier_Filter filter 
) [virtual]

Schedule an event set and deliver them to the filter in the desired order and grouping.

Implements TAO_EC_Scheduling_Strategy.

Definition at line 50 of file EC_Kokyu_Scheduling.cpp.

References TAO_EC_Filter::matches(), TAO_EC_QOS_Info::preemption_priority, RtecEventChannelAdmin::SupplierQOS::publications, TAO_EC_ProxyPushConsumer::publications(), TAO_EC_Supplier_Filter::push_scheduled_event(), TAO_EC_QOS_Info::rt_info, and scheduler_.

00053 {
00054   RtecEventChannelAdmin::SupplierQOS qos =
00055     consumer->publications ();
00056 
00057   for (CORBA::ULong j = 0; j != event.length (); ++j)
00058     {
00059       const RtecEventComm::Event& e = event[j];
00060       RtecEventComm::Event* buffer =
00061         const_cast<RtecEventComm::Event*> (&e);
00062       RtecEventComm::EventSet single_event (1, 1, buffer, 0);
00063 
00064       TAO_EC_QOS_Info qos_info;
00065 
00066       for (CORBA::ULong i = 0; i != qos.publications.length (); ++i)
00067         {
00068           const RtecEventComm::EventHeader &qos_header =
00069             qos.publications[i].event.header;
00070 
00071           if (TAO_EC_Filter::matches (e.header, qos_header) == 0)
00072             continue;
00073 
00074           qos_info.rt_info = qos.publications[i].dependency_info.rt_info;
00075 
00076           RtecScheduler::OS_Priority os_priority;
00077           RtecScheduler::Preemption_Subpriority_t p_subpriority;
00078           RtecScheduler::Preemption_Priority_t p_priority;
00079           this->scheduler_->priority (qos_info.rt_info,
00080                                       os_priority,
00081                                       p_subpriority,
00082                                       p_priority);
00083           qos_info.preemption_priority = p_priority;
00084         }
00085 
00086       filter->push_scheduled_event (single_event, qos_info);
00087     }
00088 }


Member Data Documentation

RtecScheduler::Scheduler_var TAO_EC_Kokyu_Scheduling::scheduler_ [private]

The scheduler we are going to use.

Definition at line 65 of file EC_Kokyu_Scheduling.h.

Referenced by schedule_event().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:44:30 2010 for TAO_RTEvent by  doxygen 1.4.7