Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Strategy_Connector Class Template Reference

Abstract factory for creating a service handler (SVC_HANDLER), connecting the SVC_HANDLER, and activating the SVC_HANDLER. More...

`#include <Connector.h>`

Inheritance diagram for ACE_Strategy_Connector

[legend]
Collaboration diagram for ACE_Strategy_Connector:

[legend]
List of all members.

## Public Types
typedef ACE_Creation_Strategy< SVC_HANDLER> | CREATION_STRATEGY
typedef ACE_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2> | CONNECT_STRATEGY
typedef ACE_Concurrency_Strategy< SVC_HANDLER> | CONCURRENCY_STRATEGY
typedef ACE_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2> | SUPER
## Public Methods
| ACE_Strategy_Connector (ACE_Reactor *r = ACE_Reactor::instance (), ACE_Creation_Strategy<SVC_HANDLER> * = 0, ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> * = 0, ACE_Concurrency_Strategy<SVC_HANDLER> * = 0, int flags = 0)
virtual int | open (ACE_Reactor *r, int flags)
virtual int | open (ACE_Reactor *r = ACE_Reactor::instance (), ACE_Creation_Strategy<SVC_HANDLER> * = 0, ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> * = 0, ACE_Concurrency_Strategy<SVC_HANDLER> * = 0, int flags = 0)
virtual | ~ACE_Strategy_Connector (void)
| Shutdown a connector and release resources.
virtual int | close (void)
| Close down the Connector.
virtual ACE_Creation_Strategy< SVC_HANDLER>* | creation_strategy (void) const
virtual ACE_Connect_Strategy< SVC_HANDLER, ACE_PEER_CONNECTOR_2>* | connect_strategy (void) const
virtual ACE_Concurrency_Strategy< SVC_HANDLER>* | concurrency_strategy (void) const
## Protected Methods
virtual int | make_svc_handler (SVC_HANDLER *&sh)
virtual int | connect_svc_handler (SVC_HANDLER *&sh, const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, int reuse_addr, int flags, int perms)
virtual int | connect_svc_handler (SVC_HANDLER *&sh, SVC_HANDLER *&sh_copy, const ACE_PEER_CONNECTOR_ADDR &remote_addr, ACE_Time_Value *timeout, const ACE_PEER_CONNECTOR_ADDR &local_addr, int reuse_addr, int flags, int perms)
virtual int | activate_svc_handler (SVC_HANDLER *svc_handler)
## Protected Attributes
CREATION_STRATEGY* | creation_strategy_
| Creation strategy for an <Connector>.
int | delete_creation_strategy_
| 1 if <Connector> created the creation strategy and thus should delete it, else 0.
CONNECT_STRATEGY* | connect_strategy_
| Connect strategy for a <Connector>.
int | delete_connect_strategy_
| 1 if <Connector> created the connect strategy and thus should delete it, else 0.
CONCURRENCY_STRATEGY* | concurrency_strategy_
| Concurrency strategy for an <Connector>.
int | delete_concurrency_strategy_
| 1 if <Connector> created the concurrency strategy and thus should delete it, else 0.

## Detailed Description

### template<class SVC_HANDLER, ACE_PEER_CONNECTOR_1> template class ACE_Strategy_Connector

Abstract factory for creating a service handler (SVC_HANDLER), connecting the SVC_HANDLER, and activating the SVC_HANDLER.

Implements a flexible and extensible set of strategies for actively establishing connections with clients. There are three main strategies: (1) creating a SVC_HANDLER, (2) actively connecting a new connection from a client into the SVC_HANDLER, and (3) activating the SVC_HANDLER with a particular concurrency mechanism.

## Member Typedef Documentation

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
typedef ACE_Concurrency_Strategy<SVC_HANDLER> ACE_Strategy_Connector<SVC_HANDLER, >::CONCURRENCY_STRATEGY

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
typedef ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> ACE_Strategy_Connector<SVC_HANDLER, >::CONNECT_STRATEGY

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
typedef ACE_Creation_Strategy<SVC_HANDLER> ACE_Strategy_Connector<SVC_HANDLER, >::CREATION_STRATEGY

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
typedef ACE_Connector<SVC_HANDLER, ACE_PEER_CONNECTOR_2> ACE_Strategy_Connector<SVC_HANDLER, >::SUPER

## Constructor & Destructor Documentation

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
ACE_Strategy_Connector<SVC_HANDLER, >::ACE_Strategy_Connector<SVC_HANDLER, > ( | ACE_Reactor * r = ACE_Reactor::instance (),
| ACE_Creation_Strategy< SVC_HANDLER >* = 0,
| ACE_Connect_Strategy< SVC_HANDLER,ACE_PEER_CONNECTOR_2 >* = 0,
| ACE_Concurrency_Strategy< SVC_HANDLER >* = 0,
| int flags = 0 )

| Initialize a connector. <flags> indicates how <SVC_HANDLER>'s should be initialized prior to being activated. Right now, the only flag that is processed is , which enabled non-blocking I/O on the <SVC_HANDLER> when it is opened.

template<classSVH, PR_CO_1>
ACE_Strategy_Connector<SVH, >::~ACE_Strategy_Connector<SVH, > ( | void )`[virtual]`

| Shutdown a connector and release resources.

## Member Function Documentation

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
int ACE_Strategy_Connector<SVC_HANDLER, >::activate_svc_handler ( | SVC_HANDLER * svc_handler )`[protected, virtual]`

| Bridge method for activating a <SVC_HANDLER> with the appropriate concurrency strategy. The default behavior of this method is to activate the <SVC_HANDLER> by calling its <open> method (which allows the <SVC_HANDLER> to define its own concurrency strategy). However, subclasses can override this strategy to do more sophisticated concurrency activations (such as creating the <SVC_HANDLER> as an "active object" via multi-threading or multi-processing). Reimplemented from ACE_Connector.

