summaryrefslogtreecommitdiff
path: root/ACE/ace/CDR_Stream.inl
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2021-06-21 20:22:55 -0500
committerFred Hornsey <hornseyf@objectcomputing.com>2021-06-21 20:22:55 -0500
commit2ed7fe7c1c6492c7f920581ec3ac8e7ec4278efd (patch)
tree7580b073445bd321afe9b4e3a0764108595c48c6 /ACE/ace/CDR_Stream.inl
parentb489eefef18d6c538d5498350bb732bc51792f50 (diff)
downloadATCD-2ed7fe7c1c6492c7f920581ec3ac8e7ec4278efd.tar.gz
Support int8/uint8 Sequences and Arrays
Diffstat (limited to 'ACE/ace/CDR_Stream.inl')
-rw-r--r--ACE/ace/CDR_Stream.inl77
1 files changed, 51 insertions, 26 deletions
diff --git a/ACE/ace/CDR_Stream.inl b/ACE/ace/CDR_Stream.inl
index 9e4380fbde1..5f0a55da680 100644
--- a/ACE/ace/CDR_Stream.inl
+++ b/ACE/ace/CDR_Stream.inl
@@ -162,6 +162,30 @@ ACE_OutputCDR::from_std_wstring::from_std_wstring (const std::wstring &ws,
#endif
ACE_INLINE
+ACE_InputCDR::to_int8::to_int8 (ACE_CDR::Int8 &ref)
+ : ref_ (ref)
+{
+}
+
+ACE_INLINE
+ACE_OutputCDR::from_int8::from_int8 (ACE_CDR::Int8 val)
+ : val_ (val)
+{
+}
+
+ACE_INLINE
+ACE_InputCDR::to_uint8::to_uint8 (ACE_CDR::UInt8 &ref)
+ : ref_ (ref)
+{
+}
+
+ACE_INLINE
+ACE_OutputCDR::from_uint8::from_uint8 (ACE_CDR::UInt8 val)
+ : val_ (val)
+{
+}
+
+ACE_INLINE
ACE_InputCDR::Transfer_Contents::Transfer_Contents (ACE_InputCDR &rhs)
: rhs_ (rhs)
{
@@ -1374,20 +1398,6 @@ operator<< (ACE_OutputCDR &os, const std::wstring& x)
}
#endif
-ACE_INLINE ACE_CDR::Boolean
-operator<< (ACE_OutputCDR &os, ACE_CDR::UInt8 x)
-{
- os.write_uint8 (x);
- return (ACE_CDR::Boolean) os.good_bit ();
-}
-
-ACE_INLINE ACE_CDR::Boolean
-operator<< (ACE_OutputCDR &os, ACE_CDR::Int8 x)
-{
- os.write_int8 (x);
- return (ACE_CDR::Boolean) os.good_bit ();
-}
-
// The following use the helper classes
ACE_INLINE ACE_CDR::Boolean
operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_boolean x)
@@ -1447,6 +1457,20 @@ operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_wstring x)
(ACE_CDR::Boolean) (os.good_bit () && (!x.bound_ || len <= x.bound_));
}
+ACE_INLINE ACE_CDR::Boolean
+operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_uint8 x)
+{
+ os.write_uint8 (x.val_);
+ return (ACE_CDR::Boolean) os.good_bit ();
+}
+
+ACE_INLINE ACE_CDR::Boolean
+operator<< (ACE_OutputCDR &os, ACE_OutputCDR::from_int8 x)
+{
+ os.write_int8 (x.val_);
+ return (ACE_CDR::Boolean) os.good_bit ();
+}
+
// ****************************************************************
ACE_INLINE ACE_CDR::Boolean
@@ -1541,18 +1565,6 @@ operator>> (ACE_InputCDR &is, std::wstring& x)
}
#endif
-ACE_INLINE ACE_CDR::Boolean
-operator>> (ACE_InputCDR &is, ACE_CDR::UInt8 &x)
-{
- return is.read_uint8 (x) && is.good_bit ();
-}
-
-ACE_INLINE ACE_CDR::Boolean
-operator>> (ACE_InputCDR &is, ACE_CDR::Int8 &x)
-{
- return is.read_int8 (x) && is.good_bit ();
-}
-
// The following use the helper classes
ACE_INLINE ACE_CDR::Boolean
operator>> (ACE_InputCDR &is, ACE_InputCDR::to_boolean x)
@@ -1623,6 +1635,19 @@ operator>> (ACE_InputCDR &is, ACE_InputCDR::to_std_wstring x)
|| static_cast<ACE_CDR::ULong> (x.val_.size ()) <= x.bound_));
}
#endif
+
+ACE_INLINE ACE_CDR::Boolean
+operator>> (ACE_InputCDR &is, ACE_InputCDR::to_uint8 x)
+{
+ return is.read_uint8 (x.ref_) && is.good_bit ();
+}
+
+ACE_INLINE ACE_CDR::Boolean
+operator>> (ACE_InputCDR &is, ACE_InputCDR::to_int8 x)
+{
+ return is.read_int8 (x.ref_) && is.good_bit ();
+}
+
// ***************************************************************************
// We must define these methods here because they use the "read_*" inlined
// methods of the ACE_InputCDR class