TAO_EC_TPC_Factory Class Reference

A generic factory for EC experimentation. More...

#include <EC_TPC_Factory.h>

Inheritance diagram for TAO_EC_TPC_Factory:

Inheritance graph
[legend]
Collaboration diagram for TAO_EC_TPC_Factory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_EC_TPC_Factory (void)
 Constructor.
virtual ~TAO_EC_TPC_Factory (void)
 destructor...
virtual int init (int argc, char *argv[])
virtual TAO_EC_Dispatchingcreate_dispatching (TAO_EC_Event_Channel_Base *)
 Create and destroy the dispatching module.
virtual TAO_EC_ProxyPushSuppliercreate_proxy_push_supplier (TAO_EC_Event_Channel_Base *)
 Create and destroy a ProxyPushSupplier.
virtual TAO_EC_ProxyPushConsumercreate_proxy_push_consumer (TAO_EC_Event_Channel_Base *)
 Create and destroy a ProxyPushConsumer.

Static Public Member Functions

static int init_svcs (void)

Detailed Description

A generic factory for EC experimentation.

This class allows the user to experiment with different EC configurations. Using a command-line like interface the user can specify which strategies will this factory generate. Since the class can be dynamically loaded the strategies can be set in the service configurator file.

Definition at line 32 of file EC_TPC_Factory.h.


Constructor & Destructor Documentation

TAO_EC_TPC_Factory::TAO_EC_TPC_Factory ( void   ) 

Constructor.

Definition at line 21 of file EC_TPC_Factory.cpp.

00022 {
00023   TAO_EC_TPC_debug_level = 0;
00024 }

TAO_EC_TPC_Factory::~TAO_EC_TPC_Factory ( void   )  [virtual]

destructor...

Definition at line 26 of file EC_TPC_Factory.cpp.

00027 {
00028 }


Member Function Documentation

TAO_EC_Dispatching * TAO_EC_TPC_Factory::create_dispatching ( TAO_EC_Event_Channel_Base  )  [virtual]

Create and destroy the dispatching module.

Reimplemented from TAO_EC_Default_Factory.

Definition at line 81 of file EC_TPC_Factory.cpp.

References ACE_DEBUG, TAO_EC_Default_Factory::find_service_object(), LM_DEBUG, TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME, and TAO_EC_TPC_debug_level.

00082 {
00083   if (TAO_EC_TPC_debug_level > 0)
00084     ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) EC_TPC_Factory::create_dispatching\n"));
00085 
00086   TAO_EC_Queue_Full_Service_Object* so =
00087     this->find_service_object (this->queue_full_service_object_name_.fast_rep(),
00088                                TAO_EC_DEFAULT_QUEUE_FULL_SERVICE_OBJECT_NAME);
00089  
00090   return new TAO_EC_TPC_Dispatching (this->dispatching_threads_,
00091                                      this->dispatching_threads_flags_,
00092                                      this->dispatching_threads_priority_,
00093                                      this->dispatching_threads_force_active_,
00094                                      so);
00095 }

TAO_EC_ProxyPushConsumer * TAO_EC_TPC_Factory::create_proxy_push_consumer ( TAO_EC_Event_Channel_Base  )  [virtual]

Create and destroy a ProxyPushConsumer.

Reimplemented from TAO_EC_Default_Factory.

Definition at line 108 of file EC_TPC_Factory.cpp.

References ACE_DEBUG, LM_DEBUG, and TAO_EC_TPC_debug_level.

00109 {
00110   if (TAO_EC_TPC_debug_level > 0)
00111     ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) EC_TPC_Factory::create_proxy_push_consumer\n"));
00112   return new TAO_EC_TPC_ProxyPushConsumer (ec);
00113 }

TAO_EC_ProxyPushSupplier * TAO_EC_TPC_Factory::create_proxy_push_supplier ( TAO_EC_Event_Channel_Base  )  [virtual]

Create and destroy a ProxyPushSupplier.

Reimplemented from TAO_EC_Default_Factory.

Definition at line 99 of file EC_TPC_Factory.cpp.

References ACE_DEBUG, LM_DEBUG, and TAO_EC_TPC_debug_level.

00100 {
00101   if (TAO_EC_TPC_debug_level > 0)
00102     ACE_DEBUG ((LM_DEBUG, "EC (%P|%t) EC_TPC_Factory::create_proxy_push_supplier\n"));
00103   return new TAO_EC_TPC_ProxyPushSupplier (ec, this->consumer_validate_connection_);
00104 }

int TAO_EC_TPC_Factory::init ( int  argc,
char *  argv[] 
) [virtual]

Reimplemented from TAO_EC_Default_Factory.

Definition at line 39 of file EC_TPC_Factory.cpp.

References ACE_DEBUG, ACE_Arg_Shifter_T< CHAR_TYPE >::consume_arg(), 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, ACE_OS::strcasecmp(), and TAO_EC_TPC_debug_level.

00040 {
00041   ACE_Arg_Shifter arg_shifter (argc, argv);
00042 
00043   while (arg_shifter.is_anything_left ())
00044     {
00045       const char *arg = arg_shifter.get_current ();
00046 
00047       if (ACE_OS::strcasecmp (arg, "-ECDispatching") == 0)
00048         {
00049           arg_shifter.consume_arg ();
00050 
00051           if (arg_shifter.is_parameter_next ())
00052             {
00053               // Here we print out a message indicating that this
00054               // option isn't valid with this factory and that it's
00055               // being ignored.
00056 
00057               ACE_DEBUG ((LM_ERROR,
00058                             "EC_TPC_Factory - "
00059                           "-ECDispatching not supported with TPC_Factory; ignoring the option and using thread-per-consumer dispatch strategy\n"));
00060               arg_shifter.consume_arg ();
00061             }
00062         }
00063       if (ACE_OS::strcasecmp (arg, "-ECTPCDebug") == 0)
00064         {
00065           arg_shifter.consume_arg ();
00066           ++TAO_EC_TPC_debug_level;
00067         }
00068       else
00069         {
00070           arg_shifter.ignore_arg ();
00071         }
00072 
00073     }
00074 
00075   return TAO_EC_Default_Factory::init (argc, argv);
00076 }

int TAO_EC_TPC_Factory::init_svcs ( void   )  [static]

Helper function to register the default factory into the service configurator.

Reimplemented from TAO_EC_Default_Factory.

Definition at line 31 of file EC_TPC_Factory.cpp.

References TAO_EC_Simple_Queue_Full_Action::init_svcs(), and ACE_Service_Config::static_svcs().

00032 {
00033   TAO_EC_Simple_Queue_Full_Action::init_svcs();
00034   return ACE_Service_Config::static_svcs ()->
00035     insert (&ace_svc_desc_TAO_EC_TPC_Factory);
00036 }


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