template<classSVH, PR_CO_1>
int ACE_Strategy_Connector<SVH, >::close ( | void )`[virtual]`

| Close down the Connector. Reimplemented from ACE_Connector.

template<classSVH, PR_CO_1>
ACE_Concurrency_Strategy< SVC_HANDLER >* ACE_Strategy_Connector< SVH,PR_CO_2 >::concurrency_strategy ( | void ) const`[virtual]`

template<classSVH, PR_CO_1>
ACE_Connect_Strategy< SVC_HANDLER,ACE_PEER_CONNECTOR_2 >* ACE_Strategy_Connector< SVH,PR_CO_2 >::connect_strategy ( | void ) const`[virtual]`

template<classSVH, PR_CO_1>
int ACE_Strategy_Connector< SVH,PR_CO_2 >::connect_svc_handler ( | SVH *& sh,
| SVH *& sh_copy,
| const ACE_PEER_CONNECTOR_ADDR & remote_addr,
| ACE_Time_Value * timeout,
| const ACE_PEER_CONNECTOR_ADDR & local_addr,
| int reuse_addr,
| int flags,
| int perms )`[protected, virtual]`

| Bridge method for connecting the new connection into the <SVC_HANDLER>. The default behavior delegates to the <PEER_CONNECTOR::connect> in the <Connect_Strategy>. <sh_copy> is used to obtain a copy of the <sh> pointer, but that can be kept in the stack; the motivation is a bit too long to include here, but basically we want to modify <sh> safely, using the internal locks in the Connect_Strategy, while saving a TSS copy in <sh_copy>, usually located in the stack.

template<classSVH, PR_CO_1>
int ACE_Strategy_Connector< SVH,PR_CO_2 >::connect_svc_handler ( | SVH *& sh,
| const ACE_PEER_CONNECTOR_ADDR & remote_addr,
| ACE_Time_Value * timeout,
| const ACE_PEER_CONNECTOR_ADDR & local_addr,
| int reuse_addr,
| int flags,
| int perms )`[protected, virtual]`

| Bridge method for connecting the new connection into the <SVC_HANDLER>. The default behavior delegates to the <PEER_CONNECTOR::connect> in the <Connect_Strategy>.

template<classSVH, PR_CO_1>
ACE_Creation_Strategy< SVC_HANDLER >* ACE_Strategy_Connector< SVH,PR_CO_2 >::creation_strategy ( | void ) const`[virtual]`

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
int ACE_Strategy_Connector<SVC_HANDLER, >::make_svc_handler ( | SVC_HANDLER *& sh )`[protected, virtual]`

| Bridge method for creating a <SVC_HANDLER>. The strategy for creating a <SVC_HANDLER> are configured into the Connector via it's <creation_strategy_>. The default is to create a new <SVC_HANDLER> only if <sh> == 0, else <sh> is unchanged. However, subclasses can override this policy to perform <SVC_HANDLER> creation in any way that they like (such as creating subclass instances of <SVC_HANDLER>, using a singleton, dynamically linking the handler, etc.). Returns -1 if failure, else 0. Reimplemented from ACE_Connector.

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
int ACE_Strategy_Connector<SVC_HANDLER, >::open ( | ACE_Reactor * r = ACE_Reactor::instance (),
| ACE_Creation_Strategy< SVC_HANDLER >* = 0,
| ACE_Connect_Strategy< SVC_HANDLER,ACE_PEER_CONNECTOR_2 >* = 0,
| ACE_Concurrency_Strategy< SVC_HANDLER >* = 0,
| int flags = 0 )`[virtual]`

| Initialize a connector. <flags> indicates how <SVC_HANDLER>'s should be initialized prior to being activated. Right now, the only flag that is processed is , which enabled non-blocking I/O on the <SVC_HANDLER> when it is opened.

template<classSVH, PR_CO_1>
int ACE_Strategy_Connector<SVH, >::open ( | ACE_Reactor * r,
| int flags )`[virtual]`

| Initialize a connector. <flags> indicates how <SVC_HANDLER>'s should be initialized prior to being activated. Right now, the only flag that is processed is , which enabled non-blocking I/O on the <SVC_HANDLER> when it is opened. Default strategies would be created and used. Reimplemented from ACE_Connector.

## Member Data Documentation

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
CONCURRENCY_STRATEGY * ACE_Strategy_Connector<SVC_HANDLER, >::concurrency_strategy_`[protected]`

| Concurrency strategy for an <Connector>.

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
CONNECT_STRATEGY * ACE_Strategy_Connector<SVC_HANDLER, >::connect_strategy_`[protected]`

| Connect strategy for a <Connector>.

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
CREATION_STRATEGY * ACE_Strategy_Connector<SVC_HANDLER, >::creation_strategy_`[protected]`

| Creation strategy for an <Connector>.

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
int ACE_Strategy_Connector<SVC_HANDLER, >::delete_concurrency_strategy_`[protected]`

| 1 if <Connector> created the concurrency strategy and thus should delete it, else 0.

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
int ACE_Strategy_Connector<SVC_HANDLER, >::delete_connect_strategy_`[protected]`

| 1 if <Connector> created the connect strategy and thus should delete it, else 0.

template<classSVC_HANDLER, ACE_PEER_CONNECTOR_1>
int ACE_Strategy_Connector<SVC_HANDLER, >::delete_creation_strategy_`[protected]`

| 1 if <Connector> created the creation strategy and thus should delete it, else 0.

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

- Connector.h
- Connector.cpp