2 #include "tao/Parser_Registry.h"
3 #include "tao/IOR_Parser.h"
4 #include "tao/ORB_Core.h"
6 #include "ace/Dynamic_Service.h"
8 #if !defined(__ACE_INLINE__)
9 #include "tao/Parser_Registry.inl"
10 #endif /* __ACE_INLINE__ */
12 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
14 TAO_Parser_Registry::TAO_Parser_Registry ()
20 TAO_Parser_Registry::~TAO_Parser_Registry ()
22 delete [] this->parsers_
;
26 TAO_Parser_Registry::open (TAO_ORB_Core
*orb_core
)
28 char **names
= nullptr;
29 int number_of_names
= 0;
31 if (orb_core
->resource_factory () == nullptr)
36 orb_core
->resource_factory ()->get_parser_names (names
, number_of_names
);
38 if (number_of_names
== 0)
43 this->size_
= number_of_names
;
44 ACE_NEW_RETURN (this->parsers_
,
45 TAO_IOR_Parser
*[this->size_
],
48 for (size_t i
= 0, index
= 0; i
!= this->size_
; ++i
)
50 this->parsers_
[index
] =
51 ACE_Dynamic_Service
<TAO_IOR_Parser
>::instance (orb_core
->configuration (),
54 if (this->parsers_
[index
] == nullptr)
57 if (TAO_debug_level
>= 1)
59 TAOLIB_DEBUG ((LM_DEBUG
, "TAO (%P|%t) Failed to find Service Object"
60 " for %C.\n", names
[i
]));
69 this->size_
= number_of_names
;
74 TAO_Parser_Registry::match_parser (const char *ior_string
)
76 for (Parser_Iterator i
= this->begin (); i
!= this->end (); ++i
)
78 if ((*i
)->match_prefix (ior_string
))
87 TAO_END_VERSIONED_NAMESPACE_DECL