00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file CORBALOC_Parser.h 00006 * 00007 * CORBALOC_Parser.h,v 1.21 2006/03/10 07:19:04 jtc Exp 00008 * 00009 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00010 * @author Priyanka Gontla (pgontla@uci.edu) 00011 */ 00012 //============================================================================= 00013 00014 00015 #ifndef TAO_CORBALOC_PARSER_H 00016 #define TAO_CORBALOC_PARSER_H 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/IOR_Parser.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "ace/Service_Config.h" 00026 #include "ace/Array.h" 00027 #include "tao/Profile.h" 00028 #include "ace/SString.h" 00029 00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00031 00032 class TAO_MProfile; 00033 00034 /** 00035 * @class TAO_CORBALOC_Parser 00036 * 00037 * @brief Implements the <corbaloc:> IOR format 00038 * 00039 * This class implements the <corbaloc:> IOR format. 00040 * It is dynamically loaded by the ORB and used to parse the 00041 * string to separate the individual <obj_addr> from the list of object 00042 * addresses <obj_addr_list>. 00043 */ 00044 class TAO_CORBALOC_Parser : public TAO_IOR_Parser 00045 { 00046 public: 00047 /// Constructor 00048 TAO_CORBALOC_Parser (void); 00049 00050 /// The destructor 00051 virtual ~TAO_CORBALOC_Parser (void); 00052 00053 /// = The IOR_Parser methods, please read the documentation in 00054 /// IOR_Parser.h 00055 virtual int match_prefix (const char *ior_string) const; 00056 00057 /// Parse the ior-string that is passed. 00058 virtual CORBA::Object_ptr parse_string (const char *ior, 00059 CORBA::ORB_ptr orb 00060 ACE_ENV_ARG_DECL) 00061 ACE_THROW_SPEC ((CORBA::SystemException)); 00062 00063 private: 00064 00065 /** 00066 * Make a stub from the MProfile that is created in 00067 * parse_string_mprofile_helper. Using this stub, create an object 00068 * reference which is sent to the application. 00069 */ 00070 CORBA::Object_ptr make_stub_from_mprofile (CORBA::ORB_ptr orb, 00071 TAO_MProfile &mprofile 00072 ACE_ENV_ARG_DECL) 00073 ACE_THROW_SPEC ((CORBA::SystemException)); 00074 00075 /// Gets the pointer to the key_string when the protocol used is RIR 00076 CORBA::Object_ptr parse_string_rir_helper (const char *corbaloc_name, 00077 CORBA::ORB_ptr orb 00078 ACE_ENV_ARG_DECL) 00079 ACE_THROW_SPEC ((CORBA::SystemException)); 00080 00081 void make_canonical (const char *ior, 00082 size_t ior_len, 00083 ACE_CString &canonical_endpoint 00084 ACE_ENV_ARG_DECL) 00085 ACE_THROW_SPEC ((CORBA::SystemException)); 00086 00087 struct parsed_endpoint { 00088 parsed_endpoint (); 00089 ~parsed_endpoint (); 00090 TAO_Profile *profile_; 00091 char obj_key_sep_; 00092 ACE_CString prot_addr_; 00093 }; 00094 }; 00095 00096 TAO_END_VERSIONED_NAMESPACE_DECL 00097 00098 #if defined (__ACE_INLINE__) 00099 # include "tao/CORBALOC_Parser.i" 00100 #endif /* __ACE_INLINE__ */ 00101 00102 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_CORBALOC_Parser) 00103 ACE_FACTORY_DECLARE (TAO, TAO_CORBALOC_Parser) 00104 00105 #include /**/ "ace/post.h" 00106 #endif /* TAO_CORBALOC_PARSER_H */