Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Strategies / SHMIOP_Profile.h
blob344f7f4a43ec542122ef83ab6564aa9efba0e029
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file SHMIOP_Profile.h
7 * SHMIOP profile specific processing
9 * @author Nanbor Wang <nanbor@cs.wustl.edu>
11 //=============================================================================
14 #ifndef TAO_SHMIOP_PROFILE_H
15 #define TAO_SHMIOP_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_SHMIOP) && (TAO_HAS_SHMIOP != 0)
27 #include "tao/Strategies/strategies_export.h"
28 #include "tao/Profile.h"
29 #include "tao/Strategies/SHMIOP_Endpoint.h"
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 // TAO SHMIOP_Profile concrete Profile definitions
34 /**
35 * @class TAO_SHMIOP_Profile
37 * @brief This class defines the protocol specific attributes required
38 * for locating local ORBs over local IPC mechanism to use the
39 * shared memory transport.
41 * This class defines the SHMIOP profile.
43 class TAO_Strategies_Export TAO_SHMIOP_Profile : public TAO_Profile
45 public:
46 /// The object key delimiter that SHMIOP uses or expects.
47 static const char object_key_delimiter_;
48 virtual char object_key_delimiter () const;
50 /// Return the char string prefix.
51 static const char *prefix ();
53 /// Profile constructor, same as above except the object_key has
54 /// already been marshaled.
55 TAO_SHMIOP_Profile (const ACE_MEM_Addr &addr,
56 const TAO::ObjectKey &object_key,
57 const TAO_GIOP_Message_Version &version,
58 TAO_ORB_Core *orb_core);
60 /// Profile constructor, this is the most efficient since it
61 /// doesn't require any address resolution processing.
62 TAO_SHMIOP_Profile (const char *host,
63 CORBA::UShort port,
64 const TAO::ObjectKey &object_key,
65 const ACE_INET_Addr &addr,
66 const TAO_GIOP_Message_Version &version,
67 TAO_ORB_Core *orb_core);
69 /// Profile constructor, default.
70 TAO_SHMIOP_Profile (TAO_ORB_Core *orb_core);
72 /// Destructor is to be called only through <_decr_refcnt>.
73 ~TAO_SHMIOP_Profile ();
76 /// Template methods, please see 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_SHMIOP_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 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 TAG_ALTERNATE_IIOP_ADDRESS-style
107 * feature.
108 * Addressing info of the default endpoint, i.e., head of the list,
109 * is transmitted using standard SHMIOP ProfileBody components. See
110 * <encode_endpoints> method documentation above for how the rest of
111 * the endpoint list is transmitted.
113 TAO_SHMIOP_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_SHMIOP && TAO_HAS_SHMIOP != 0 */
123 #include /**/ "ace/post.h"
125 #endif /* TAO_SHMIOP_PROFILE_H */