MCAST_Parser.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   MCAST_Parser.h
00006  *
00007  *  $Id: MCAST_Parser.h 79237 2007-08-07 09:48:21Z johnnyw $
00008  *
00009  *  @author Priyanka Gontla (gontla_p@ociweb.com)
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef TAO_MCAST_PARSER_H
00015 #define TAO_MCAST_PARSER_H
00016 
00017 #include /**/ "ace/pre.h"
00018 #include "ace/Service_Config.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/CORBA_String.h"
00025 #include "tao/IOR_Parser.h"
00026 
00027 #if (TAO_HAS_MCAST_PARSER == 1)
00028 
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030 
00031 /**
00032  * @class TAO_MCAST_Parser
00033  *
00034  * @brief Implements the @c mcast: IOR format
00035  *
00036  * This class implements the @c mcast: IOR format.
00037  * It is dynamically loaded by the ORB and used to parse the
00038  * string to separate the individual <obj_addr> from the list of object
00039  * addresses <obj_addr_list>.
00040  */
00041 class TAO_Export TAO_MCAST_Parser : public TAO_IOR_Parser
00042 {
00043 public:
00044   /// Constructor
00045   TAO_MCAST_Parser (void);
00046 
00047   /// The destructor
00048   virtual ~TAO_MCAST_Parser (void);
00049 
00050   /// = The IOR_Parser methods, please read the documentation in
00051   ///   IOR_Parser.h
00052   virtual bool match_prefix (const char *ior_string) const;
00053 
00054   /// Parse the ior-string that is passed.
00055   virtual CORBA::Object_ptr parse_string (const char *ior,
00056                                           CORBA::ORB_ptr orb);
00057 
00058 private:
00059 
00060   CORBA::Object_ptr multicast_to_service (const char *service_name,
00061                                           unsigned short port,
00062                                           const char *mcast_address,
00063                                           int mcast_ttl,
00064                                           const char *mcast_nic,
00065                                           CORBA::ORB_ptr orb,
00066                                           ACE_Time_Value *timeout);
00067 
00068   int multicast_query (char *&buf,
00069                        const char *service_name,
00070                        unsigned short port,
00071                        const char *mcast_address,
00072                        int mcast_ttl,
00073                        const char *mcast_nic,
00074                        ACE_Time_Value *timeout,
00075                        CORBA::ORB_ptr orb);
00076 
00077   /* Simple method to assign values to the global members:
00078      mcast_address_, mcast_port_, mcast_nic_, mcast_ttl_ */
00079   void assign_to_variables (char const * mcast_name_ptr);
00080 
00081 private:
00082 
00083   CORBA::String_var mcast_address_;
00084 
00085   /// Default multicast port (currently Name Service mcast port).
00086   unsigned short    mcast_port_;
00087 
00088   /// Multicast network interface card.
00089   CORBA::String_var mcast_nic_;
00090 
00091   /// Default time-to-live (default is 1).
00092   int               mcast_ttl_;
00093 
00094   /// Multicast service name
00095   CORBA::String_var service_name_;
00096 
00097 };
00098 
00099 TAO_END_VERSIONED_NAMESPACE_DECL
00100 
00101 #if defined (__ACE_INLINE__)
00102 # include "tao/MCAST_Parser.inl"
00103 #endif /* __ACE_INLINE__ */
00104 
00105 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_MCAST_Parser)
00106 ACE_FACTORY_DECLARE (TAO, TAO_MCAST_Parser)
00107 
00108 #endif /* TAO_HAS_MCAST_PARSER == 1 */
00109 
00110 #include /**/ "ace/post.h"
00111 #endif /* TAO_MCAST_PARSER_H */

Generated on Tue Feb 2 17:37:52 2010 for TAO by  doxygen 1.4.7