diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-06-15 16:59:29 -0500 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2021-06-15 16:59:29 -0500 |
commit | 65962eedcc372b0d4addf94edea54b810c0e53c2 (patch) | |
tree | aeff03ca53b09d678e7d4509e6946fc6557714fe /TAO | |
parent | 800cec49aeaedbf5355557fc1b300a3b7a1be46d (diff) | |
download | ATCD-65962eedcc372b0d4addf94edea54b810c0e53c2.tar.gz |
Isolate IDL4 Ints in TAO Unless IDL4 is Used
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/TAO_IDL/be/be_codegen.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/Basic_Types.h | 24 | ||||
-rw-r--r-- | TAO/tao/Basic_Types_IDLv4.h | 58 | ||||
-rw-r--r-- | TAO/tao/CDR.h | 10 | ||||
-rw-r--r-- | TAO/tao/CDR.inl | 8 |
5 files changed, 77 insertions, 34 deletions
diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp index 876c01a32e2..07a3a0db99a 100644 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ b/TAO/TAO_IDL/be/be_codegen.cpp @@ -2446,8 +2446,17 @@ TAO_CodeGen::gen_stub_hdr_includes () this->client_header_ ); + const bool idl4 = idl_global->idl_version_ >= IDL_VERSION_4; this->gen_standard_include (this->client_header_, - "tao/Basic_Types.h"); + idl4 ? "tao/Basic_Types_IDLv4.h" : "tao/Basic_Types.h"); + if (idl4) + { + *client_header_ << "\n" + "namespace CORBA\n" + "{\n" + " using namespace IDLv4;\n" + "}"; + } // May need ORB_Constants if users check SystemException minor // codes. diff --git a/TAO/tao/Basic_Types.h b/TAO/tao/Basic_Types.h index e7b47810037..538332cdf93 100644 --- a/TAO/tao/Basic_Types.h +++ b/TAO/tao/Basic_Types.h @@ -75,30 +75,6 @@ namespace CORBA typedef ACE_CDR::WChar WChar; typedef WChar &WChar_out; - - typedef ACE_CDR::Int8 Int8; - typedef Int8 &Int8_out; - - typedef ACE_CDR::UInt8 UInt8; - typedef UInt8 &UInt8_out; - - typedef ACE_CDR::Int16 Int16; - typedef Int16 &Int16_out; - - typedef ACE_CDR::UInt16 UInt16; - typedef UInt16 &UInt16_out; - - typedef ACE_CDR::Int32 Int32; - typedef Int32 &Int32_out; - - typedef ACE_CDR::UInt32 UInt32; - typedef UInt32 &UInt32_out; - - typedef ACE_CDR::Int64 Int64; - typedef Int64 &Int64_out; - - typedef ACE_CDR::UInt64 UInt64; - typedef UInt64 &UInt64_out; //@} typedef TAO::String_var<CORBA::Char> String_var; diff --git a/TAO/tao/Basic_Types_IDLv4.h b/TAO/tao/Basic_Types_IDLv4.h new file mode 100644 index 00000000000..0b278876e2f --- /dev/null +++ b/TAO/tao/Basic_Types_IDLv4.h @@ -0,0 +1,58 @@ +#ifndef TAO_BASIC_TYPES_IDLV4_H +#define TAO_BASIC_TYPES_IDLV4_H + +#include /**/ "ace/pre.h" +#include "ace/CDR_Base.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Basic_Types.h" +#include "tao/orbconf.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace CORBA +{ + namespace IDLv4 + { + /** + * @name IDL4 Explicit Integer Types + * + * These are for the corresponding types defined in IDL4, but they are not + * standard in CORBA. + */ + //@{ + typedef ACE_CDR::Int8 Int8; + typedef Int8 &Int8_out; + + typedef ACE_CDR::UInt8 UInt8; + typedef UInt8 &UInt8_out; + + typedef ACE_CDR::Int16 Int16; + typedef Int16 &Int16_out; + + typedef ACE_CDR::UInt16 UInt16; + typedef UInt16 &UInt16_out; + + typedef ACE_CDR::Int32 Int32; + typedef Int32 &Int32_out; + + typedef ACE_CDR::UInt32 UInt32; + typedef UInt32 &UInt32_out; + + typedef ACE_CDR::Int64 Int64; + typedef Int64 &Int64_out; + + typedef ACE_CDR::UInt64 UInt64; + typedef UInt64 &UInt64_out; + //@} + } +} + +TAO_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" + +#endif /* TAO_BASIC_TYPES_IDLV4_H */ diff --git a/TAO/tao/CDR.h b/TAO/tao/CDR.h index c230463502a..d2ac02e1a0f 100644 --- a/TAO/tao/CDR.h +++ b/TAO/tao/CDR.h @@ -48,7 +48,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include /**/ "tao/TAO_Export.h" -#include "tao/Basic_Types.h" +#include "tao/Basic_Types_IDLv4.h" #include "tao/GIOP_Message_Version.h" #include "tao/Message_Semantics.h" #include "tao/Intrusive_Ref_Count_Handle_T.h" @@ -499,8 +499,8 @@ TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, ACE_OutputCDR::from_std_wstring x); #endif /* ACE_LACKS_STD_WSTRING */ -TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::Int8 x); -TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::UInt8 x); +TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::IDLv4::Int8 x); +TAO_Export CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::IDLv4::UInt8 x); // CDR input operators for CORBA types @@ -540,8 +540,8 @@ TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &os, TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &os, ACE_InputCDR::to_std_wstring x); #endif /* ACE_LACKS_STD_WSTRING */ -TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::Int8 &x); -TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::UInt8 &x); +TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::IDLv4::Int8 &x); +TAO_Export CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::IDLv4::UInt8 &x); TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/CDR.inl b/TAO/tao/CDR.inl index 3ea12fd249d..24952bb8329 100644 --- a/TAO/tao/CDR.inl +++ b/TAO/tao/CDR.inl @@ -495,13 +495,13 @@ ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, } #endif /* ACE_LACKS_STD_WSTRING */ -ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::Int8 x) +ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::IDLv4::Int8 x) { return os.fragment_stream (ACE_CDR::OCTET_ALIGN, ACE_CDR::OCTET_SIZE) && static_cast<ACE_OutputCDR &> (os) << x; } -ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::UInt8 x) +ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &os, CORBA::IDLv4::UInt8 x) { return os.fragment_stream (ACE_CDR::OCTET_ALIGN, ACE_CDR::OCTET_SIZE) @@ -638,12 +638,12 @@ ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, } #endif /* ACE_LACKS_STD_WSTRING */ -ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::Int8 &x) +ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::IDLv4::Int8 &x) { return static_cast<ACE_InputCDR &> (is) >> x; } -ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::UInt8 &x) +ACE_INLINE CORBA::Boolean operator>> (TAO_InputCDR &is, CORBA::IDLv4::UInt8 &x) { return static_cast<ACE_InputCDR &> (is) >> x; } |