Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Strategies / DIOP_Profile.h
bloba5cea7758f5802a2c9cb695051d5ddb7de801855
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file DIOP_Profile.h
7 * DIOP profile specific processing
9 * @author Michael Kircher
11 //=============================================================================
14 #ifndef TAO_DIOP_PROFILE_H
15 #define TAO_DIOP_PROFILE_H
17 #include /**/ "ace/pre.h"
19 #include "tao/orbconf.h"
21 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 # pragma once
23 #endif /* ACE_LACKS_PRAGMA_ONCE */
25 #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0)
27 #include "tao/Strategies/DIOP_Endpoint.h"
28 #include "tao/Profile.h"
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 // TAO DIOP_Profile concrete Profile definitions
33 /**
34 * @class TAO_DIOP_Profile
36 * @brief This class defines the protocol specific attributes required
37 * for locating ORBs over a TCP/IP network.
39 * This class defines the DIOP profile as specified in the CORBA
40 * specification.
42 class TAO_Strategies_Export TAO_DIOP_Profile : public TAO_Profile
44 public:
45 /// The object key delimiter that DIOP uses or expects.
46 static const char object_key_delimiter_;
47 virtual char object_key_delimiter () const;
49 /// Return the char string prefix.
50 static const char *prefix ();
52 /// Profile constructor, same as above except the object_key has
53 /// already been marshaled.
54 TAO_DIOP_Profile (const ACE_INET_Addr &addr,
55 const TAO::ObjectKey &object_key,
56 const TAO_GIOP_Message_Version &version,
57 TAO_ORB_Core *orb_core);
59 /// Profile constructor, this is the most efficient since it
60 /// doesn't require any address resolution processing.
61 TAO_DIOP_Profile (const char *host,
62 CORBA::UShort port,
63 const TAO::ObjectKey &object_key,
64 const ACE_INET_Addr &addr,
65 const TAO_GIOP_Message_Version &version,
66 TAO_ORB_Core *orb_core);
69 /// Profile constructor, default.
70 TAO_DIOP_Profile (TAO_ORB_Core *orb_core);
72 /// Destructor is to be called only through <_decr_refcnt>.
73 ~TAO_DIOP_Profile ();
76 /// Template methods. Please tao/Profile.h for documentation.
77 virtual char * to_string () const;
78 virtual int encode_endpoints ();
79 virtual TAO_Endpoint *endpoint ();
80 virtual CORBA::ULong endpoint_count () const;
81 virtual CORBA::ULong hash (CORBA::ULong max);
82 /**
83 * Add <endp> to this profile's list of endpoints (it is inserted
84 * next to the head of the list). This profiles takes ownership of
85 * <endp>.
87 void add_endpoint (TAO_DIOP_Endpoint *endp);
89 protected:
90 /// Template methods. Please see tao/Profile.h for documentation.
91 virtual int decode_profile (TAO_InputCDR& cdr);
92 virtual void parse_string_i (const char *string);
93 virtual void create_profile_body (TAO_OutputCDR &cdr) const;
94 virtual int decode_endpoints ();
95 virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile);
97 protected:
98 /**
99 * Head of this profile's list of endpoints. This endpoint is not
100 * dynamically allocated because a profile always contains at least
101 * one endpoint.
103 * Currently, a profile contains more than one endpoint, i.e.,
104 * list contains more than just the head, only when RTCORBA is enabled.
105 * However, in the near future, this will be used in nonRT
106 * mode as well, e.g., to support TAG_ALTERNATE_DIOP_ADDRESS
107 * feature.
108 * Addressing info of the default endpoint, i.e., head of the list,
109 * is transmitted using standard DIOP ProfileBody components. See
110 * <encode_endpoints> method documentation above for how the rest of
111 * the endpoint list is transmitted.
113 TAO_DIOP_Endpoint endpoint_;
115 /// Number of endpoints in the list headed by <endpoint_>.
116 CORBA::ULong count_;
119 TAO_END_VERSIONED_NAMESPACE_DECL
121 #endif /* TAO_HAS_DIOP && TAO_HAS_DIOP != 0 */
123 #include /**/ "ace/post.h"
125 #endif /* TAO_DIOP_PROFILE_H */