summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2004-08-27 07:28:16 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2004-08-27 07:28:16 +0000
commit3f7d7250b248a50d1e44ef2bfa3b7a23e2e76add (patch)
tree60077a5c85b5c9cbe909284da04dde76d94b64c2 /TAO/tao
parent1ba874c84e0bd948eba1ea817cdbf5d8a655674f (diff)
downloadATCD-3f7d7250b248a50d1e44ef2bfa3b7a23e2e76add.tar.gz
ChangeLogTag:Fri Aug 27 00:25:47 2004 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/CORBA.pidl13
-rw-r--r--TAO/tao/Exception.cpp7
-rw-r--r--TAO/tao/Invocation_Endpoint_Selectors.cpp8
-rw-r--r--TAO/tao/ORB_Constants.h120
-rw-r--r--TAO/tao/Policy_Forward.pidl2
-rw-r--r--TAO/tao/Profile_Transport_Resolver.cpp37
-rw-r--r--TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp6
7 files changed, 137 insertions, 56 deletions
diff --git a/TAO/tao/CORBA.pidl b/TAO/tao/CORBA.pidl
deleted file mode 100644
index b6ce0f6987f..00000000000
--- a/TAO/tao/CORBA.pidl
+++ /dev/null
@@ -1,13 +0,0 @@
-// $Id$
-
-// This will have all new definitions that will go in to CORBA from
-// now on.
-
-#ifndef TAO_CORBA_IDL
-#define TAO_CORBA_IDL
-
-#include <orb.idl>
-
-// This file is deprecated.
-
-#endif
diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp
index 92fbb75ee88..b633d28e7d5 100644
--- a/TAO/tao/Exception.cpp
+++ b/TAO/tao/Exception.cpp
@@ -466,7 +466,7 @@ CORBA::SystemException::_tao_minor_code (u_int location,
int errno_value)
{
return
- TAO_DEFAULT_MINOR_CODE
+ TAO::VMCID
| location
| _tao_errno (errno_value);
}
@@ -492,9 +492,10 @@ CORBA::SystemException::_info (void) const
info += this->_rep_id ();
info += "'\n";
+ /// Mask off the lower order 12 bits to get the VMCID.
const CORBA::ULong VMCID = this->minor () & 0xFFFFF000u;
- if (VMCID == TAO_DEFAULT_MINOR_CODE)
+ if (VMCID == TAO::VMCID)
{
// @@ Move the following code to a subroutine, it is too long already!
const char *location;
@@ -1287,7 +1288,7 @@ STANDARD_EXCEPTION_LIST
CORBA::name ::name (void) \
: CORBA::SystemException ("IDL:omg.org/CORBA/" #name ":1.0", \
#name, \
- TAO_DEFAULT_MINOR_CODE, \
+ TAO::VMCID, \
CORBA::COMPLETED_NO) \
{ \
} \
diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp
index 6324aea5378..62fc3ab4f71 100644
--- a/TAO/tao/Invocation_Endpoint_Selectors.cpp
+++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp
@@ -43,9 +43,9 @@ TAO_Default_Endpoint_Selector::select_endpoint (
{
r->profile (r->stub ()->profile_in_use ());
- // Check whether we need to have do a blocked wait or we have a non
- // blocked wait and we support that, if this is not the case we
- // can't use this profile and try the next
+ // Check whether we need to do a blocked wait or we have a
+ // non-blocked wait and we support that. If this is not the
+ // case we can't use this profile so try the next.
if (r->blocked () ||
(!r->blocked () && r->profile ()->supports_non_blocking_oneways ()))
{
@@ -58,7 +58,7 @@ TAO_Default_Endpoint_Selector::select_endpoint (
for (size_t i = 0; i < endpoint_count; ++i)
{
TAO_Base_Transport_Property desc (ep);
- bool retval =
+ const bool retval =
r->try_connect (&desc,
max_wait_time
ACE_ENV_ARG_PARAMETER);
diff --git a/TAO/tao/ORB_Constants.h b/TAO/tao/ORB_Constants.h
index 2b992221904..585914e1604 100644
--- a/TAO/tao/ORB_Constants.h
+++ b/TAO/tao/ORB_Constants.h
@@ -2,13 +2,14 @@
//=============================================================================
/**
- * @file ORB_Constants.h
+ * @file ORB_Constants.h
*
* $Id$
*
* Constants needed by various files.
*
* @author Jeff Parsons
+ * @author Ossama Othman
*/
//=============================================================================
@@ -23,29 +24,120 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "tao/TAO_Export.h"
-
-// An hash define for the regular two way operation
+// A hash define for the regular two way operation.
#define TAO_TWOWAY_RESPONSE_FLAG 255
namespace CORBA
{
- /// The OMG Vendor Minor Codeset ID.
+ /// The OMG Vendor Minor Codeset ID (VMCID).
/**
* This number is reserved by the OMG as a prefix to all the
* standard system exception minor codes. Check the CORBA/IIOP
* specification for details.
+ *
+ * OMG defined system exception minor codes should be logically
+ * OR-ed with this constant when passing such minor codes to a
+ * @c CORBA::SystemException constructor. For example, throwing a
+ * @c CORBA::BAD_PARAM exception with an OMG defined minor code of
+ * @c 2 is done as follows:
+ *
+ * @verbatim
+ * throw (CORBA::BAD_PARAM (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
+ * @endverbatim
+ *
+ * *NOT* as:
+ *
+ * @verbatim
+ * throw (CORBA::BAD_PARAM (2, CORBA::COMPLETED_NO);
+ * @endverbatim
*/
const ULong OMGVMCID = 0x4f4d0000U;
}
-// This number was assigned by the OMG. Do *NOT* change at random.
-// The ASCII representation is TA0xxxx, close enough since they only
-// take 20 bits, the first 16 are TA, the next 4 are 0000. Remember
-// that we can only play with the last 12 bits, TAO_MAX_MINOR_CODE is
-// there to remind us of that.
-const CORBA::ULong TAO_DEFAULT_MINOR_CODE = 0x54410000U;
-const CORBA::ULong TAO_MAX_MINOR_CODE = 0x54410fffU;
+namespace TAO
+{
+ /// TAO Vendor Minor Codeset ID (VMCID).
+ /**
+ * TAO Vendor Minor Codeset ID (VMCID) assigned by the OMG. Do
+ * *NOT* change at random. The TAO VMCID is an ASCII representation
+ * of @c TA0xxxx (close enough since a VMCID only consists of the
+ * higher order 20 bits of a 32 bit unsigned long integer). The
+ * first 16 bits are @c TA, and the remaining 4 are @c 0.
+ *
+ * @note Remember that we can only play with the lower order 12
+ * bits. @c MAX_MINOR_CODE is there to remind us of that.
+ *
+ * @see @c MAX_MINOR_CODE
+ */
+ const CORBA::ULong VMCID = 0x54410000U;
+
+ /// Maximum allowed TAO system exception minor code.
+ /**
+ * Vendors are only allowed to use the lower order 12 bits of their
+ * when defining vendor-specific exception minor codes.
+ * @c MAX_MINOR_CODE is the maximum minor code value available to
+ * TAO. Do not exceed it when defining TAO system exception minor
+ * codes.
+ *
+ * @see @c VMCID
+ */
+ const CORBA::ULong MAX_MINOR_CODE = VMCID | 0xfffU;
+
+ /// TAO Vendor @c PolicyType Valueset ID (VPVID)
+ /**
+ * TAO Vendor @c PolicyType Valueset ID (VPVID) assigned by the
+ * OMG. This value was automatically assigned when TAO's VMCID was
+ * assigned. Its value is always the same as the VMCID.
+ *
+ * As with TAO-specific system exception minor codes, the
+ * TAO-specific @c PolicyType space occupies the lower order 12 bits
+ * of the TAO VPVID, i.e.
+ *
+ * @verbatim
+ * TAO::VPVID <= TAO PolicyType <= TAO::VPVID | 0xfffU.
+ * @endverbatim
+ *
+ * For example, TAO-specific @c PolicyTypes should be defined by
+ * logically "OR-ing" a 12 bit or less (i.e. 0x0U <= value <=
+ * 0xfffU) value with @c TAO::VPVID.
+ *
+ * @see VMCID
+ */
+ const CORBA::ULong VPVID = VMCID;
+}
+
+/**
+ * @name TAO-Specific System Exception Minor Code Values
+ *
+ * These system exception minor code values are specific to TAO.
+ */
+//@{
+/// TAO VMCID assigned by the OMG.
+/**
+ * @note This constant has historically been used in the wrong way.
+ * It was often used as the @a location argument to the @c
+ * CORBA::SystemException::_tao_minor_code() static method. A
+ * more appropriate default @a location argument/value would
+ * have been zero since the location code resides in portion of
+ * the lower order 12 bits, not the higher order 20 bits which
+ * is where the VMCID resides, and what this value happens to
+ * be.
+ *
+ * @deprecated Please use @c TAO::VMCID instead, or zero if being used
+ * as default TAO exception location code argument.
+ *
+ * @see @c TAO::VMCID
+ */
+const CORBA::ULong TAO_DEFAULT_MINOR_CODE = TAO::VMCID;
+
+/// Maximum allowed system exception minor code.
+/**
+ * @deprecated Please use @c TAO::MAX_MINOR_CODE instead.
+ *
+ * @see @c TAO::MAX_MINOR_CODE
+ */
+const CORBA::ULong TAO_MAX_MINOR_CODE = TAO::MAX_MINOR_CODE;
+//@}
/// A dummy service context that is inserted in the service context
/// list to preserve the alignment in DSI based gateways, so no
@@ -58,8 +150,8 @@ const CORBA::ULong TAO_SVC_CONTEXT_ALIGN = 0x54414f00U;
/**
* @name TAO-Specific Profile IDs
*
- * The TAO @c IOP::ProfileId range 0x54414f00 - 0x54414f0f has been
- * reserved with the OMG.
+ * The TAO @c IOP::ProfileId range @c 0x54414f00 - @c 0x54414f0f has
+ * been reserved with the OMG.
*
* @note It is *NOT* necessary to list your own protocols here.
*
diff --git a/TAO/tao/Policy_Forward.pidl b/TAO/tao/Policy_Forward.pidl
index 96c9e2e1bec..3b8ca403c1c 100644
--- a/TAO/tao/Policy_Forward.pidl
+++ b/TAO/tao/Policy_Forward.pidl
@@ -1,3 +1,5 @@
+// -*- IDL -*-
+
/**
* @file Policy_Forward.pidl
*
diff --git a/TAO/tao/Profile_Transport_Resolver.cpp b/TAO/tao/Profile_Transport_Resolver.cpp
index fa0046eaa7c..0b43f2b87a3 100644
--- a/TAO/tao/Profile_Transport_Resolver.cpp
+++ b/TAO/tao/Profile_Transport_Resolver.cpp
@@ -120,18 +120,17 @@ namespace TAO
{
TAO_Connector_Registry *conn_reg =
this->stub_->orb_core ()->connector_registry (
- ACE_ENV_SINGLE_ARG_PARAMETER
- );
+ ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (false);
if (conn_reg == 0)
{
ACE_THROW_RETURN (CORBA::INTERNAL (
- CORBA::SystemException::_tao_minor_code (
- TAO_DEFAULT_MINOR_CODE,
- EINVAL),
- CORBA::COMPLETED_NO),
- 0);
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ EINVAL),
+ CORBA::COMPLETED_NO),
+ false);
}
ACE_Time_Value connection_timeout;
@@ -161,20 +160,20 @@ namespace TAO
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (false);
- // A timeout error occurred
- // If the user has set a roundtrip timeout policy, then throw a
- // timeout exception, else just fall through and return false to
- // look at the next endpoint
- if (this->transport_ == 0 &&
- errno == ETIME &&
- is_conn_timeout == false)
+ // A timeout error occurred.
+ // If the user has set a roundtrip timeout policy, throw a timeout
+ // exception. Otherwise, just fall through and return false to
+ // look at the next endpoint.
+ if (this->transport_ == 0
+ && is_conn_timeout == false
+ && errno == ETIME)
{
ACE_THROW_RETURN (CORBA::TIMEOUT (
- CORBA::SystemException::_tao_minor_code (
- TAO_TIMEOUT_CONNECT_MINOR_CODE,
- errno),
- CORBA::COMPLETED_NO),
- false);
+ CORBA::SystemException::_tao_minor_code (
+ TAO_TIMEOUT_CONNECT_MINOR_CODE,
+ errno),
+ CORBA::COMPLETED_NO),
+ false);
}
else if (this->transport_ == 0)
{
diff --git a/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp b/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp
index 93167098bf1..d110f439219 100644
--- a/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp
+++ b/TAO/tao/TypeCodeFactory/TypeCodeFactory_i.cpp
@@ -65,7 +65,7 @@ TAO_TypeCodeFactory_i::create_union_tc (
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
-
+
if (name == 0 || !this->valid_name (name))
{
ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 15,
@@ -174,7 +174,7 @@ TAO_TypeCodeFactory_i::create_union_tc (
if (!valid_member)
{
- ACE_THROW_RETURN (CORBA::BAD_TYPECODE (2,
+ ACE_THROW_RETURN (CORBA::BAD_TYPECODE (CORBA::OMGVMCID | 2,
CORBA::COMPLETED_NO),
CORBA::TypeCode::_nil ());
}
@@ -1228,7 +1228,7 @@ TAO_TypeCodeFactory_i::valid_name (const char *name)
{
return 1;
}
-
+
if (!isalpha (*name))
{
return 0;