CORBALOC_Parser.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   CORBALOC_Parser.h
00006  *
00007  *  $Id: CORBALOC_Parser.h 79237 2007-08-07 09:48:21Z johnnyw $
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 #if (TAO_HAS_CORBALOC_PARSER == 1)
00026 
00027 #include "ace/Service_Config.h"
00028 #include "ace/Array.h"
00029 #include "tao/Profile.h"
00030 #include "ace/SString.h"
00031 
00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00033 
00034 class TAO_MProfile;
00035 
00036 /**
00037  * @class TAO_CORBALOC_Parser
00038  *
00039  * @brief Implements the <corbaloc:> IOR format
00040  *
00041  * This class implements the <corbaloc:> IOR format.
00042  * It is dynamically loaded by the ORB and used to parse the
00043  * string to separate the individual <obj_addr> from the list of object
00044  * addresses <obj_addr_list>.
00045  */
00046 class TAO_CORBALOC_Parser : public TAO_IOR_Parser
00047 {
00048 public:
00049   /// Constructor
00050   TAO_CORBALOC_Parser (void);
00051 
00052   /// The destructor
00053   virtual ~TAO_CORBALOC_Parser (void);
00054 
00055   /// = The IOR_Parser methods, please read the documentation in
00056   ///   IOR_Parser.h
00057   virtual bool match_prefix (const char *ior_string) const;
00058 
00059   /// Parse the ior-string that is passed.
00060   virtual CORBA::Object_ptr parse_string (const char *ior,
00061                                           CORBA::ORB_ptr orb
00062                                           );
00063 
00064 private:
00065 
00066   /**
00067    * Make a stub from the MProfile that is created in
00068    * parse_string_mprofile_helper. Using this stub, create an object
00069    * reference which is sent to the application.
00070    */
00071   CORBA::Object_ptr make_stub_from_mprofile (CORBA::ORB_ptr orb,
00072                                              TAO_MProfile &mprofile
00073                                              );
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                                              );
00079 
00080   void make_canonical (const char *ior,
00081                        size_t ior_len,
00082                        ACE_CString &canonical_endpoint
00083                        );
00084 
00085   struct parsed_endpoint {
00086     parsed_endpoint ();
00087     ~parsed_endpoint ();
00088     TAO_Profile *profile_;
00089     char obj_key_sep_;
00090     ACE_CString prot_addr_;
00091   };
00092 };
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 #if defined (__ACE_INLINE__)
00097 # include "tao/CORBALOC_Parser.inl"
00098 #endif /* __ACE_INLINE__ */
00099 
00100 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_CORBALOC_Parser)
00101 ACE_FACTORY_DECLARE (TAO, TAO_CORBALOC_Parser)
00102 
00103 #endif /* TAO_HAS_CORBALOC_PARSER == 1 */
00104 
00105 #include /**/ "ace/post.h"
00106 #endif /* TAO_CORBALOC_PARSER_H */

Generated on Sun Jan 27 13:07:32 2008 for TAO by doxygen 1.3.6