Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / Strategies / DIOP_Factory.cpp
blob66fc22e5328b65f17b489ffee2f7bca42a9f9492
1 #include "tao/Strategies/DIOP_Factory.h"
3 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
5 #include "tao/Strategies/DIOP_Acceptor.h"
6 #include "tao/Strategies/DIOP_Connector.h"
8 #include "tao/ORB_Constants.h"
10 #include "ace/OS_NS_strings.h"
12 static const char the_prefix[] = "diop";
14 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 TAO_DIOP_Protocol_Factory::TAO_DIOP_Protocol_Factory ()
17 : TAO_Protocol_Factory (TAO_TAG_DIOP_PROFILE)
21 int
22 TAO_DIOP_Protocol_Factory::match_prefix (const ACE_CString &prefix)
24 // Check for the proper prefix for this protocol.
25 return (ACE_OS::strcasecmp (prefix.c_str (), ::the_prefix) == 0);
28 const char *
29 TAO_DIOP_Protocol_Factory::prefix () const
31 return ::the_prefix;
34 char
35 TAO_DIOP_Protocol_Factory::options_delimiter () const
37 return '/';
40 TAO_Acceptor *
41 TAO_DIOP_Protocol_Factory::make_acceptor ()
43 TAO_Acceptor *acceptor = 0;
45 ACE_NEW_RETURN (acceptor,
46 TAO_DIOP_Acceptor,
47 0);
49 return acceptor;
52 int
53 TAO_DIOP_Protocol_Factory::init (int /* argc */, ACE_TCHAR* /* argv */ [])
55 return 0;
58 TAO_Connector *
59 TAO_DIOP_Protocol_Factory::make_connector ()
61 TAO_Connector *connector = 0;
63 ACE_NEW_RETURN (connector,
64 TAO_DIOP_Connector,
65 0);
66 return connector;
69 int
70 TAO_DIOP_Protocol_Factory::requires_explicit_endpoint () const
72 // This switch is actually meant to distinguish between pluggable
73 // protocols which are able to clean up their endpoints and such
74 // that aren't. E.g. UIOP will leave files, it therefore returns 1,
75 // IIOP cleans up its endpoint resources, which therefore return 0.
77 // DIOP does clean up endpoint resources, but as DIOP is only
78 // suitable for special environments, e.g. it supports only one-ways,
79 // it returns 1 for an other reason than resource clean-up.
81 return 1;
85 ACE_STATIC_SVC_DEFINE (TAO_DIOP_Protocol_Factory,
86 ACE_TEXT ("DIOP_Factory"),
87 ACE_SVC_OBJ_T,
88 &ACE_SVC_NAME (TAO_DIOP_Protocol_Factory),
89 ACE_Service_Type::DELETE_THIS |
90 ACE_Service_Type::DELETE_OBJ,
93 ACE_FACTORY_DEFINE (TAO_Strategies, TAO_DIOP_Protocol_Factory)
95 TAO_END_VERSIONED_NAMESPACE_DECL
97 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */