1 #include "tao/DLL_Parser.h"
3 # if (TAO_HAS_DDL_PARSER == 1)
5 #include "tao/Object_Loader.h"
6 #include "tao/Object.h"
7 #include "tao/ORB_Constants.h"
8 #include "tao/SystemException.h"
9 #include "tao/ORB_Core.h"
11 #include "ace/Dynamic_Service.h"
12 #include "ace/Log_Msg.h"
13 #include "ace/OS_NS_string.h"
15 static const char dll_prefix
[] = "DLL:";
17 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
20 TAO_DLL_Parser::match_prefix (const char *ior_string
) const
22 return (ACE_OS::strncmp (ior_string
,
24 sizeof (::dll_prefix
) - 1) == 0);
28 TAO_DLL_Parser::parse_string (const char *ior
,
31 // Skip the prefix, we know it is there because this method in only
32 // called if <match_prefix> returns 1.
34 ior
+ sizeof (::dll_prefix
) - 1;
36 TAO_ORB_Core
*oc
= orb
->orb_core ();
38 TAO_Object_Loader
*loader
=
39 ACE_Dynamic_Service
<TAO_Object_Loader
>::instance
40 (oc
->configuration(), name
);
42 if (loader
== nullptr)
46 (CORBA::SystemException::_tao_minor_code (
52 return loader
->create_object (orb
, 0, nullptr);
56 ACE_STATIC_SVC_DEFINE (TAO_DLL_Parser
,
57 ACE_TEXT ("DLL_Parser"),
59 &ACE_SVC_NAME (TAO_DLL_Parser
),
60 ACE_Service_Type::DELETE_THIS
|
61 ACE_Service_Type::DELETE_OBJ
,
64 ACE_FACTORY_DEFINE (TAO
, TAO_DLL_Parser
)
66 TAO_END_VERSIONED_NAMESPACE_DECL
68 #endif /* TAO_HAS_DDL_PARSER == 1 */