TAO_RTEvent 4.0.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
TAO_ECG_Mcast_Gateway Class Reference

Implement the builder for setting up Event Channel multicast gateway. NOT THREAD-SAFE. More...

#include <ECG_Mcast_Gateway.h>

Inheritance diagram for TAO_ECG_Mcast_Gateway:
Inheritance graph
[legend]
Collaboration diagram for TAO_ECG_Mcast_Gateway:
Collaboration graph
[legend]

Classes

struct  Attributes
 Helper class to initialize a TAO_ECG_Mcast_Gateway. More...
 

Public Types

enum  Service_Type { ECG_MCAST_SENDER , ECG_MCAST_RECEIVER , ECG_MCAST_TWO_WAY }
 Values for some configuration parameters to init (). More...
 
enum  Address_Server_Type { ECG_ADDRESS_SERVER_BASIC , ECG_ADDRESS_SERVER_SOURCE , ECG_ADDRESS_SERVER_TYPE }
 
enum  Handler_Type { ECG_HANDLER_BASIC , ECG_HANDLER_COMPLEX , ECG_HANDLER_UDP }
 
- Public Types inherited from ACE_Event_Handler
typedef long Reference_Count
 

Public Member Functions

virtual int init (int argc, ACE_TCHAR *argv[])
 The Service_Object entry points.
 
virtual int fini ()
 
 TAO_ECG_Mcast_Gateway ()
 Constructor.
 
int init (const char *address_server_arg, const Attributes &attributes=Attributes())
 
int init (const RtecEventChannelAdmin::ConsumerQOS &consumer_qos, const char *address_server_arg, const Attributes &attributes=Attributes())
 
void run (CORBA::ORB_ptr orb, RtecEventChannelAdmin::EventChannel_ptr ec)
 
- Public Member Functions inherited from ACE_Service_Object
 ACE_Service_Object (ACE_Reactor *=0)
 
virtual ~ACE_Service_Object ()
 
virtual int suspend ()
 
virtual int resume ()
 
- Public Member Functions inherited from ACE_Event_Handler
virtual ~ACE_Event_Handler ()=default
 
virtual ACE_HANDLE get_handle () const
 
virtual void set_handle (ACE_HANDLE)
 
virtual int priority () const
 
virtual void priority (int priority)
 
virtual int handle_input (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_output (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_exception (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_timeout (const ACE_Time_Value &current_time, const void *act=0)
 
virtual int handle_exit (ACE_Process *)
 
virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask)
 
virtual int handle_signal (int signum, siginfo_t *=0, ucontext_t *=0)
 
virtual int resume_handler ()
 
virtual int handle_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual int handle_group_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual void reactor (ACE_Reactor *reactor)
 
virtual ACE_Reactorreactor () const
 
virtual ACE_Reactor_Timer_Interfacereactor_timer_interface () const
 
virtual Reference_Count add_reference ()
 
virtual Reference_Count remove_reference ()
 
Reference_Counting_Policyreference_counting_policy ()
 
- Public Member Functions inherited from ACE_Shared_Object
 ACE_Shared_Object ()
 
virtual ~ACE_Shared_Object ()
 
virtual int info (ACE_TCHAR **info_string, size_t length=0) const
 

Static Public Member Functions

static int init_svcs ()
 
- Static Public Member Functions inherited from ACE_Event_Handler
static ACE_THR_FUNC_RETURN read_adapter (void *event_handler)
 
static int register_stdin_handler (ACE_Event_Handler *eh, ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr, int flags=THR_DETACHED)
 
static int remove_stdin_handler (ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr)
 

Private Member Functions

void verify_args (CORBA::ORB_ptr orb, RtecEventChannelAdmin::EventChannel_ptr ec)
 Helpers.
 
int validate_configuration ()
 Verifies configuration values specified through init() make sense.
 
PortableServer::ServantBaseinit_address_server ()
 Allocate and initialize appropriate objects.
 
PortableServer::Servant_var< TAO_ECG_UDP_Senderinit_sender (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr)
 
PortableServer::Servant_var< TAO_ECG_UDP_Receiverinit_receiver (RtecEventChannelAdmin::EventChannel_ptr ec, RtecUDPAdmin::AddrServer_ptr address_server, TAO_ECG_Refcounted_Endpoint endpoint_rptr)
 
TAO_ECG_Refcounted_Endpoint init_endpoint ()
 
TAO_ECG_Refcounted_Handler init_handler (TAO_ECG_Dgram_Handler *recv, RtecEventChannelAdmin::EventChannel_ptr ec, ACE_Reactor *reactor)
 

Private Attributes

Service_Type service_type_
 Flags controlling configuration.
 
Handler_Type handler_type_
 
Address_Server_Type address_server_type_
 
ACE_CString address_server_arg_
 
u_char ttl_value_
 
ACE_TString nic_
 
int ip_multicast_loop_
 
int non_blocking_
 
RtecEventChannelAdmin::ConsumerQOS consumer_qos_
 

Additional Inherited Members

- Public Attributes inherited from ACE_Service_Object
 ACE_ALLOC_HOOK_DECLARE
 
- Public Attributes inherited from ACE_Event_Handler
 LO_PRIORITY
 
 HI_PRIORITY
 
 NULL_MASK
 
 READ_MASK
 
 WRITE_MASK
 
 EXCEPT_MASK
 
 ACCEPT_MASK
 
 CONNECT_MASK
 
 TIMER_MASK
 
 QOS_MASK
 
 GROUP_QOS_MASK
 
 SIGNAL_MASK
 
 ALL_EVENTS_MASK
 
 RWE_MASK
 
 DONT_CALL
 
 ACE_EVENT_HANDLER_NOT_RESUMED
 
 ACE_REACTOR_RESUMES_HANDLER
 
 ACE_APPLICATION_RESUMES_HANDLER
 
- Protected Types inherited from ACE_Event_Handler
typedef std::atomic< Reference_CountAtomic_Reference_Count
 
- Protected Member Functions inherited from ACE_Event_Handler
 ACE_Event_Handler (ACE_Reactor *=nullptr, int priority=ACE_Event_Handler::LO_PRIORITY)
 
- Protected Attributes inherited from ACE_Event_Handler
Atomic_Reference_Count reference_count_
 

Detailed Description

Implement the builder for setting up Event Channel multicast gateway. NOT THREAD-SAFE.

This class simplifies creation of federated Event Channels by presenting a simple unified interface for creating and configuring all components needed to federate an Event Channel. Configuration options are described below.

NOTE: This class does not own any of the components it creates and its lifetime is independent of theirs. This class acts purely as a wrapper facade for creating and wiring appropriate components together.

Todo
This class is an ACE_Service_Object, but the only reason for it is the need for easy configuration using files. Since ACE_Service_Object provides much more than that, we should look into replacing it with a more lightweight utility that would serve our needs.

CONFIGURATION OPTIONS There are two ways to use this class: 1) Use service config file to specify configuration options (which are described below), and use service configurator to obtain a an instance of configured TAO_ECG_Mcast_Gateway in your program. (See TAO/orbsvcs/tests/Event/Mcast/Common and TAO/orbsvcs/tests/Event/Mcast/Simple for an example.)

Service config file options:

-ECGService <service> Valid values: sender, receiver, two_way Specifies whether this gateway should act as a multicast sender of the events or multicast receiver, or both.

-ECGAddressServer <server_type> Valid values: basic, source, type Specifies what implementation of the address server should be used by the gateway. basic - the same multicast address is returned for all event headers. source - multicast addresses are returned based on the event source, according to the mapping provided at initialization. type - multicast addresses are returned based on the event type, according to the mapping provided at initialization.

-ECGAddressServerArg <arg> Valid value: arg is a string, whose format requirements are specific to the implementation of address server used. Arg is not interpreted by the gateway, but simply passed to the address server specified by -ECGAddressServer during initialization. THIS OPTION MUST ALWAYS BE SPECIFIED BY THE USER (there is no default value for it)

-ECGHandler <handler_type> Valid values: basic, complex, udp Specifies what implementation of event handler should be used if gateway is acting as events receiver. basic - a simple event handler listening on a single mcast address. complex - event handler listening on multiple mcast addresses based on events of interest to consumers. udp - similar to basic handler, except listens on udp address as opposed to a multicast group.

-ECGTTL <ttl> Valid values: a number > 0 IP_Multicast time to live value that should be set on a sending socket. This option matters only if the gateway is acting as a sender of mcast messages.

-ECGNIC <nic> Valid values: name of the network interface This interface is used for sending and/or receiving multicast messages.

-ECGNonBlocking Boolean flag to configure if the socket is in blocking or non-blocking code. The default is non-blocking. NOTE: Certain device drivers block the process if the physical link fails.

2) Create an instance of TAO_ECG_Mcast_Gateway in your code, on the stack or dynamically, and use init () method to configure it. No configuration files involved. See service config options above for the description of configurable options, and init() method below for how to specify them.

Default configuration values (for either use case) can be found in ECG_Defaults.h

Member Enumeration Documentation

◆ Address_Server_Type

Enumerator
ECG_ADDRESS_SERVER_BASIC 
ECG_ADDRESS_SERVER_SOURCE 
ECG_ADDRESS_SERVER_TYPE 

◆ Handler_Type

Enumerator
ECG_HANDLER_BASIC 
ECG_HANDLER_COMPLEX 
ECG_HANDLER_UDP 

◆ Service_Type

Values for some configuration parameters to init ().

Enumerator
ECG_MCAST_SENDER 
ECG_MCAST_RECEIVER 
ECG_MCAST_TWO_WAY 

Constructor & Destructor Documentation

◆ TAO_ECG_Mcast_Gateway()

TAO_ECG_Mcast_Gateway::TAO_ECG_Mcast_Gateway ( )

Constructor.

Member Function Documentation

◆ fini()

int TAO_ECG_Mcast_Gateway::fini ( )
virtual

Reimplemented from ACE_Shared_Object.

◆ init() [1/3]

int TAO_ECG_Mcast_Gateway::init ( const char * address_server_arg,
const Attributes & attributes = Attributes() )

Configure TAO_ECG_Mcast_Gateway programatically. This method should be used when NOT using service configurator to obtain/configure TAO_ECG_Mcast_Gateway. See class documentation above for more info.

◆ init() [2/3]

int TAO_ECG_Mcast_Gateway::init ( const RtecEventChannelAdmin::ConsumerQOS & consumer_qos,
const char * address_server_arg,
const Attributes & attributes = Attributes() )

Same as the method above, but also gives the client an opportunity to specify consumer qos, i.e., which EC traffic should get multicasted.

◆ init() [3/3]

int TAO_ECG_Mcast_Gateway::init ( int argc,
ACE_TCHAR * argv[] )
virtual

The Service_Object entry points.

Reimplemented from ACE_Shared_Object.

◆ init_address_server()

PortableServer::ServantBase * TAO_ECG_Mcast_Gateway::init_address_server ( )
private

Allocate and initialize appropriate objects.

◆ init_endpoint()

TAO_ECG_Refcounted_Endpoint TAO_ECG_Mcast_Gateway::init_endpoint ( )
private

◆ init_handler()

TAO_ECG_Refcounted_Handler TAO_ECG_Mcast_Gateway::init_handler ( TAO_ECG_Dgram_Handler * recv,
RtecEventChannelAdmin::EventChannel_ptr ec,
ACE_Reactor * reactor )
private

◆ init_receiver()

PortableServer::Servant_var< TAO_ECG_UDP_Receiver > TAO_ECG_Mcast_Gateway::init_receiver ( RtecEventChannelAdmin::EventChannel_ptr ec,
RtecUDPAdmin::AddrServer_ptr address_server,
TAO_ECG_Refcounted_Endpoint endpoint_rptr )
private

◆ init_sender()

PortableServer::Servant_var< TAO_ECG_UDP_Sender > TAO_ECG_Mcast_Gateway::init_sender ( RtecEventChannelAdmin::EventChannel_ptr ec,
RtecUDPAdmin::AddrServer_ptr address_server,
TAO_ECG_Refcounted_Endpoint endpoint_rptr )
private

◆ init_svcs()

int TAO_ECG_Mcast_Gateway::init_svcs ( )
static

Helper function to register the Gateway into the service configurator.

◆ run()

void TAO_ECG_Mcast_Gateway::run ( CORBA::ORB_ptr orb,
RtecEventChannelAdmin::EventChannel_ptr ec )

The main method - create, configure and run federation components according to the specified configuration.

◆ validate_configuration()

int TAO_ECG_Mcast_Gateway::validate_configuration ( )
private

Verifies configuration values specified through init() make sense.

◆ verify_args()

void TAO_ECG_Mcast_Gateway::verify_args ( CORBA::ORB_ptr orb,
RtecEventChannelAdmin::EventChannel_ptr ec )
private

Helpers.

Check that arguments to run() are not nil.

Member Data Documentation

◆ address_server_arg_

ACE_CString TAO_ECG_Mcast_Gateway::address_server_arg_
private

◆ address_server_type_

Address_Server_Type TAO_ECG_Mcast_Gateway::address_server_type_
private

◆ consumer_qos_

RtecEventChannelAdmin::ConsumerQOS TAO_ECG_Mcast_Gateway::consumer_qos_
private

◆ handler_type_

Handler_Type TAO_ECG_Mcast_Gateway::handler_type_
private

◆ ip_multicast_loop_

int TAO_ECG_Mcast_Gateway::ip_multicast_loop_
private

◆ nic_

ACE_TString TAO_ECG_Mcast_Gateway::nic_
private

◆ non_blocking_

int TAO_ECG_Mcast_Gateway::non_blocking_
private

◆ service_type_

Service_Type TAO_ECG_Mcast_Gateway::service_type_
private

Flags controlling configuration.

◆ ttl_value_

u_char TAO_ECG_Mcast_Gateway::ttl_value_
private

The documentation for this class was generated from the following files: