TAO_EC_Priority_Scheduling Class Reference

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

#include <EC_Priority_Scheduling.h>

Inheritance diagram for TAO_EC_Priority_Scheduling:

Inheritance graph
[legend]
Collaboration diagram for TAO_EC_Priority_Scheduling:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_EC_Priority_Scheduling (RtecScheduler::Scheduler_ptr scheduler)
 Constructor.
virtual ~TAO_EC_Priority_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_Priority_Scheduling (const TAO_EC_Priority_Scheduling &)
TAO_EC_Priority_Schedulingoperator= (const TAO_EC_Priority_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 39 of file EC_Priority_Scheduling.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 8 of file EC_Priority_Scheduling.inl.

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

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

Destructor.

Definition at line 17 of file EC_Priority_Scheduling.cpp.

00018 {
00019 }

TAO_EC_Priority_Scheduling::TAO_EC_Priority_Scheduling ( const TAO_EC_Priority_Scheduling  )  [private]


Member Function Documentation

void TAO_EC_Priority_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_Priority_Scheduling.cpp.

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

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

void TAO_EC_Priority_Scheduling::init_rt_info ( void   )  [private]

Initialize our RT_Info handle and dependencies.

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

void TAO_EC_Priority_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 51 of file EC_Priority_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_.

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


Member Data Documentation

RtecScheduler::Scheduler_var TAO_EC_Priority_Scheduling::scheduler_ [private]

The scheduler we are going to use.

Definition at line 64 of file EC_Priority_Scheduling.h.

Referenced by schedule_event().


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