Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

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,v 1.1.1.2 2003/02/21 18:36:44 chad 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 
00027 class TAO_MProfile;
00028 
00029 /**
00030  * @class TAO_CORBALOC_Parser
00031  *
00032  * @brief Implements the <corbaloc:> IOR format
00033  *
00034  * This class implements the <corbaloc:> IOR format.
00035  * It is dynamically loaded by the ORB and used to parse the
00036  * string to separate the individual <obj_addr> from the list of object
00037  * addresses <obj_addr_list>.
00038  */
00039 class TAO_Export TAO_CORBALOC_Parser : public TAO_IOR_Parser
00040 {
00041 public:
00042   /// Constructor
00043   TAO_CORBALOC_Parser (void);
00044 
00045   /// The destructor
00046   virtual ~TAO_CORBALOC_Parser (void);
00047 
00048   /// = The IOR_Parser methods, please read the documentation in
00049   ///   IOR_Parser.h
00050   virtual int match_prefix (const char *ior_string) const;
00051 
00052   /// Parse the ior-string that is passed.
00053   virtual CORBA::Object_ptr parse_string (const char *ior,
00054                                           CORBA::ORB_ptr orb
00055                                           ACE_ENV_ARG_DECL_NOT_USED)
00056     ACE_THROW_SPEC ((CORBA::SystemException));
00057 
00058 private:
00059 
00060   /// Checks the prefix to see if it is RIR.
00061   virtual int check_prefix (const char *endpoint
00062                             ACE_ENV_ARG_DECL)
00063     ACE_THROW_SPEC ((CORBA::SystemException));
00064 
00065   /// Helps count the length of the <obj_addr_list> and the number of
00066   /// individual <obj_addr> in the <obj_addr_list>.
00067   virtual void parse_string_count_helper (const char * corbaloc_name,
00068                                           CORBA::ULong &addr_list_length,
00069                                           CORBA::ULong &count_addr
00070                                           ACE_ENV_ARG_DECL_NOT_USED)
00071     ACE_THROW_SPEC ((CORBA::SystemException));
00072 
00073   /**
00074    * Creates a MProfile for the endpoint passed and each such mprofile
00075    * is added to the big mprofile <mprofile_> from which a pointer to
00076    * the Object represented by the key_string is obtained and passed
00077    * to the application.
00078    */
00079   virtual void parse_string_mprofile_helper (const char * end_point,
00080                                              CORBA::ORB_ptr orb,
00081                                              TAO_MProfile &mprofile
00082                                              ACE_ENV_ARG_DECL_NOT_USED)
00083     ACE_THROW_SPEC ((CORBA::SystemException));
00084 
00085   /**
00086    * Make a stub from the MProfile that is created in
00087    * parse_string_mprofile_helper. Using this stub, create an object
00088    * reference which is sent to the application.
00089    */
00090   virtual CORBA::Object_ptr
00091     make_stub_from_mprofile (CORBA::ORB_ptr orb,
00092                              TAO_MProfile &mprofile
00093                              ACE_ENV_ARG_DECL_NOT_USED)
00094     ACE_THROW_SPEC ((CORBA::SystemException));
00095 
00096   /// Gets the pointer to the key_string when the protocol used is RIR
00097   virtual CORBA::Object_ptr
00098     parse_string_rir_helper (const char * &corbaloc_name,
00099                              CORBA::ORB_ptr orb
00100                              ACE_ENV_ARG_DECL_NOT_USED)
00101     ACE_THROW_SPEC ((CORBA::SystemException));
00102 
00103   /// Tokenizes the <obj_addr_list> using "," as the seperator. Assigns
00104   /// individual endpoints to the elements of the ACE_Array_Base.
00105   virtual void parse_string_assign_helper (
00106                                            ACE_CString &key_string,
00107                                            ACE_CString &cloc_name,
00108                                            CORBA::ORB_ptr orb,
00109                                            TAO_MProfile &mprofile
00110                                            ACE_ENV_ARG_DECL_NOT_USED)
00111     ACE_THROW_SPEC ((CORBA::SystemException));
00112 
00113   /**
00114    * Helps parse_string_assign_helper by assigning in the case when
00115    * the protocol name is present and we have to append jsut the key
00116    * string.
00117    */
00118   virtual void
00119     assign_key_string(char * &cloc_name_ptr,
00120                       ACE_CString &key_string,
00121                       CORBA::ULong &addr_list_length,
00122                       CORBA::ORB_ptr orb,
00123                       TAO_MProfile &mprofile
00124                       ACE_ENV_ARG_DECL_NOT_USED)
00125     ACE_THROW_SPEC ((CORBA::SystemException));
00126 
00127 };
00128 
00129 #if defined (__ACE_INLINE__)
00130 # include "CORBALOC_Parser.i"
00131 #endif /* __ACE_INLINE__ */
00132 
00133 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_CORBALOC_Parser)
00134 ACE_FACTORY_DECLARE (TAO, TAO_CORBALOC_Parser)
00135 
00136 #include "ace/post.h"
00137 #endif /* TAO_CORBALOC_PARSER_H */

Generated on Mon Jun 16 13:48:11 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002