#include <EC_Sched_Factory.h>
Inheritance diagram for TAO_EC_Sched_Factory:
Public Member Functions | |
TAO_EC_Sched_Factory (void) | |
Constructor. | |
virtual | ~TAO_EC_Sched_Factory (void) |
destructor... | |
virtual int | init (int argc, ACE_TCHAR *argv[]) |
virtual int | fini (void) |
virtual TAO_EC_Dispatching * | create_dispatching (TAO_EC_Event_Channel_Base *) |
Create and destroy the dispatching module. | |
virtual TAO_EC_Filter_Builder * | create_filter_builder (TAO_EC_Event_Channel_Base *) |
Create and destroy the filter builder. | |
virtual TAO_EC_Timeout_Generator * | create_timeout_generator (TAO_EC_Event_Channel_Base *) |
Create and destroy the timer module. | |
virtual TAO_EC_Scheduling_Strategy * | create_scheduling_strategy (TAO_EC_Event_Channel_Base *) |
Create and destroy the observer strategy. |
Definition at line 35 of file EC_Sched_Factory.h.
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_EC_Sched_Factory::TAO_EC_Sched_Factory | ( | void | ) |
Constructor.
Definition at line 8 of file EC_Sched_Factory.inl.
00009 : TAO_EC_Default_Factory () 00010 { 00011 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_EC_Sched_Factory::~TAO_EC_Sched_Factory | ( | void | ) | [virtual] |
TAO_EC_Dispatching * TAO_EC_Sched_Factory::create_dispatching | ( | TAO_EC_Event_Channel_Base * | ) | [virtual] |
Create and destroy the dispatching module.
Reimplemented from TAO_EC_Default_Factory.
Definition at line 174 of file EC_Sched_Factory.cpp.
References TAO_EC_Default_Factory::create_dispatching().
00175 { 00176 if (this->dispatching_ == 2) 00177 return new TAO_EC_Priority_Dispatching (ec); 00178 return this->TAO_EC_Default_Factory::create_dispatching (ec); 00179 }
TAO_EC_Filter_Builder * TAO_EC_Sched_Factory::create_filter_builder | ( | TAO_EC_Event_Channel_Base * | ) | [virtual] |
Create and destroy the filter builder.
Reimplemented from TAO_EC_Default_Factory.
Definition at line 182 of file EC_Sched_Factory.cpp.
References TAO_EC_Default_Factory::create_filter_builder().
00183 { 00184 if (this->filtering_ == 3) 00185 return new TAO_EC_Sched_Filter_Builder (ec); 00186 00187 return this->TAO_EC_Default_Factory::create_filter_builder (ec); 00188 }
TAO_EC_Scheduling_Strategy * TAO_EC_Sched_Factory::create_scheduling_strategy | ( | TAO_EC_Event_Channel_Base * | ) | [virtual] |
Create and destroy the observer strategy.
Reimplemented from TAO_EC_Default_Factory.
Definition at line 203 of file EC_Sched_Factory.cpp.
References TAO_Pseudo_Var_T< T >::in(), and TAO_EC_Event_Channel_Base::scheduler().
00204 { 00205 if (this->scheduling_ == 2) 00206 { 00207 CORBA::Object_var tmp = ec->scheduler (); 00208 RtecScheduler::Scheduler_var scheduler = 00209 RtecScheduler::Scheduler::_narrow (tmp.in ()); 00210 return new TAO_EC_Priority_Scheduling (scheduler.in ()); 00211 } 00212 return this->TAO_EC_Sched_Factory::create_scheduling_strategy (ec); 00213 }
TAO_EC_Timeout_Generator * TAO_EC_Sched_Factory::create_timeout_generator | ( | TAO_EC_Event_Channel_Base * | ) | [virtual] |
Create and destroy the timer module.
Reimplemented from TAO_EC_Default_Factory.
Definition at line 192 of file EC_Sched_Factory.cpp.
References TAO_EC_Default_Factory::create_timeout_generator().
00193 { 00194 #if 0 00195 if (this->timeout_ == 1) 00196 { 00197 } 00198 #endif 00199 return this->TAO_EC_Default_Factory::create_timeout_generator (ec); 00200 }
int TAO_EC_Sched_Factory::fini | ( | void | ) | [virtual] |
int TAO_EC_Sched_Factory::init | ( | int | argc, | |
ACE_TCHAR * | argv[] | |||
) | [virtual] |
Reimplemented from TAO_EC_Default_Factory.
Definition at line 27 of file EC_Sched_Factory.cpp.
References ACE_ERROR, ACE_TEXT(), ACE_Arg_Shifter_T< CHAR_TYPE >::consume_arg(), TAO_EC_Default_Factory::dispatching_, TAO_EC_Default_Factory::filtering_, ACE_Arg_Shifter_T< CHAR_TYPE >::get_current(), ACE_Arg_Shifter_T< CHAR_TYPE >::ignore_arg(), TAO_EC_Default_Factory::init(), ACE_Arg_Shifter_T< CHAR_TYPE >::is_anything_left(), ACE_Arg_Shifter_T< CHAR_TYPE >::is_parameter_next(), LM_ERROR, TAO_EC_Default_Factory::scheduling_, ACE_OS::strcasecmp(), and TAO_EC_Default_Factory::timeout_.
00028 { 00029 ACE_Arg_Shifter arg_shifter (argc, argv); 00030 00031 while (arg_shifter.is_anything_left ()) 00032 { 00033 const ACE_TCHAR* arg = arg_shifter.get_current (); 00034 00035 if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECDispatching")) == 0) 00036 { 00037 arg_shifter.consume_arg (); 00038 00039 if (arg_shifter.is_parameter_next ()) 00040 { 00041 const ACE_TCHAR* opt = arg_shifter.get_current (); 00042 if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0) 00043 { 00044 this->dispatching_ = 0; 00045 } 00046 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("mt")) == 0) 00047 { 00048 this->dispatching_ = 1; 00049 } 00050 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0) 00051 { 00052 this->dispatching_ = 2; 00053 } 00054 else 00055 { 00056 ACE_ERROR ((LM_ERROR, 00057 ACE_TEXT("EC_Sched_Factory - ") 00058 ACE_TEXT("unsupported dispatching <%s>\n"), 00059 opt)); 00060 } 00061 arg_shifter.consume_arg (); 00062 } 00063 } 00064 00065 else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECFiltering")) == 0) 00066 { 00067 arg_shifter.consume_arg (); 00068 00069 if (arg_shifter.is_parameter_next ()) 00070 { 00071 const ACE_TCHAR* opt = arg_shifter.get_current (); 00072 if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0) 00073 { 00074 this->filtering_ = 0; 00075 } 00076 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("basic")) == 0) 00077 { 00078 this->filtering_ = 1; 00079 } 00080 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("prefix")) == 0) 00081 { 00082 this->filtering_ = 2; 00083 } 00084 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0) 00085 { 00086 this->filtering_ = 3; 00087 } 00088 else 00089 { 00090 ACE_ERROR ((LM_ERROR, 00091 ACE_TEXT("EC_Sched_Factory - ") 00092 ACE_TEXT("unsupported filtering <%s>\n"), 00093 opt)); 00094 } 00095 arg_shifter.consume_arg (); 00096 } 00097 } 00098 00099 else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECTimeout")) == 0) 00100 { 00101 arg_shifter.consume_arg (); 00102 00103 if (arg_shifter.is_parameter_next ()) 00104 { 00105 const ACE_TCHAR* opt = arg_shifter.get_current (); 00106 if (ACE_OS::strcasecmp (opt, ACE_TEXT("reactive")) == 0) 00107 { 00108 this->timeout_ = 0; 00109 } 00110 #if 0 00111 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0) 00112 { 00113 this->timeout_ = 1; 00114 } 00115 #endif /* 0 */ 00116 else 00117 { 00118 ACE_ERROR ((LM_ERROR, 00119 ACE_TEXT("EC_Sched_Factory - ") 00120 ACE_TEXT("unsupported timeout <%s>\n"), 00121 opt)); 00122 } 00123 arg_shifter.consume_arg (); 00124 } 00125 } 00126 00127 else if (ACE_OS::strcasecmp (arg, ACE_TEXT("-ECScheduling")) == 0) 00128 { 00129 arg_shifter.consume_arg (); 00130 00131 if (arg_shifter.is_parameter_next ()) 00132 { 00133 const ACE_TCHAR* opt = arg_shifter.get_current (); 00134 if (ACE_OS::strcasecmp (opt, ACE_TEXT("null")) == 0) 00135 { 00136 this->scheduling_ = 0; 00137 } 00138 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("group")) == 0) 00139 { 00140 this->scheduling_ = 1; 00141 } 00142 else if (ACE_OS::strcasecmp (opt, ACE_TEXT("priority")) == 0) 00143 { 00144 this->scheduling_ = 2; 00145 } 00146 else 00147 { 00148 ACE_ERROR ((LM_ERROR, 00149 ACE_TEXT("EC_Sched_Factory - ") 00150 ACE_TEXT("unsupported scheduling <%s>\n"), 00151 opt)); 00152 } 00153 arg_shifter.consume_arg (); 00154 } 00155 } 00156 00157 else 00158 { 00159 arg_shifter.ignore_arg (); 00160 } 00161 } 00162 return this->TAO_EC_Default_Factory::init (argc, argv); 00163 }