Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / Strategies / OC_Endpoint_Selector_Factory.h
bloba6d1b2a544c78e68a4d0720dc32ee3f9b4e43568
1 //=============================================================================
2 /**
3 * @file OC_Endpoint_Selector_Factory.h
5 * Strategies for selecting profile/endpoint from an IOR for making an
6 * invocation.
8 * @author Phil Mesnier <mesnier_p@ociweb.com>
9 */
10 //=============================================================================
12 #ifndef TAO_OC_ENDPOINT_SELECTOR_FACTORY_H
13 #define TAO_OC_ENDPOINT_SELECTOR_FACTORY_H
14 #include /**/ "ace/pre.h"
16 #include "tao/Strategies/strategies_export.h"
18 #include "tao/Endpoint_Selector_Factory.h"
19 #include "ace/Service_Config.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
27 // Forward references
28 class TAO_Optimized_Connection_Endpoint_Selector;
30 // ****************************************************************
32 /**
33 * @class TAO_OC_Endpoint_Selector_Factory
35 * @brief Factory for initializing <Endpoint_Selection_State> and
36 * obtaining appropriate <Invocation_Endpoint_Selector>.
38 * Used by Invocation classes to initialize its endpoint selection
39 * strategy and state based on the effective policies.
40 * Endpoint selection strategies are stateless objects - all the
41 * state they need is contained by Invocation in
42 * <Endpoint_Selection_State>. Thus, rather than allocating an
43 * endpoint selection strategy object for each Invocation, the
44 * factory simply returns the appropriate one from the
45 * set preallocated in the ORB_Core. One endpoint selection
46 * strategy object can be used by many invocations concurrently.
48 class TAO_Strategies_Export TAO_OC_Endpoint_Selector_Factory
49 : public TAO_Endpoint_Selector_Factory
51 public:
52 /// Constructor.
53 TAO_OC_Endpoint_Selector_Factory () = default;
55 /// Destructor.
56 virtual ~TAO_OC_Endpoint_Selector_Factory ();
58 virtual int init (int argc, ACE_TCHAR *argv[]);
60 /// Get an Invocation's endpoint selection strategy and
61 /// initialize the endpoint selection state instance.
62 virtual TAO_Invocation_Endpoint_Selector *get_selector ();
64 protected:
65 /// The possible endpoint selector strategies that can be
66 /// returned by this factory
68 TAO_Optimized_Connection_Endpoint_Selector *oc_endpoint_selector_ {};
70 int register_orb_initializer ();
75 ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Strategies, TAO_OC_Endpoint_Selector_Factory)
76 ACE_FACTORY_DECLARE (TAO_Strategies, TAO_OC_Endpoint_Selector_Factory)
78 TAO_END_VERSIONED_NAMESPACE_DECL
80 #include /**/ "ace/post.h"
81 #endif /* TAO_OC_ENDPOINT_SELECTOR_FACTORY_H */