summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-03-23 06:35:28 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-03-23 06:35:28 +0000
commit3ecc7923b04c3d507670fa4292391adebf5a29b9 (patch)
tree75a614d14bdabbbd69a755fc40ff992d7763bedd
parentc7a079720249adcaa3698042dc46278ff4406307 (diff)
downloadATCD-3ecc7923b04c3d507670fa4292391adebf5a29b9.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/Struct_TypeCode.h4
-rw-r--r--TAO/tao/Struct_TypeCode.inl4
-rw-r--r--TAO/tao/TypeCode.cpp64
-rw-r--r--TAO/tao/TypeCode_Base_Attributes.h4
-rw-r--r--TAO/tao/TypeCode_Constants.h112
5 files changed, 178 insertions, 10 deletions
diff --git a/TAO/tao/Struct_TypeCode.h b/TAO/tao/Struct_TypeCode.h
index 3a57a96723c..9951b3babec 100644
--- a/TAO/tao/Struct_TypeCode.h
+++ b/TAO/tao/Struct_TypeCode.h
@@ -56,7 +56,7 @@ namespace TAO
/// Constructor.
Struct (char const * id,
char const * name,
- Field<StringType> const * fields,
+ Struct_Field<StringType> const * fields,
CORBA::ULong nfields);
/**
@@ -103,7 +103,7 @@ namespace TAO
private:
/// Get pointer to the underlying @c Field array.
- Field<StringType> const * fields (void) const;
+ Struct_Field<StringType> const * fields (void) const;
private:
diff --git a/TAO/tao/Struct_TypeCode.inl b/TAO/tao/Struct_TypeCode.inl
index d533af8a02c..d8eb30f2f7f 100644
--- a/TAO/tao/Struct_TypeCode.inl
+++ b/TAO/tao/Struct_TypeCode.inl
@@ -16,7 +16,7 @@ TAO::TypeCode::Struct<StringType,
RefCountPolicy>::Struct (
char const * id,
char const * name,
- Field<StringType> const * fields,
+ Struct_Field<StringType> const * fields,
CORBA::ULong nfields)
: base_attributes_ (id, name)
, nfields_ (nfields)
@@ -28,7 +28,7 @@ template <typename StringType,
class FieldArrayType,
CORBA::TCKind Kind,
class RefCountPolicy>
-ACE_INLINE TAO::TypeCode::Field<StringType> const *
+ACE_INLINE TAO::TypeCode::Struct_Field<StringType> const *
TAO::TypeCode::Struct<StringType,
FieldArrayType,
Kind,
diff --git a/TAO/tao/TypeCode.cpp b/TAO/tao/TypeCode.cpp
index b14f44b0543..59b7cf71e8a 100644
--- a/TAO/tao/TypeCode.cpp
+++ b/TAO/tao/TypeCode.cpp
@@ -12,6 +12,13 @@ ACE_RCSID (tao,
# include "TypeCode.inl"
#endif /* ! __ACE_INLINE__ */
+#include "SystemException.h"
+#include "CDR.h"
+#include "ORB_Constants.h"
+#include "Struct_TypeCode.h"
+
+#include "ace/OS_NS_string.h"
+
CORBA::Boolean
CORBA::TypeCode::equal (TypeCode_ptr tc
@@ -136,7 +143,7 @@ CORBA::TypeCode::fixed_digits_i (ACE_ENV_SINGLE_ARG_DECL) const
ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0);
}
-CORBA::Short
+CORBA::UShort
CORBA::TypeCode::fixed_scale_i (ACE_ENV_SINGLE_ARG_DECL) const
{
ACE_THROW_RETURN (CORBA::TypeCode::BadKind (), 0);
@@ -174,12 +181,13 @@ TAO::operator<< (TAO_OutputCDR & cdr,
if (tc == 0)
{
- ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
+ ACE_THROW_RETURN (CORBA::MARSHAL (0,
CORBA::COMPLETED_MAYBE),
false);
}
- CORBA::ULong const kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
+ CORBA::ULong const kind =
+ static_cast<CORBA::ULong> (tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER));
ACE_CHECK_RETURN (false);
return (cdr << kind) && tc->tao_marshal (cdr);
@@ -197,7 +205,7 @@ TAO::unaliased_typecode (CORBA::TypeCode_ptr tc
}
CORBA::TCKind tc_kind = tc->kind (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (tc_kind);
+ ACE_CHECK_RETURN (tc);
if (tc_kind == CORBA::tk_alias)
{
@@ -220,3 +228,51 @@ TAO::unaliased_typecode (CORBA::TypeCode_ptr tc
return CORBA::TypeCode::_duplicate (tc);
}
+
+// --------------------------------------------------------------
+
+namespace TAO
+{
+ namespace TypeCode
+ {
+ // Notice that these are all statically instantiated and not
+ // exported.
+
+ char const tc_bounds_id[] = "IDL:omg.org/CORBA/TypeCode/Bounds:1.0";
+ char const tc_bounds_name[] = "Bounds";
+ Struct_TypeCode<char const *,
+ Struct_Field<char const *>,
+ CORBA::tk_except,
+ TAO::Null_RefCount_Policy> tc_Bounds (tc_bounds_id,
+ tc_bounds_name,
+ 0,
+ 0);
+
+ char const tc_bad_kind_id[] = "IDL:omg.org/CORBA/TypeCode/BadKind:1.0";
+ char const tc_bad_kind_name[] = "BadKind";
+ Struct_TypeCode<char const *,
+ Struct_Field<char const *>,
+ CORBA::tk_except,
+ TAO::Null_RefCount_Policy> tc_BadKind (tc_bad_kind_id,
+ tc_bad_kind_name,
+ 0,
+ 0);
+ }
+}
+
+
+// ------------------------------------------------------------------
+// OMG defined TypeCode constants
+// ------------------------------------------------------------------
+
+namespace CORBA
+{
+
+ // Notice that these are constant TypeCode references/pointers, not
+ // constant TypeCodes. TypeCodes are effectively read-only since
+ // all non-static TypeCode operations are const.
+
+ TypeCode_ptr const TypeCode::_tc_Bounds = &TAO::TypeCode::tc_Bounds;
+ TypeCode_ptr const TypeCode::_tc_BadKind = &TAO::TypeCode::tc_BadKind;
+
+}
diff --git a/TAO/tao/TypeCode_Base_Attributes.h b/TAO/tao/TypeCode_Base_Attributes.h
index 7a682253e5e..3f475334d6d 100644
--- a/TAO/tao/TypeCode_Base_Attributes.h
+++ b/TAO/tao/TypeCode_Base_Attributes.h
@@ -68,11 +68,11 @@ namespace TAO
#ifdef __ACE_INLINE__
-# include "tao/TypeCode/TypeCode_Base_Attributes.inl"
+# include "tao/TypeCode_Base_Attributes.inl"
#endif /* __ACE_INLINE__ */
#ifdef ACE_TEMPLATES_REQUIRE_SOURCE
-# include "tao/TypeCode/TypeCode_Base_Attributes.cpp"
+# include "tao/TypeCode_Base_Attributes.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#ifdef ACE_TEMPLATES_REQUIRE_PRAGMA
diff --git a/TAO/tao/TypeCode_Constants.h b/TAO/tao/TypeCode_Constants.h
new file mode 100644
index 00000000000..c82e815b45d
--- /dev/null
+++ b/TAO/tao/TypeCode_Constants.h
@@ -0,0 +1,112 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file TypeCode_Constants.h
+ *
+ * $Id$
+ *
+ * Declare the @c TypeCode constants available to the ORB and user
+ * applications.
+ *
+ * @author Jeff Parsons
+ * @author Ossama Othman
+ */
+//=============================================================================
+
+#ifndef TAO_TYPECODE_CONSTANTS_FORWARD_H
+#define TAO_TYPECODE_CONSTANTS_FORWARD_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/TAO_Export.h"
+
+namespace CORBA
+{
+ /**
+ * @name TypeCode Constants
+ *
+ * All the TypeCode constants
+ */
+ //@{
+ extern TAO_Export TypeCode_ptr const _tc_null;
+ extern TAO_Export TypeCode_ptr const _tc_void;
+ extern TAO_Export TypeCode_ptr const _tc_short;
+ extern TAO_Export TypeCode_ptr const _tc_long;
+ extern TAO_Export TypeCode_ptr const _tc_ushort;
+ extern TAO_Export TypeCode_ptr const _tc_ulong;
+ extern TAO_Export TypeCode_ptr const _tc_float;
+ extern TAO_Export TypeCode_ptr const _tc_double;
+ extern TAO_Export TypeCode_ptr const _tc_boolean;
+ extern TAO_Export TypeCode_ptr const _tc_char;
+ extern TAO_Export TypeCode_ptr const _tc_octet;
+ extern TAO_Export TypeCode_ptr const _tc_any;
+ extern TAO_Export TypeCode_ptr const _tc_TypeCode;
+ extern TAO_Export TypeCode_ptr const _tc_Principal;
+ extern TAO_Export TypeCode_ptr const _tc_Object;
+ extern TAO_Export TypeCode_ptr const _tc_string;
+ extern TAO_Export TypeCode_ptr const _tc_longlong;
+ extern TAO_Export TypeCode_ptr const _tc_ulonglong;
+ extern TAO_Export TypeCode_ptr const _tc_longdouble;
+ extern TAO_Export TypeCode_ptr const _tc_wchar;
+ extern TAO_Export TypeCode_ptr const _tc_wstring;
+
+#define TAO_SYSTEM_EXCEPTION_LIST \
+ TAO_SYSTEM_EXCEPTION(UNKNOWN); \
+ TAO_SYSTEM_EXCEPTION(BAD_PARAM); \
+ TAO_SYSTEM_EXCEPTION(NO_MEMORY); \
+ TAO_SYSTEM_EXCEPTION(IMP_LIMIT); \
+ TAO_SYSTEM_EXCEPTION(COMM_FAILURE); \
+ TAO_SYSTEM_EXCEPTION(INV_OBJREF); \
+ TAO_SYSTEM_EXCEPTION(OBJECT_NOT_EXIST); \
+ TAO_SYSTEM_EXCEPTION(NO_PERMISSION); \
+ TAO_SYSTEM_EXCEPTION(INTERNAL); \
+ TAO_SYSTEM_EXCEPTION(MARSHAL); \
+ TAO_SYSTEM_EXCEPTION(INITIALIZE); \
+ TAO_SYSTEM_EXCEPTION(NO_IMPLEMENT); \
+ TAO_SYSTEM_EXCEPTION(BAD_TYPECODE); \
+ TAO_SYSTEM_EXCEPTION(BAD_OPERATION); \
+ TAO_SYSTEM_EXCEPTION(NO_RESOURCES); \
+ TAO_SYSTEM_EXCEPTION(NO_RESPONSE); \
+ TAO_SYSTEM_EXCEPTION(PERSIST_STORE); \
+ TAO_SYSTEM_EXCEPTION(BAD_INV_ORDER); \
+ TAO_SYSTEM_EXCEPTION(TRANSIENT); \
+ TAO_SYSTEM_EXCEPTION(FREE_MEM); \
+ TAO_SYSTEM_EXCEPTION(INV_IDENT); \
+ TAO_SYSTEM_EXCEPTION(INV_FLAG); \
+ TAO_SYSTEM_EXCEPTION(INTF_REPOS); \
+ TAO_SYSTEM_EXCEPTION(BAD_CONTEXT); \
+ TAO_SYSTEM_EXCEPTION(OBJ_ADAPTER); \
+ TAO_SYSTEM_EXCEPTION(DATA_CONVERSION); \
+ TAO_SYSTEM_EXCEPTION(INV_POLICY); \
+ TAO_SYSTEM_EXCEPTION(REBIND); \
+ TAO_SYSTEM_EXCEPTION(TIMEOUT); \
+ TAO_SYSTEM_EXCEPTION(TRANSACTION_UNAVAILABLE); \
+ TAO_SYSTEM_EXCEPTION(TRANSACTION_MODE); \
+ TAO_SYSTEM_EXCEPTION(TRANSACTION_REQUIRED); \
+ TAO_SYSTEM_EXCEPTION(TRANSACTION_ROLLEDBACK); \
+ TAO_SYSTEM_EXCEPTION(INVALID_TRANSACTION); \
+ TAO_SYSTEM_EXCEPTION(CODESET_INCOMPATIBLE); \
+ TAO_SYSTEM_EXCEPTION(BAD_QOS); \
+ TAO_SYSTEM_EXCEPTION(INVALID_ACTIVITY); \
+ TAO_SYSTEM_EXCEPTION(ACTIVITY_COMPLETED); \
+ TAO_SYSTEM_EXCEPTION(ACTIVITY_REQUIRED); \
+ TAO_SYSTEM_EXCEPTION(THREAD_CANCELLED);
+
+ // = Typecode constants for system exceptions.
+#define TAO_SYSTEM_EXCEPTION(name) \
+ extern TAO_Export TypeCode_ptr const _tc_ ## name
+ TAO_SYSTEM_EXCEPTION_LIST
+#undef TAO_SYSTEM_EXCEPTION
+ //@}
+
+ extern TAO_Export TypeCode_ptr const _tc_UnknownUserException;
+
+ extern TAO_Export TypeCode_ptr const _tc_Current;
+
+ extern TAO_Export TypeCode_ptr const _tc_NamedValue;
+}
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_TYPECODE_CONSTANTS_H */