summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2001-04-10 01:19:15 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2001-04-10 01:19:15 +0000
commit2e7b7b4b49d210a22ce1b8863c7e379015ad0d00 (patch)
tree13e7c59e70af3a2cb2850d7c95c5f00aa7788630 /TAO/tao
parentdfb83e47853891acb8fc367b2ec9886a09cc7d92 (diff)
downloadATCD-2e7b7b4b49d210a22ce1b8863c7e379015ad0d00.tar.gz
ChangeLogTag:Mon Apr 9 18:17:14 2001 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/IIOP_Connector.cpp26
-rw-r--r--TAO/tao/IIOP_Connector.h10
-rw-r--r--TAO/tao/IIOP_Profile.cpp125
-rw-r--r--TAO/tao/IIOP_Profile.h17
-rw-r--r--TAO/tao/Pluggable.cpp13
-rw-r--r--TAO/tao/Pluggable.h5
-rw-r--r--TAO/tao/Profile.cpp3
-rw-r--r--TAO/tao/Profile.h8
-rw-r--r--TAO/tao/Strategies/SHMIOP_Connector.cpp30
-rw-r--r--TAO/tao/Strategies/SHMIOP_Connector.h67
-rw-r--r--TAO/tao/Strategies/SHMIOP_Profile.cpp84
-rw-r--r--TAO/tao/Strategies/SHMIOP_Profile.h200
-rw-r--r--TAO/tao/Strategies/UIOP_Connector.cpp20
-rw-r--r--TAO/tao/Strategies/UIOP_Connector.h77
-rw-r--r--TAO/tao/Strategies/UIOP_Profile.cpp70
-rw-r--r--TAO/tao/Strategies/UIOP_Profile.h203
16 files changed, 460 insertions, 498 deletions
diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp
index ff538f1ce16..f4cc6e7ef28 100644
--- a/TAO/tao/IIOP_Connector.cpp
+++ b/TAO/tao/IIOP_Connector.cpp
@@ -14,7 +14,9 @@
#include "tao/Protocols_Hooks.h"
#include "ace/Strategies_T.h"
-ACE_RCSID(tao, IIOP_Connector, "$Id$")
+ACE_RCSID (TAO,
+ IIOP_Connector,
+ "$Id$")
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
@@ -420,23 +422,25 @@ TAO_IIOP_Connector::create_profile (TAO_InputCDR& cdr)
return pfile;
}
-void
-TAO_IIOP_Connector::make_profile (const char *endpoint,
- TAO_Profile *&profile,
- CORBA::Environment &ACE_TRY_ENV)
+TAO_Profile *
+TAO_IIOP_Connector::make_profile (CORBA::Environment &ACE_TRY_ENV)
{
// The endpoint should be of the form:
// N.n@host:port/object_key
// or:
// host:port/object_key
+ TAO_Profile *profile = 0;
ACE_NEW_THROW_EX (profile,
- TAO_IIOP_Profile (endpoint,
- this->orb_core (),
- ACE_TRY_ENV),
- CORBA::NO_MEMORY ());
-
- ACE_CHECK;
+ TAO_IIOP_Profile (this->orb_core ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return profile;
}
int
diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h
index a0610b56c9e..497998586a2 100644
--- a/TAO/tao/IIOP_Connector.h
+++ b/TAO/tao/IIOP_Connector.h
@@ -10,6 +10,7 @@
*
*
* @author Fred Kuhns <fredk@cs.wustl.edu>
+ * @author Ossama Othman <ossama@uci.edu>
* @author Balachandran Natarajan <bala@cs.wustl.edu>
*/
//=============================================================================
@@ -68,17 +69,14 @@ public:
protected:
- /// = More TAO_Connector methods, please check the documentation on
- /// Pluggable.h
- virtual void make_profile (const char *endpoint,
- TAO_Profile *&,
- CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ());
+ /// More TAO_Connector methods, please check the documentation on
+ /// Pluggable.h
+ virtual TAO_Profile *make_profile (CORBA::Environment &ACE_TRY_ENV);
/// Obtain tcp properties that must be used by this connector, i.e.,
/// initialize <tcp_properties_>.
int init_tcp_properties (void);
-
public:
typedef TAO_Connect_Concurrency_Strategy<TAO_IIOP_Connection_Handler>
diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp
index 4c877192c0e..292989cd2fc 100644
--- a/TAO/tao/IIOP_Profile.cpp
+++ b/TAO/tao/IIOP_Profile.cpp
@@ -2,18 +2,20 @@
// $Id$
-#include "tao/IIOP_Profile.h"
-#include "tao/CDR.h"
-#include "tao/Environment.h"
-#include "tao/ORB.h"
-#include "tao/ORB_Core.h"
-#include "tao/debug.h"
-#include "tao/iiop_endpoints.h"
-
-ACE_RCSID(tao, IIOP_Profile, "$Id$")
+#include "IIOP_Profile.h"
+#include "CDR.h"
+#include "Environment.h"
+#include "ORB.h"
+#include "ORB_Core.h"
+#include "debug.h"
+#include "iiop_endpoints.h"
+
+ACE_RCSID(TAO,
+ IIOP_Profile,
+ "$Id$")
#if !defined (__ACE_INLINE__)
-# include "tao/IIOP_Profile.i"
+# include "IIOP_Profile.i"
#endif /* __ACE_INLINE__ */
static const char prefix_[] = "iiop";
@@ -55,21 +57,6 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char* host,
{
}
-TAO_IIOP_Profile::TAO_IIOP_Profile (const char *string,
- TAO_ORB_Core *orb_core,
- CORBA::Environment &ACE_TRY_ENV)
- : TAO_Profile (TAO_TAG_IIOP_PROFILE,
- orb_core,
- TAO_GIOP_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
- endpoint_ (),
- count_ (1),
- object_key_ (),
- tagged_profile_ ()
-{
- this->parse_string (string, ACE_TRY_ENV);
- ACE_CHECK;
-}
-
TAO_IIOP_Profile::TAO_IIOP_Profile (TAO_ORB_Core *orb_core)
: TAO_Profile (TAO_TAG_IIOP_PROFILE,
orb_core,
@@ -179,18 +166,17 @@ TAO_IIOP_Profile::decode (TAO_InputCDR& cdr)
return -1;
}
-int
+void
TAO_IIOP_Profile::parse_string (const char *string,
CORBA::Environment &ACE_TRY_ENV)
{
if (!string || !*string)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// Remove the "N.n@" version prefix, if it exists, and verify the
@@ -213,12 +199,11 @@ TAO_IIOP_Profile::parse_string (const char *string,
if (this->version_.major != TAO_DEF_GIOP_MAJOR ||
this->version_.minor > TAO_DEF_GIOP_MINOR)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// Pull off the "hostname:port/" part of the objref
@@ -233,12 +218,11 @@ TAO_IIOP_Profile::parse_string (const char *string,
if (okd == 0)
{
// No object key delimiter!
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// The default port number.
@@ -307,7 +291,8 @@ TAO_IIOP_Profile::parse_string (const char *string,
{
char tmp_host [MAXHOSTNAMELEN + 1];
- // If no host is specified: assign the default host : the local host.
+ // If no host is specified: assign the default host, i.e. the
+ // local host.
if (host_addr.get_host_name (tmp_host,
sizeof (tmp_host)) != 0)
{
@@ -320,8 +305,15 @@ TAO_IIOP_Profile::parse_string (const char *string,
ACE_TEXT ("IIOP_Profile::parse_string ")
ACE_TEXT ("- %p\n\n"),
ACE_TEXT ("cannot determine hostname")));
- return -1;
+
+ // @@ What's the right exception to throw here?
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
+
this->endpoint_.host_ = tmp;
}
else
@@ -341,14 +333,18 @@ TAO_IIOP_Profile::parse_string (const char *string,
ACE_TEXT ("TAO (%P|%t) IIOP_Profile::parse_string - \n")
ACE_TEXT ("TAO (%P|%t) ACE_INET_Addr::set () failed")));
}
- return -1;
+
+ // @@ What's the right exception to throw here?
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
start = ++okd; // increment past the object key separator
TAO_ObjectKey::decode_string_to_sequence (this->object_key_, start);
-
- return 1;
}
CORBA::Boolean
@@ -431,12 +427,12 @@ TAO_IIOP_Profile::add_endpoint (TAO_IIOP_Endpoint *endp)
char *
TAO_IIOP_Profile::to_string (CORBA::Environment &)
{
- CORBA::String_var key;
- TAO_ObjectKey::encode_sequence_to_string (key.inout(),
- this->object_key_);
+ // CORBA::String_var key;
+ // TAO_ObjectKey::encode_sequence_to_string (key.inout(),
+ // this->object_key_);
u_int buflen = (ACE_OS::strlen (::prefix_) +
- 3 /* "loc" */ +
+// 3 /* "loc" */ +
1 /* colon separator */ +
2 /* double-slash separator */ +
1 /* major version */ +
@@ -445,26 +441,29 @@ TAO_IIOP_Profile::to_string (CORBA::Environment &)
1 /* `@' character */ +
ACE_OS::strlen (this->endpoint_.host ()) +
1 /* colon separator */ +
- 5 /* port number */ +
- 1 /* object key separator */ +
- ACE_OS::strlen (key.in ()));
+ 5 /* port number */);
+// 1 /* object key separator */ +
+// ACE_OS::strlen (key.in ()));
- char * buf = CORBA::string_alloc (buflen);
+ CORBA::String_var buf = CORBA::string_alloc (buflen);
static const char digits [] = "0123456789";
- ACE_OS::sprintf (buf,
- "%sloc://%c.%c@%s:%d%c%s",
+ ACE_OS::sprintf (buf.inout (),
+ "%s://%c.%c@%s:%d",
::prefix_,
digits [this->version_.major],
digits [this->version_.minor],
this->endpoint_.host (),
- this->endpoint_.port (),
- this->object_key_delimiter_,
- key.in ());
- return buf;
+ this->endpoint_.port ());
+// this->object_key_delimiter_,
+// key.in ());
+
+ return buf._retn ();
}
+
+
const char *
TAO_IIOP_Profile::prefix (void)
{
diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h
index 4dbb7d44cb9..9f9d5b12ff2 100644
--- a/TAO/tao/IIOP_Profile.h
+++ b/TAO/tao/IIOP_Profile.h
@@ -66,12 +66,6 @@ public:
const TAO_GIOP_Version &version,
TAO_ORB_Core *orb_core);
- /// Create object using a string ior.
- TAO_IIOP_Profile (const char *string,
- TAO_ORB_Core *orb_core,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
-
/// Profile constructor, default.
TAO_IIOP_Profile (TAO_ORB_Core *orb_core);
@@ -80,9 +74,8 @@ public:
/// Initialize this object using the given input string.
/// Url-style string contain only one endpoint.
- virtual int parse_string (const char *string,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
+ virtual void parse_string (const char *string,
+ CORBA::Environment &ACE_TRY_ENV);
/**
* Return a string representation for this profile.
@@ -90,8 +83,7 @@ public:
* This is used to create url-style reference. Only one
* endpoint is included into the string.
*/
- virtual char * to_string (CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
+ virtual char * to_string (CORBA::Environment &ACE_TRY_ENV);
/// Initialize this object using the given CDR octet string.
virtual int decode (TAO_InputCDR& cdr);
@@ -148,8 +140,7 @@ public:
/// Return a hash value for this object.
virtual CORBA::ULong hash (CORBA::ULong max,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
+ CORBA::Environment &ACE_TRY_ENV);
/// Please refer to Profile.h for the documentation of this
/// function.
diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp
index 8b9b64e7fe5..36b84e84057 100644
--- a/TAO/tao/Pluggable.cpp
+++ b/TAO/tao/Pluggable.cpp
@@ -167,16 +167,15 @@ TAO_Connector::make_mprofile (const char *string,
// or
// `endpoint/object_key'
- TAO_Profile *profile = 0;
- // Must initialize since pointer is passed as a reference!
-
- this->make_profile (endpoint.c_str (),
- profile,
- ACE_TRY_ENV);
+ TAO_Profile *profile = this->make_profile (ACE_TRY_ENV);
ACE_CHECK_RETURN (-1);
// Failure: Problem during profile creation
- // Create a Profile using the individual endpoint string
+ // Initialize a Profile using the individual endpoint
+ // string.
+ // @@ Not exception safe! We need a TAO_Profile_var!
+ profile->parse_string (endpoint.c_str (), ACE_TRY_ENV);
+ ACE_CHECK_RETURN (-1);
// Give up ownership of the profile.
if (mprofile.give_profile (profile) == -1)
diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h
index 29ebfa4d3d9..36cc560f3a1 100644
--- a/TAO/tao/Pluggable.h
+++ b/TAO/tao/Pluggable.h
@@ -193,10 +193,9 @@ public:
virtual char object_key_delimiter (void) const = 0;
protected:
+
/// Create a profile with a given endpoint.
- virtual void make_profile (const char *endpoint,
- TAO_Profile *&,
- CORBA::Environment &ACE_TRY_ENV) = 0;
+ virtual TAO_Profile *make_profile (CORBA::Environment &ACE_TRY_ENV) = 0;
/// Set the ORB Core pointer
void orb_core (TAO_ORB_Core *orb_core);
diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp
index 0946ee60593..8df902622a0 100644
--- a/TAO/tao/Profile.cpp
+++ b/TAO/tao/Profile.cpp
@@ -331,12 +331,11 @@ TAO_Unknown_Profile::endpoint_count (void)
return 0;
}
-int
+void
TAO_Unknown_Profile::parse_string (const char *,
CORBA::Environment &)
{
// @@ THROW something????
- return -1;
}
char
diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h
index 85e8cdab4a9..6a06069240d 100644
--- a/TAO/tao/Profile.h
+++ b/TAO/tao/Profile.h
@@ -87,8 +87,8 @@ public:
/// Initialize this object using the given input string.
/// Supports URL style of object references
- virtual int parse_string (const char *string,
- CORBA::Environment &ACE_TRY_ENV) = 0;
+ virtual void parse_string (const char *string,
+ CORBA::Environment &ACE_TRY_ENV) = 0;
/// Return a string representation for this profile. client must
/// deallocate memory.
@@ -242,8 +242,8 @@ public:
TAO_ORB_Core *orb_core);
// = The TAO_Profile methods look above
- virtual int parse_string (const char *string,
- CORBA::Environment &ACE_TRY_ENV);
+ virtual void parse_string (const char *string,
+ CORBA::Environment &ACE_TRY_ENV);
virtual char object_key_delimiter (void) const;
virtual char* to_string (CORBA::Environment &ACE_TRY_ENV);
virtual int decode (TAO_InputCDR& cdr);
diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp
index 4644ff6c698..3ea9b90662a 100644
--- a/TAO/tao/Strategies/SHMIOP_Connector.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp
@@ -14,7 +14,9 @@
#include "tao/Environment.h"
#include "ace/Auto_Ptr.h"
-ACE_RCSID(Strategies, SHMIOP_Connector, "$Id$")
+ACE_RCSID (Strategies,
+ SHMIOP_Connector,
+ "$Id$")
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
@@ -410,23 +412,25 @@ TAO_SHMIOP_Connector::create_profile (TAO_InputCDR& cdr)
return pfile;
}
-void
-TAO_SHMIOP_Connector::make_profile (const char *endpoint,
- TAO_Profile *&profile,
- CORBA::Environment &ACE_TRY_ENV)
+TAO_Profile *
+TAO_SHMIOP_Connector::make_profile (CORBA::Environment &ACE_TRY_ENV)
{
// The endpoint should be of the form:
- // N.n@host:port/object_key
+ // N.n@port/object_key
// or:
- // host:port/object_key
+ // port/object_key
+ TAO_Profile *profile = 0;
ACE_NEW_THROW_EX (profile,
- TAO_SHMIOP_Profile (endpoint,
- this->orb_core (),
- ACE_TRY_ENV),
- CORBA::NO_MEMORY ());
-
- ACE_CHECK;
+ TAO_SHMIOP_Profile (this->orb_core ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return profile;
}
int
diff --git a/TAO/tao/Strategies/SHMIOP_Connector.h b/TAO/tao/Strategies/SHMIOP_Connector.h
index aa17509df72..02fc0fd8238 100644
--- a/TAO/tao/Strategies/SHMIOP_Connector.h
+++ b/TAO/tao/Strategies/SHMIOP_Connector.h
@@ -1,21 +1,18 @@
-// This may look like C, but it's really -*- C++ -*-
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO
-//
-// = FILENAME
-// SHMIOP_Connector.h
-//
-// = DESCRIPTION
-// IIOP specific connector processing
-//
-// = AUTHOR
-// Nanbor Wang <nanbor@cs.wustl.edu>
-//
-// ============================================================================
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file SHMIOP_Connector.h
+ *
+ * $Id$
+ *
+ * SHMIOP specific connector processing
+ *
+ *
+ * @author Nanbor Wang <nanbor@cs.wustl.edu>
+ */
+//=============================================================================
+
#ifndef TAO_SHMIOP_CONNECTOR_H
#define TAO_SHMIOP_CONNECTOR_H
@@ -38,23 +35,24 @@
// ****************************************************************
+/**
+ * @class TAO_SHMIOP_Connector
+ *
+ * @brief SHMIOP-specific Connector bridge for pluggable protocols.
+ *
+ * Concrete instance of the TAO_Connector class. Responsible
+ * for establishing a connection with a server and is called from the
+ * Connector_Registory.
+ */
class TAO_Strategies_Export TAO_SHMIOP_Connector : public TAO_Connector
{
- // = TITLE
- // SHMIOP-specific Connector bridge for pluggable protocols.
- //
- // = DESCRIPTION
- // Concrete instance of the TAO_Connector class. Responsible
- // for establishing a connection with a server and is called from the
- // Connector_Registory.
- //
public:
// = Initialization and termination methods.
+ /// Constructor.
TAO_SHMIOP_Connector (CORBA::Boolean flag = 0);
- // Constructor.
+ /// Default destructor
~TAO_SHMIOP_Connector (void);
- // Default destructor
// = The TAO_Connector methods, please check the documentation on
// Pluggable.h
@@ -72,11 +70,10 @@ public:
virtual char object_key_delimiter (void) const;
protected:
+
// = More TAO_Connector methods, please check the documentation on
// Pluggable.h
- virtual void make_profile (const char *endpoint,
- TAO_Profile *&,
- CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ());
+ virtual TAO_Profile *make_profile (CORBA::Environment &ACE_TRY_ENV);
public:
@@ -95,17 +92,17 @@ public:
TAO_SHMIOP_BASE_CONNECTOR;
private:
+ /// local address
ACE_MEM_Addr address_;
- // local address
+ /// Our connect strategy
TAO_SHMIOP_CONNECT_STRATEGY connect_strategy_;
- // Our connect strategy
+ /// The connector initiating connection requests for SHMIOP.
TAO_SHMIOP_BASE_CONNECTOR base_connector_;
- // The connector initiating connection requests for SHMIOP.
+ /// Are we using GIOP lite??
CORBA::Boolean lite_flag_;
- // Are we using GIOP lite??
};
#endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */
diff --git a/TAO/tao/Strategies/SHMIOP_Profile.cpp b/TAO/tao/Strategies/SHMIOP_Profile.cpp
index da1ed173acd..39456b5817e 100644
--- a/TAO/tao/Strategies/SHMIOP_Profile.cpp
+++ b/TAO/tao/Strategies/SHMIOP_Profile.cpp
@@ -12,7 +12,9 @@
#include "tao/debug.h"
#include "tao/iiop_endpoints.h"
-ACE_RCSID(Strategies, SHMIOP_Profile, "$Id$")
+ACE_RCSID (Strategies,
+ SHMIOP_Profile,
+ "$Id$")
#if !defined (__ACE_INLINE__)
# include "SHMIOP_Profile.i"
@@ -55,21 +57,6 @@ TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const char* host,
{
}
-TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const char *string,
- TAO_ORB_Core *orb_core,
- CORBA::Environment &ACE_TRY_ENV)
- : TAO_Profile (TAO_TAG_SHMEM_PROFILE,
- orb_core,
- TAO_GIOP_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)),
- endpoint_ (),
- count_ (1),
- object_key_ (),
- tagged_profile_ ()
-{
- parse_string (string, ACE_TRY_ENV);
- ACE_CHECK;
-}
-
TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (TAO_ORB_Core *orb_core)
: TAO_Profile (TAO_TAG_SHMEM_PROFILE,
orb_core,
@@ -192,18 +179,17 @@ TAO_SHMIOP_Profile::decode (TAO_InputCDR& cdr)
return -1;
}
-int
+void
TAO_SHMIOP_Profile::parse_string (const char *string,
CORBA::Environment &ACE_TRY_ENV)
{
if (!string || !*string)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// Remove the "N.n@" version prefix, if it exists, and verify the
@@ -226,12 +212,11 @@ TAO_SHMIOP_Profile::parse_string (const char *string,
if (this->version_.major != TAO_DEF_GIOP_MAJOR ||
this->version_.minor > TAO_DEF_GIOP_MINOR)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// Pull off the "hostname:port/" part of the objref
@@ -244,12 +229,11 @@ TAO_SHMIOP_Profile::parse_string (const char *string,
if (cp == 0)
{
// No host/port delimiter!
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
char *okd = ACE_OS::strchr (start, this->object_key_delimiter_);
@@ -257,12 +241,11 @@ TAO_SHMIOP_Profile::parse_string (const char *string,
if (okd == 0)
{
// No object key delimiter!
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// Don't increment the pointer 'cp' directly since we still need
@@ -306,7 +289,13 @@ TAO_SHMIOP_Profile::parse_string (const char *string,
ACE_TEXT ("SHMIOP_Profile::parse_string ")
ACE_TEXT ("- %p\n\n"),
ACE_TEXT ("cannot determine hostname")));
- return -1;
+
+ // @@ What's the right exception to throw here?
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
else
this->endpoint_.host_ = tmp;
@@ -326,15 +315,18 @@ TAO_SHMIOP_Profile::parse_string (const char *string,
ACE_TEXT ("TAO (%P|%t) SHMIOP_Profile::parse_string () - \n")
ACE_TEXT ("TAO (%P|%t) ACE_INET_Addr::set () failed")));
}
- return -1;
+ // @@ What's the right exception to throw here?
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
start = ++okd; // increment past the object key separator
TAO_ObjectKey::decode_string_to_sequence (this->object_key_, start);
-
- return 1;
}
CORBA::Boolean
@@ -427,7 +419,7 @@ TAO_SHMIOP_Profile::to_string (CORBA::Environment &)
static const char digits [] = "0123456789";
ACE_OS::sprintf (buf,
- "%sloc://%c.%c@%s:%d%c%s",
+ "corbaloc:%s://%c.%c@%s:%d%c%s",
::prefix_,
digits [this->version_.major],
digits [this->version_.minor],
diff --git a/TAO/tao/Strategies/SHMIOP_Profile.h b/TAO/tao/Strategies/SHMIOP_Profile.h
index 6f196c8efd2..4d8cc0ec3b9 100644
--- a/TAO/tao/Strategies/SHMIOP_Profile.h
+++ b/TAO/tao/Strategies/SHMIOP_Profile.h
@@ -1,21 +1,18 @@
// This may look like C, but it's really -*- C++ -*-
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO
-//
-// = FILENAME
-// SHMIOP_Profile.h
-//
-// = DESCRIPTION
-// SHMIOP profile specific processing
-//
-// = AUTHOR
-// Nanbor Wang <nanbor@cs.wustl.edu>
-//
-// ============================================================================
+
+//=============================================================================
+/**
+ * @file SHMIOP_Profile.h
+ *
+ * $Id$
+ *
+ * SHMIOP profile specific processing
+ *
+ *
+ * @author Nanbor Wang <nanbor@cs.wustl.edu>
+ */
+//=============================================================================
+
#ifndef TAO_SHMIOP_PROFILE_H
#define TAO_SHMIOP_PROFILE_H
@@ -38,149 +35,154 @@
// TAO SHMIOP_Profile concrete Profile definitions
+/**
+ * @class TAO_SHMIOP_Profile
+ *
+ * @brief This class defines the protocol specific attributes required
+ * for locating local ORBs over local IPC mechanism to use the
+ * shared memory transport.
+ *
+ * This class defines the SHMIOP profile.
+ */
class TAO_Strategies_Export TAO_SHMIOP_Profile : public TAO_Profile
{
- // = TITLE
- // This class defines the protocol specific attributes required
- // for locating local ORBs over local IPC mechanism to use the
- // shared memory transport.
- // = DESCRIPTION
- // This class defines the SHMIOP profile.
public:
+ /// The object key delimiter that SHMIOP uses or expects.
static const char object_key_delimiter_;
virtual char object_key_delimiter (void) const;
- // The object key delimiter that SHMIOP uses or expects.
+ /// Return the char string prefix.
static const char *prefix (void);
- // Return the char string prefix.
+ /// Profile constructor, same as above except the object_key has
+ /// already been marshaled.
TAO_SHMIOP_Profile (const ACE_MEM_Addr &addr,
const TAO_ObjectKey &object_key,
const TAO_GIOP_Version &version,
TAO_ORB_Core *orb_core);
- // Profile constructor, same as above except the object_key has
- // already been marshaled.
+ /// Profile constructor, this is the most efficient since it
+ /// doesn't require any address resolution processing.
TAO_SHMIOP_Profile (const char *host,
CORBA::UShort port,
const TAO_ObjectKey &object_key,
const ACE_INET_Addr &addr,
const TAO_GIOP_Version &version,
TAO_ORB_Core *orb_core);
- // Profile constructor, this is the most efficient since it
- // doesn't require any address resolution processing.
-
- TAO_SHMIOP_Profile (const char *string,
- TAO_ORB_Core *orb_core,
- CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ());
- // Create object using a string ior.
+ /// Profile constructor, default.
TAO_SHMIOP_Profile (TAO_ORB_Core *orb_core);
- // Profile constructor, default.
+ /// Destructor is to be called only through <_decr_refcnt>.
~TAO_SHMIOP_Profile (void);
- // Destructor is to be called only through <_decr_refcnt>.
- int parse_string (const char *string,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
- // Initialize this object using the given input string.
+ /// Initialize this object using the given input string.
+ virtual void parse_string (const char *string,
+ CORBA::Environment &ACE_TRY_ENV);
- char * to_string (CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
- // Return a string representation for this profile.
- // client must deallocate memory.
+ /// Return a string representation for this profile.
+ /// client must deallocate memory.
+ char * to_string (CORBA::Environment &ACE_TRY_ENV);
+ /// Initialize this object using the given CDR octet string.
int decode (TAO_InputCDR& cdr);
- // Initialize this object using the given CDR octet string.
+ /// Encode this profile in a stream, i.e. marshal it.
virtual int encode (TAO_OutputCDR &stream) const;
- // Encode this profile in a stream, i.e. marshal it.
+ /**
+ * Encodes this profile's endpoints into a tagged component.
+ * This is done only if RTCORBA is enabled, since currently this is
+ * the only case when we have more than one endpoint per profile.
+ * Return 0 on success, -1 on failure.
+ *
+ * Endpoints are transmitted using TAO-proprietory tagged component.
+ * Component tag is TAO_TAG_ENDPOINTS and component data is an
+ * encapsulation of a sequence of structs, each representing a
+ * single endpoint. Data format is specified in iiop_endpoins.pidl.
+ *
+ * Multiple a la TAG_ALTERNATE_IIOP_ADDRESS components can be used
+ * instead of a single proprietory component to transmit multiple
+ * endpoints. This is somewhat slower and less convenient. Also,
+ * TAG_ALTERNATE_IIOP_ADDRESS does not provide for transmission of
+ * endpoint priorities.
+ *
+ */
virtual int encode_endpoints (void);
- // Encodes this profile's endpoints into a tagged component.
- // This is done only if RTCORBA is enabled, since currently this is
- // the only case when we have more than one endpoint per profile.
- // Return 0 on success, -1 on failure.
- //
- // Endpoints are transmitted using TAO-proprietory tagged component.
- // Component tag is TAO_TAG_ENDPOINTS and component data is an
- // encapsulation of a sequence of structs, each representing a
- // single endpoint. Data format is specified in iiop_endpoins.pidl.
- //
- // Multiple a la TAG_ALTERNATE_IIOP_ADDRESS components can be used
- // instead of a single proprietory component to transmit multiple
- // endpoints. This is somewhat slower and less convenient. Also,
- // TAG_ALTERNATE_IIOP_ADDRESS does not provide for transmission of
- // endpoint priorities.
- //
+ /// @@ deprecated. return a reference to the Object Key.
virtual const TAO_ObjectKey &object_key (void) const;
- // @@ deprecated. return a reference to the Object Key.
+ /// Return a pointer to the Object Key. The caller owns the memory
+ /// allocated for the returned key.
TAO_ObjectKey *_key (void) const;
- // Return a pointer to the Object Key. The caller owns the memory
- // allocated for the returned key.
+ /// Return pointer to the head of this profile's endpoints list.
virtual TAO_Endpoint *endpoint (void);
- // Return pointer to the head of this profile's endpoints list.
+ /// Return how many endpoints this profile contains.
virtual size_t endpoint_count (void);
- // Return how many endpoints this profile contains.
+ /**
+ * Add <endp> to this profile's list of endpoints (it is inserted
+ * next to the head of the list). This profiles takes ownership of
+ * <endp>.
+ */
void add_endpoint (TAO_SHMIOP_Endpoint *endp);
- // Add <endp> to this profile's list of endpoints (it is inserted
- // next to the head of the list). This profiles takes ownership of
- // <endp>.
+ /**
+ * Return true if this profile is equivalent to other_profile. Two
+ * profiles are equivalent iff their tag, object_key, version and
+ * all endpoints are the same.
+ */
CORBA::Boolean is_equivalent (const TAO_Profile *other_profile);
- // Return true if this profile is equivalent to other_profile. Two
- // profiles are equivalent iff their tag, object_key, version and
- // all endpoints are the same.
+ /// Return a hash value for this object.
CORBA::ULong hash (CORBA::ULong max,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
- // Return a hash value for this object.
+ CORBA::Environment &ACE_TRY_ENV);
+ /// Please refer to Profile.h for the documentation of this method
IOP::TaggedProfile &create_tagged_profile (void);
- // Please refer to Profile.h for the documentation of this method
private:
+ /// Create an encapsulation of the struct ProfileBody in <cdr>
void create_profile_body (TAO_OutputCDR &cdr) const;
- // Create an encapsulation of the struct ProfileBody in <cdr>
+ /**
+ * Helper for <decode>. Decodes endpoints from a tagged component.
+ * Decode only if RTCORBA is enabled. Furthermore, we may not find
+ * TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT
+ * version of TAO or some other ORB. This is not an error, and we
+ * must proceed. Return 0 on success and -1 on failure.
+ */
int decode_endpoints (void);
- // Helper for <decode>. Decodes endpoints from a tagged component.
- // Decode only if RTCORBA is enabled. Furthermore, we may not find
- // TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT
- // version of TAO or some other ORB. This is not an error, and we
- // must proceed. Return 0 on success and -1 on failure.
+ /**
+ * Head of this profile's list of endpoints. This endpoint is not
+ * dynamically allocated because a profile always contains at least
+ * one endpoint.
+ *
+ * Currently, a profile contains more than one endpoint, i.e.,
+ * list contains more than just the head, only when RTCORBA is enabled.
+ * However, in the near future, this will be used in nonRT
+ * mode as well, e.g., to support TAG_ALTERNATE_IIOP_ADDRESS-style
+ * feature.
+ * Addressing info of the default endpoint, i.e., head of the list,
+ * is transmitted using standard SHMIOP ProfileBody components. See
+ * <encode_endpoints> method documentation above for how the rest of
+ * the endpoint list is transmitted.
+ */
TAO_SHMIOP_Endpoint endpoint_;
- // Head of this profile's list of endpoints. This endpoint is not
- // dynamically allocated because a profile always contains at least
- // one endpoint.
- //
- // Currently, a profile contains more than one endpoint, i.e.,
- // list contains more than just the head, only when RTCORBA is enabled.
- // However, in the near future, this will be used in nonRT
- // mode as well, e.g., to support TAG_ALTERNATE_IIOP_ADDRESS-style
- // feature.
- // Addressing info of the default endpoint, i.e., head of the list,
- // is transmitted using standard SHMIOP ProfileBody components. See
- // <encode_endpoints> method documentation above for how the rest of
- // the endpoint list is transmitted.
+ /// Number of endpoints in the list headed by <endpoint_>.
size_t count_;
- // Number of endpoints in the list headed by <endpoint_>.
+ /// object_key associated with this profile.
TAO_ObjectKey object_key_;
- // object_key associated with this profile.
+ /// The tagged profile info
IOP::TaggedProfile tagged_profile_;
- // The tagged profile info
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/tao/Strategies/UIOP_Connector.cpp b/TAO/tao/Strategies/UIOP_Connector.cpp
index f1527b7cb5c..ba166d8d592 100644
--- a/TAO/tao/Strategies/UIOP_Connector.cpp
+++ b/TAO/tao/Strategies/UIOP_Connector.cpp
@@ -389,24 +389,26 @@ TAO_UIOP_Connector::create_profile (TAO_InputCDR& cdr)
return pfile;
}
-void
-TAO_UIOP_Connector::make_profile (const char *endpoint,
- TAO_Profile *&profile,
- CORBA::Environment &ACE_TRY_ENV)
+TAO_Profile *
+TAO_UIOP_Connector::make_profile (CORBA::Environment &ACE_TRY_ENV)
{
// The endpoint should be of the form:
// N.n@rendezvous_point|object_key
// or:
// rendezvous_point|object_key
+ TAO_Profile *profile = 0;
ACE_NEW_THROW_EX (profile,
- TAO_UIOP_Profile (endpoint,
- this->orb_core (),
- ACE_TRY_ENV),
- CORBA::NO_MEMORY ());
+ TAO_UIOP_Profile (this->orb_core ()),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
- ACE_CHECK;
+ ACE_CHECK_RETURN (0);
+ return profile;
}
int
diff --git a/TAO/tao/Strategies/UIOP_Connector.h b/TAO/tao/Strategies/UIOP_Connector.h
index ea6f8bc7068..395fb5d2f04 100644
--- a/TAO/tao/Strategies/UIOP_Connector.h
+++ b/TAO/tao/Strategies/UIOP_Connector.h
@@ -1,23 +1,19 @@
-// This may look like C, but it's really -*- C++ -*-
-// $Id$
-
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO
-//
-// = FILENAME
-// UIOP_Connector.h
-//
-// = DESCRIPTION
-// UIOP specific connector processing
-//
-// = AUTHOR
-// Fred Kuhns <fredk@cs.wustl.edu>
-// Ossama Othman <othman@cs.wustl.edu>
-//
-// ============================================================================
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIOP_Connector.h
+ *
+ * $Id$
+ *
+ * UIOP specific connector processing
+ *
+ *
+ * @author Fred Kuhns <fredk@cs.wustl.edu>
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
#ifndef TAO_UIOP_CONNECTOR_H
#define TAO_UIOP_CONNECTOR_H
@@ -38,23 +34,25 @@
#include "tao/Connector_Impl.h"
-
+/**
+ * @class TAO_UIOP_Connector
+ *
+ * @brief UIOP-specific Connector bridge for pluggable protocols.
+ *
+ */
class TAO_Strategies_Export TAO_UIOP_Connector : public TAO_Connector
{
- // = TITLE
- // UIOP-specific Connector bridge for pluggable protocols.
- //
- // = DESCRIPTION
- //
public:
// = Initialization and termination methods.
+ /**
+ * Constructor.
+ * @@ Do we want to pass in the tag here or should it be statically
+ * defined?
+ */
TAO_UIOP_Connector (CORBA::Boolean flag = 0);
- // Constructor.
- // @@ Do we want to pass in the tag here or should it be statically
- // defined?
+ /// Destructor
~TAO_UIOP_Connector (void);
- // Destructor
// = The TAO_Connector methods, please check the documentation on
// Pluggable.h
@@ -72,15 +70,14 @@ public:
virtual char object_key_delimiter (void) const;
protected:
+
// = More TAO_Connector methods, please check the documentation on
// Pluggable.h
- virtual void make_profile (const char *endpoint,
- TAO_Profile *&,
- CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ());
+ virtual TAO_Profile *make_profile (CORBA::Environment &ACE_TRY_ENV);
+ /// Obtains uiop properties that must be used by this connector, i.e.,
+ /// initializes <uiop_properties_>.
int init_uiop_properties (void);
- // Obtains uiop properties that must be used by this connector, i.e.,
- // initializes <uiop_properties_>.
public:
@@ -100,18 +97,18 @@ public:
private:
+ /// Our connect strategy
TAO_UIOP_CONNECT_STRATEGY connect_strategy_;
- // Our connect strategy
+ /// The connector initiating connection requests for UIOP.
TAO_UIOP_BASE_CONNECTOR base_connector_;
- // The connector initiating connection requests for UIOP.
+ /// Do we need to use a GIOP_Lite for sending messages?
CORBA::Boolean lite_flag_;
- // Do we need to use a GIOP_Lite for sending messages?
+ /// UIOP configuration properties for all connections established by
+ /// this connector.
TAO_UIOP_Properties uiop_properties_;
- // UIOP configuration properties for all connections established by
- // this connector.
};
# endif /* TAO_HAS_UIOP == 1 */
diff --git a/TAO/tao/Strategies/UIOP_Profile.cpp b/TAO/tao/Strategies/UIOP_Profile.cpp
index 748186fcf57..2c91a14062b 100644
--- a/TAO/tao/Strategies/UIOP_Profile.cpp
+++ b/TAO/tao/Strategies/UIOP_Profile.cpp
@@ -13,7 +13,9 @@
#include "tao/debug.h"
#include "uiop_endpoints.h"
-ACE_RCSID(Strategies, UIOP_Profile, "$Id$")
+ACE_RCSID (Strategies,
+ UIOP_Profile,
+ "$Id$")
#if !defined (__ACE_INLINE__)
@@ -55,22 +57,6 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (const char *,
{
}
-TAO_UIOP_Profile::TAO_UIOP_Profile (const char *string,
- TAO_ORB_Core *orb_core,
- CORBA::Environment &ACE_TRY_ENV)
- : TAO_Profile (TAO_TAG_UIOP_PROFILE,
- orb_core,
- TAO_GIOP_Version (TAO_DEF_GIOP_MAJOR,
- TAO_DEF_GIOP_MINOR)),
- endpoint_ (),
- count_ (1),
- object_key_ (),
- tagged_profile_ ()
-{
- parse_string (string, ACE_TRY_ENV);
- ACE_CHECK;
-}
-
TAO_UIOP_Profile::TAO_UIOP_Profile (TAO_ORB_Core *orb_core)
: TAO_Profile (TAO_TAG_UIOP_PROFILE,
orb_core,
@@ -110,18 +96,17 @@ TAO_UIOP_Profile::endpoint_count (void)
return this->count_;
}
-int
+void
TAO_UIOP_Profile::parse_string (const char *string,
CORBA::Environment &ACE_TRY_ENV)
{
if (!string || !*string)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// Remove the "N.n@" version prefix, if it exists, and verify the
@@ -144,12 +129,11 @@ TAO_UIOP_Profile::parse_string (const char *string,
if (this->version_.major != TAO_DEF_GIOP_MAJOR ||
this->version_.minor > TAO_DEF_GIOP_MINOR)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
// Pull off the "rendezvous point" part of the objref
@@ -161,12 +145,11 @@ TAO_UIOP_Profile::parse_string (const char *string,
if (cp == 0)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
// No rendezvous point specified
}
@@ -179,19 +162,16 @@ TAO_UIOP_Profile::parse_string (const char *string,
if (this->endpoint_.object_addr_.set (rendezvous.in ()) != 0)
{
- ACE_THROW_RETURN (CORBA::INV_OBJREF (
- CORBA_SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- -1);
+ ACE_THROW (CORBA::INV_OBJREF (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO));
}
start = ++cp; // increment past the object key separator
TAO_ObjectKey::decode_string_to_sequence (this->object_key_, start);
-
- return 1;
}
CORBA::Boolean
@@ -283,7 +263,7 @@ TAO_UIOP_Profile::to_string (CORBA::Environment &)
static const char digits [] = "0123456789";
ACE_OS::sprintf (buf,
- "%sloc://%c.%c@%s%c%s",
+ "corbaloc:%s://%c.%c@%s%c%s",
::prefix_,
digits [this->version_.major],
digits [this->version_.minor],
diff --git a/TAO/tao/Strategies/UIOP_Profile.h b/TAO/tao/Strategies/UIOP_Profile.h
index b32e89a2975..3209f18c948 100644
--- a/TAO/tao/Strategies/UIOP_Profile.h
+++ b/TAO/tao/Strategies/UIOP_Profile.h
@@ -1,23 +1,19 @@
-// This may look like C, but it's really -*- C++ -*-
-// $Id$
-
-
-// ============================================================================
-//
-// = LIBRARY
-// TAO
-//
-// = FILENAME
-// UIOP_Profile.h
-//
-// = DESCRIPTION
-// Unix Domain Socket (UIOP) profile specific processing
-//
-// = AUTHOR
-// Fred Kuhns <fredk@cs.wustl.edu>
-// Ossama Othman <othman@cs.wustl.edu>
-//
-// ============================================================================
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file UIOP_Profile.h
+ *
+ * $Id$
+ *
+ * Unix Domain Socket (UIOP) profile specific processing
+ *
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ * @author Fred Kuhns <fredk@cs.wustl.edu>
+ */
+//=============================================================================
+
#ifndef TAO_UIOP_PROFILE_H
#define TAO_UIOP_PROFILE_H
@@ -41,148 +37,151 @@
// TAO UIOP_Profile concrete Profile definitions
+/**
+ * @class TAO_UIOP_Profile
+ *
+ * @brief This class defines the protocol specific attributes required
+ * for locating ORBs over local IPC.
+ *
+ * This class defines the UIOP profile.
+ */
class TAO_Strategies_Export TAO_UIOP_Profile : public TAO_Profile
{
- // = TITLE
- // This class defines the protocol specific attributes required
- // for locating ORBs over local IPC.
- //
- // = DESCRIPTION
- // This class defines the UIOP profile.
public:
+ /// The object key delimiter that UIOP uses or expects.
static const char object_key_delimiter_;
virtual char object_key_delimiter (void) const;
- // The object key delimiter that UIOP uses or expects.
+ /// Return the char string prefix.
static const char *prefix (void);
- // Return the char string prefix.
+ /// Profile constructor, same as above except the object_key has
+ /// already been marshaled. (actually, no marshalling for this protocol)
TAO_UIOP_Profile (const ACE_UNIX_Addr &addr,
const TAO_ObjectKey &object_key,
const TAO_GIOP_Version &version,
TAO_ORB_Core *orb_core);
- // Profile constructor, same as above except the object_key has
- // already been marshaled. (actually, no marshalling for this protocol)
+ /// Profile constructor
TAO_UIOP_Profile (const char *rendezvous_point,
const TAO_ObjectKey &object_key,
const ACE_UNIX_Addr &addr,
const TAO_GIOP_Version &version,
TAO_ORB_Core *orb_core);
- // Profile constructor
-
- TAO_UIOP_Profile (const char *string,
- TAO_ORB_Core *orb_core,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
- // Create object using a string ior.
+ /// Profile constructor, default.
TAO_UIOP_Profile (TAO_ORB_Core *orb_core);
- // Profile constructor, default.
+ /// Destructor is to be called only through <_decr_refcnt>.
~TAO_UIOP_Profile (void);
- // Destructor is to be called only through <_decr_refcnt>.
- virtual int parse_string (const char *string,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
- // Initialize this object using the given input string.
+ /// Initialize this object using the given input string.
+ virtual void parse_string (const char *string,
+ CORBA::Environment &ACE_TRY_ENV);
- virtual char * to_string (CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
- // Return a string representation for this profile.
- // client must deallocate memory.
+ /// Return a string representation for this profile.
+ /// client must deallocate memory.
+ virtual char * to_string (CORBA::Environment &ACE_TRY_ENV);
+ /// Initialize this object using the given CDR octet string.
virtual int decode (TAO_InputCDR& cdr);
- // Initialize this object using the given CDR octet string.
+ /// Encode this profile in a stream, i.e. marshal it.
virtual int encode (TAO_OutputCDR &stream) const;
- // Encode this profile in a stream, i.e. marshal it.
+ /**
+ * Encodes this profile's endpoints into a tagged component.
+ * This is done only if RTCORBA is enabled, since currently this is
+ * the only case when we have more than one endpoint per profile.
+ * Return 0 on success, -1 on failure.
+ *
+ * Endpoints are transmitted using TAO-proprietory tagged component.
+ * Component tag is TAO_TAG_ENDPOINTS and component data is an
+ * encapsulation of a sequence of structs, each representing a
+ * single endpoint. Data format is specified in uiop_endpoins.pidl.
+ *
+ * Multiple a la TAG_ALTERNATE_IIOP_ADDRESS components can be used
+ * instead of a single proprietory component to transmit multiple
+ * endpoints. This is somewhat slower and less convenient. Also,
+ * TAG_ALTERNATE_IIOP_ADDRESS does not provide for transmission of
+ * endpoint priorities.
+ *
+ */
virtual int encode_endpoints (void);
- // Encodes this profile's endpoints into a tagged component.
- // This is done only if RTCORBA is enabled, since currently this is
- // the only case when we have more than one endpoint per profile.
- // Return 0 on success, -1 on failure.
- //
- // Endpoints are transmitted using TAO-proprietory tagged component.
- // Component tag is TAO_TAG_ENDPOINTS and component data is an
- // encapsulation of a sequence of structs, each representing a
- // single endpoint. Data format is specified in uiop_endpoins.pidl.
- //
- // Multiple a la TAG_ALTERNATE_IIOP_ADDRESS components can be used
- // instead of a single proprietory component to transmit multiple
- // endpoints. This is somewhat slower and less convenient. Also,
- // TAG_ALTERNATE_IIOP_ADDRESS does not provide for transmission of
- // endpoint priorities.
- //
+ /// @@ deprecated. return a reference to the Object Key.
virtual const TAO_ObjectKey &object_key (void) const;
- // @@ deprecated. return a reference to the Object Key.
+ /// Return a pointer to the Object Key. The caller owns the memory
+ /// allocated for the returned key.
virtual TAO_ObjectKey *_key (void) const;
- // Return a pointer to the Object Key. The caller owns the memory
- // allocated for the returned key.
+ /// Return pointer to the head of this profile's endpoints list.
virtual TAO_Endpoint *endpoint (void);
- // Return pointer to the head of this profile's endpoints list.
+ /// Return how many endpoints this profile contains.
virtual size_t endpoint_count (void);
- // Return how many endpoints this profile contains.
+ /**
+ * Add <endp> to this profile's list of endpoints (it is inserted
+ * next to the head of the list). This profiles takes ownership of
+ * <endp>.
+ */
void add_endpoint (TAO_UIOP_Endpoint *endp);
- // Add <endp> to this profile's list of endpoints (it is inserted
- // next to the head of the list). This profiles takes ownership of
- // <endp>.
+ /**
+ * Return true if this profile is equivalent to other_profile. Two
+ * profiles are equivalent iff their tag, object_key, version and
+ * all endpoints are the same.
+ */
virtual CORBA::Boolean is_equivalent (const TAO_Profile *other_profile);
- // Return true if this profile is equivalent to other_profile. Two
- // profiles are equivalent iff their tag, object_key, version and
- // all endpoints are the same.
+ /// Return a hash value for this object.
virtual CORBA::ULong hash (CORBA::ULong max,
- CORBA::Environment &ACE_TRY_ENV =
- TAO_default_environment ());
- // Return a hash value for this object.
+ CORBA::Environment &ACE_TRY_ENV);
+ /// Please see the Profile.h for the documentation of this method
virtual IOP::TaggedProfile &create_tagged_profile (void);
- // Please see the Profile.h for the documentation of this method
private:
+ /// Create an encapsulation of the struct ProfileBody in <cdr>
void create_profile_body (TAO_OutputCDR &cdr) const;
- // Create an encapsulation of the struct ProfileBody in <cdr>
+ /**
+ * Helper for <decode>. Decodes endpoints from a tagged component.
+ * Decode only if RTCORBA is enabled. Furthermore, we may not find
+ * TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT
+ * version of TAO or some other ORB. This is not an error, and we
+ * must proceed. Return 0 on success and -1 on failure.
+ */
int decode_endpoints (void);
- // Helper for <decode>. Decodes endpoints from a tagged component.
- // Decode only if RTCORBA is enabled. Furthermore, we may not find
- // TAO_TAG_ENDPOINTS component, e.g., if we are talking to nonRT
- // version of TAO or some other ORB. This is not an error, and we
- // must proceed. Return 0 on success and -1 on failure.
+ /**
+ * Head of this profile's list of endpoints. This endpoint is not
+ * dynamically allocated because a profile always contains at least
+ * one endpoint.
+ *
+ * Currently, a profile contains more than one endpoint, i.e.,
+ * list contains more than just the head, only when RTCORBA is enabled.
+ * However, in the near future, this will be used in nonRT
+ * mode as well, e.g., to support a la TAG_ALTERNATE_IIOP_ADDRESS
+ * feature.
+ * Addressing info of the default endpoint, i.e., head of the list,
+ * is transmitted using standard UIOP ProfileBody components. See
+ * <encode_endpoints> method documentation above for how the rest of
+ * the endpoint list is transmitted.
+ */
TAO_UIOP_Endpoint endpoint_;
- // Head of this profile's list of endpoints. This endpoint is not
- // dynamically allocated because a profile always contains at least
- // one endpoint.
- //
- // Currently, a profile contains more than one endpoint, i.e.,
- // list contains more than just the head, only when RTCORBA is enabled.
- // However, in the near future, this will be used in nonRT
- // mode as well, e.g., to support a la TAG_ALTERNATE_IIOP_ADDRESS
- // feature.
- // Addressing info of the default endpoint, i.e., head of the list,
- // is transmitted using standard UIOP ProfileBody components. See
- // <encode_endpoints> method documentation above for how the rest of
- // the endpoint list is transmitted.
+ /// Number of endpoints in the list headed by <endpoint_>.
size_t count_;
- // Number of endpoints in the list headed by <endpoint_>.
+ /// object_key associated with this profile.
TAO_ObjectKey object_key_;
- // object_key associated with this profile.
+ /// Our tagged profile info
IOP::TaggedProfile tagged_profile_;
- // Our tagged profile info
};
#if defined (__ACE_INLINE__)