Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / tao / CORBALOC_Parser.h
blob9ce93163da0c00d7fd5b76c225bb192efc547916
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file CORBALOC_Parser.h
7 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
8 * @author Priyanka Gontla (pgontla@uci.edu)
9 */
10 //=============================================================================
13 #ifndef TAO_CORBALOC_PARSER_H
14 #define TAO_CORBALOC_PARSER_H
15 #include /**/ "ace/pre.h"
17 #include "tao/IOR_Parser.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if (TAO_HAS_CORBALOC_PARSER == 1)
25 #include "ace/Service_Config.h"
26 #include "ace/Containers_T.h"
27 #include "tao/Profile.h"
28 #include "ace/SString.h"
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 class TAO_MProfile;
34 /**
35 * @class TAO_CORBALOC_Parser
37 * @brief Implements the <corbaloc:> IOR format
39 * This class implements the <corbaloc:> IOR format.
40 * It is dynamically loaded by the ORB and used to parse the
41 * string to separate the individual <obj_addr> from the list of object
42 * addresses <obj_addr_list>.
44 class TAO_CORBALOC_Parser : public TAO_IOR_Parser
46 public:
47 /// Constructor
48 TAO_CORBALOC_Parser (void);
50 /// The destructor
51 virtual ~TAO_CORBALOC_Parser (void);
53 /// = The IOR_Parser methods, please read the documentation in
54 /// IOR_Parser.h
55 virtual bool match_prefix (const char *ior_string) const;
57 /// Parse the ior-string that is passed.
58 virtual CORBA::Object_ptr parse_string (const char *ior,
59 CORBA::ORB_ptr orb);
61 private:
62 /**
63 * Make a stub from the MProfile that is created in
64 * parse_string_mprofile_helper. Using this stub, create an object
65 * reference which is sent to the application.
67 CORBA::Object_ptr make_stub_from_mprofile (CORBA::ORB_ptr orb,
68 TAO_MProfile &mprofile);
70 /// Gets the pointer to the key_string when the protocol used is RIR
71 CORBA::Object_ptr parse_string_rir_helper (const char *corbaloc_name,
72 CORBA::ORB_ptr orb);
74 void make_canonical (const char *ior,
75 size_t ior_len,
76 ACE_CString &canonical_endpoint);
78 struct parsed_endpoint {
79 parsed_endpoint ();
80 ~parsed_endpoint ();
81 TAO_Profile *profile_;
82 char obj_key_sep_;
83 ACE_CString prot_addr_;
87 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_CORBALOC_Parser)
88 ACE_FACTORY_DECLARE (TAO, TAO_CORBALOC_Parser)
90 TAO_END_VERSIONED_NAMESPACE_DECL
92 #if defined (__ACE_INLINE__)
93 # include "tao/CORBALOC_Parser.inl"
94 #endif /* __ACE_INLINE__ */
96 #endif /* TAO_HAS_CORBALOC_PARSER == 1 */
98 #include /**/ "ace/post.h"
99 #endif /* TAO_CORBALOC_PARSER_H */