Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Strategies / COIOP_Profile.h
blobadda3ea186cbe7e84b25b70feb1e39a71c15416a
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file COIOP_Profile.h
7 * COIOP profile specific processing
9 * @author Johnny Willemsen <jwillemsen@remedy.nl>
11 //=============================================================================
14 #ifndef TAO_COIOP_PROFILE_H
15 #define TAO_COIOP_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_COIOP) && (TAO_HAS_COIOP != 0)
27 #include "tao/Strategies/COIOP_Endpoint.h"
28 #include "tao/Profile.h"
30 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 // TAO COIOP_Profile concrete Profile definitions
33 /**
34 * @class TAO_COIOP_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 COIOP profile as specified in the CORBA
40 * specification.
42 class TAO_Strategies_Export TAO_COIOP_Profile : public TAO_Profile
44 public:
45 /// The object key delimiter that COIOP 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, this is the most efficient since it
53 /// doesn't require any address resolution processing.
54 TAO_COIOP_Profile (const ACE_Utils::UUID& uuid,
55 const TAO::ObjectKey &object_key,
56 const TAO_GIOP_Message_Version &version,
57 TAO_ORB_Core *orb_core);
59 /// Profile constructor, default.
60 TAO_COIOP_Profile (TAO_ORB_Core *orb_core);
62 /// Destructor is to be called only through <_decr_refcnt>.
63 ~TAO_COIOP_Profile ();
65 /// Template methods. Please tao/Profile.h for documentation.
66 virtual char * to_string () const;
67 virtual int encode_endpoints ();
68 virtual TAO_Endpoint *endpoint ();
69 virtual CORBA::ULong endpoint_count () const;
70 virtual CORBA::ULong hash (CORBA::ULong max);
71 /**
72 * Add <endp> to this profile's list of endpoints (it is inserted
73 * next to the head of the list). This profiles takes ownership of
74 * <endp>.
76 void add_endpoint (TAO_COIOP_Endpoint *endp);
78 protected:
79 /// Template methods. Please see tao/Profile.h for documentation.
80 virtual int decode_profile (TAO_InputCDR& cdr);
81 virtual void parse_string_i (const char *string);
82 virtual void create_profile_body (TAO_OutputCDR &cdr) const;
83 virtual int decode_endpoints ();
84 virtual CORBA::Boolean do_is_equivalent (const TAO_Profile *other_profile);
86 protected:
87 /**
88 * Head of this profile's list of endpoints. This endpoint is not
89 * dynamically allocated because a profile always contains at least
90 * one endpoint.
92 * Currently, a profile contains more than one endpoint, i.e.,
93 * list contains more than just the head, only when RTCORBA is enabled.
94 * However, in the near future, this will be used in nonRT
95 * mode as well, e.g., to support TAG_ALTERNATE_COIOP_ADDRESS
96 * feature.
97 * Addressing info of the default endpoint, i.e., head of the list,
98 * is transmitted using standard COIOP ProfileBody components. See
99 * <encode_endpoints> method documentation above for how the rest of
100 * the endpoint list is transmitted.
102 TAO_COIOP_Endpoint endpoint_;
104 /// Number of endpoints in the list headed by <endpoint_>.
105 CORBA::ULong count_;
108 TAO_END_VERSIONED_NAMESPACE_DECL
110 #endif /* TAO_HAS_COIOP && TAO_HAS_COIOP != 0 */
112 #include /**/ "ace/post.h"
114 #endif /* TAO_COIOP_PROFILE_H */