Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / Strategies / UIOP_Profile.h
blob6bd8fdea1231c28fd6e6ebf94f8e5ce4eecf6989
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file UIOP_Profile.h
7 * Unix Domain Socket (UIOP) profile specific processing
9 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
10 * @author Fred Kuhns <fredk@cs.wustl.edu>
12 //=============================================================================
15 #ifndef TAO_UIOP_PROFILE_H
16 #define TAO_UIOP_PROFILE_H
18 #include /**/ "ace/pre.h"
20 #include "tao/orbconf.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 # pragma once
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 # if TAO_HAS_UIOP == 1
28 #include "tao/Strategies/strategies_export.h"
29 #include "tao/Profile.h"
30 #include "tao/Strategies/UIOP_Connection_Handler.h"
31 #include "tao/Strategies/UIOP_Endpoint.h"
33 #include "ace/UNIX_Addr.h"
35 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
37 /**
38 * @class TAO_UIOP_Profile
40 * @brief This class defines the protocol specific attributes required
41 * for locating ORBs over local IPC.
43 * This class defines the UIOP profile.
45 class TAO_Strategies_Export TAO_UIOP_Profile : public TAO_Profile
47 public:
48 /// The object key delimiter that UIOP uses or expects.
49 static const char object_key_delimiter_;
50 virtual char object_key_delimiter () const;
52 /// Return the char string prefix.
53 static const char *prefix ();
55 /// Profile constructor, same as above except the object_key has
56 /// already been marshaled. (actually, no marshalling for this protocol)
57 TAO_UIOP_Profile (const ACE_UNIX_Addr &addr,
58 const TAO::ObjectKey &object_key,
59 const TAO_GIOP_Message_Version &version,
60 TAO_ORB_Core *orb_core);
62 /// Profile constructor
63 TAO_UIOP_Profile (const char *rendezvous_point,
64 const TAO::ObjectKey &object_key,
65 const ACE_UNIX_Addr &addr,
66 const TAO_GIOP_Message_Version &version,
67 TAO_ORB_Core *orb_core);
69 /// Profile constructor, default.
70 TAO_UIOP_Profile (TAO_ORB_Core *orb_core);
72 /// Destructor is to be called only through <_decr_refcnt>.
73 ~TAO_UIOP_Profile ();
75 /// Template methods. Please see Profile.h for documentation.
76 virtual char *to_string () const;
77 virtual int encode_endpoints ();
78 virtual TAO_Endpoint *endpoint ();
79 virtual CORBA::ULong endpoint_count () const;
80 virtual CORBA::ULong hash (CORBA::ULong max);
81 /**
82 * Add @a endp to this profile's list of endpoints (it is inserted
83 * next to the head of the list). This profiles takes ownership of
84 * @a endp.
86 void add_endpoint (TAO_UIOP_Endpoint *endp);
88 protected:
89 /// Protected template methods. Please see documentation in
90 /// Profile.h for details.
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 private:
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 a la TAG_ALTERNATE_IIOP_ADDRESS
107 * feature.
108 * Addressing info of the default endpoint, i.e., head of the list,
109 * is transmitted using standard UIOP ProfileBody components. See
110 * <encode_endpoints> method documentation above for how the rest of
111 * the endpoint list is transmitted.
113 TAO_UIOP_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_UIOP == 1 */
123 #include /**/ "ace/post.h"
125 #endif /* TAO_UIOP_PROFILE_H */