Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / MCAST_Parser.h
blob62a02f9b2bc09655c86005d267e87604c71a1553
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file MCAST_Parser.h
7 * @author Priyanka Gontla (gontla_p@ociweb.com)
8 */
9 //=============================================================================
12 #ifndef TAO_MCAST_PARSER_H
13 #define TAO_MCAST_PARSER_H
15 #include /**/ "ace/pre.h"
16 #include "ace/Service_Config.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/CORBA_String.h"
23 #include "tao/IOR_Parser.h"
25 #if (TAO_HAS_MCAST_PARSER == 1)
27 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
29 /**
30 * @class TAO_MCAST_Parser
32 * @brief Implements the @c mcast: IOR format
34 * This class implements the @c mcast: IOR format.
35 * It is dynamically loaded by the ORB and used to parse the
36 * string to separate the individual <obj_addr> from the list of object
37 * addresses <obj_addr_list>.
39 class TAO_Export TAO_MCAST_Parser : public TAO_IOR_Parser
41 public:
42 /// Constructor
43 TAO_MCAST_Parser ();
45 /// The destructor
46 virtual ~TAO_MCAST_Parser ();
48 /// = The IOR_Parser methods, please read the documentation in
49 /// IOR_Parser.h
50 virtual bool match_prefix (const char *ior_string) const;
52 /// Parse the ior-string that is passed.
53 virtual CORBA::Object_ptr parse_string (const char *ior,
54 CORBA::ORB_ptr orb);
56 private:
57 CORBA::Object_ptr multicast_to_service (const char *service_name,
58 unsigned short port,
59 const char *mcast_address,
60 int mcast_ttl,
61 const char *mcast_nic,
62 CORBA::ORB_ptr orb,
63 ACE_Time_Value *timeout);
65 int multicast_query (char *&buf,
66 const char *service_name,
67 unsigned short port,
68 const char *mcast_address,
69 int mcast_ttl,
70 const char *mcast_nic,
71 ACE_Time_Value *timeout,
72 CORBA::ORB_ptr orb);
74 /* Simple method to assign values to the global members:
75 mcast_address_, mcast_port_, mcast_nic_, mcast_ttl_ */
76 void assign_to_variables (char const * mcast_name_ptr);
78 private:
79 CORBA::String_var mcast_address_;
81 /// Default multicast port (currently Name Service mcast port).
82 unsigned short mcast_port_;
84 /// Multicast network interface card.
85 CORBA::String_var mcast_nic_;
87 /// Default time-to-live (default is 1).
88 int mcast_ttl_;
90 /// Multicast service name
91 CORBA::String_var service_name_;
94 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_MCAST_Parser)
95 ACE_FACTORY_DECLARE (TAO, TAO_MCAST_Parser)
97 TAO_END_VERSIONED_NAMESPACE_DECL
99 #if defined (__ACE_INLINE__)
100 # include "tao/MCAST_Parser.inl"
101 #endif /* __ACE_INLINE__ */
103 #endif /* TAO_HAS_MCAST_PARSER == 1 */
105 #include /**/ "ace/post.h"
106 #endif /* TAO_MCAST_PARSER_H */