8#ifndef INCLUDED_BDLB_BIGENDIAN
9#define INCLUDED_BDLB_BIGENDIAN
139#include <bdlscm_version.h>
150#include <bsl_iosfwd.h>
195#ifndef BDE_OMIT_INTERNAL_DEPRECATED
235 template <
class STREAM>
242 operator short()
const;
253 bsl::ostream&
print(bsl::ostream& stream,
255 int spacesPerLevel = 4)
const;
264 template <
class STREAM>
290template <
class HASH_ALGORITHM>
315 unsigned short d_value;
335#ifndef BDE_OMIT_INTERNAL_DEPRECATED
375 template <
class STREAM>
382 operator unsigned short()
const;
393 bsl::ostream&
print(bsl::ostream& stream,
395 int spacesPerLevel = 4)
const;
404 template <
class STREAM>
430template <
class HASH_ALGORITHM>
473#ifndef BDE_OMIT_INTERNAL_DEPRECATED
512 template <
class STREAM>
519 operator int()
const;
530 bsl::ostream&
print(bsl::ostream& stream,
532 int spacesPerLevel = 4)
const;
541 template <
class STREAM>
567template <
class HASH_ALGORITHM>
592 unsigned int d_value;
612#ifndef BDE_OMIT_INTERNAL_DEPRECATED
651 template <
class STREAM>
658 operator unsigned int()
const;
669 bsl::ostream&
print(bsl::ostream& stream,
671 int spacesPerLevel = 4)
const;
680 template <
class STREAM>
706template <
class HASH_ALGORITHM>
749#ifndef BDE_OMIT_INTERNAL_DEPRECATED
789 template <
class STREAM>
807 bsl::ostream&
print(bsl::ostream& stream,
809 int spacesPerLevel = 4)
const;
818 template <
class STREAM>
844template <
class HASH_ALGORITHM>
889#ifndef BDE_OMIT_INTERNAL_DEPRECATED
928 template <
class STREAM>
946 bsl::ostream&
print(bsl::ostream& stream,
948 int spacesPerLevel = 4)
const;
957 template <
class STREAM>
982template <
class HASH_ALGORITHM>
1001#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1023template <
class STREAM>
1029 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1033 stream.invalidate();
1043bdlb::BigEndianInt16::operator short()
const
1049template <
class STREAM>
1054 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1058 stream.invalidate();
1069 return lhs.d_value == rhs.d_value;
1075 return lhs.d_value != rhs.d_value;
1080 const BigEndianInt16& integer)
1082 integer.print(stream, 0, -1);
1086template <
class HASH_ALGORITHM>
1089 const BigEndianInt16&
object)
1091 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1092 sizeof(BigEndianInt16));
1108#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1130template <
class STREAM>
1136 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1140 stream.invalidate();
1150bdlb::BigEndianUint16::operator
unsigned short()
const
1156template <
class STREAM>
1161 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1165 stream.invalidate();
1174bool bdlb::operator==(
const BigEndianUint16& lhs,
const BigEndianUint16& rhs)
1176 return lhs.d_value == rhs.d_value;
1180bool bdlb::operator!=(
const BigEndianUint16& lhs,
const BigEndianUint16& rhs)
1182 return lhs.d_value != rhs.d_value;
1187 const BigEndianUint16& integer)
1189 integer.print(stream, 0, -1);
1193template <
class HASH_ALGORITHM>
1196 const BigEndianUint16&
object)
1198 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1199 sizeof(BigEndianUint16));
1215#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1237template <
class STREAM>
1242 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1246 stream.invalidate();
1255bdlb::BigEndianInt32::operator int()
const
1261template <
class STREAM>
1266 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1270 stream.invalidate();
1281 return lhs.d_value == rhs.d_value;
1287 return lhs.d_value != rhs.d_value;
1292 const BigEndianInt32& integer)
1294 integer.print(stream, 0, -1);
1298template <
class HASH_ALGORITHM>
1301 const BigEndianInt32&
object)
1303 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1304 sizeof(BigEndianInt32));
1320#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1342template <
class STREAM>
1348 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1352 stream.invalidate();
1362bdlb::BigEndianUint32::operator
unsigned int()
const
1368template <
class STREAM>
1373 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1377 stream.invalidate();
1386bool bdlb::operator==(
const BigEndianUint32& lhs,
const BigEndianUint32& rhs)
1388 return lhs.d_value == rhs.d_value;
1392bool bdlb::operator!=(
const BigEndianUint32& lhs,
const BigEndianUint32& rhs)
1394 return lhs.d_value != rhs.d_value;
1399 const BigEndianUint32& integer)
1401 integer.print(stream, 0, -1);
1405template <
class HASH_ALGORITHM>
1408 const BigEndianUint32&
object)
1410 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1411 sizeof(BigEndianUint32));
1427#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1449template <
class STREAM>
1454 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1458 stream.invalidate();
1473template <
class STREAM>
1474STREAM& BigEndianInt64::bdexStreamOut(STREAM& stream,
int version)
const
1478 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1482 stream.invalidate();
1493 return lhs.d_value == rhs.d_value;
1499 return lhs.d_value != rhs.d_value;
1504 const BigEndianInt64& integer)
1506 integer.print(stream, 0, -1);
1510template <
class HASH_ALGORITHM>
1513 const BigEndianInt64&
object)
1515 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1516 sizeof(BigEndianInt64));
1532#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1534int BigEndianUint64::maxSupportedBdexVersion()
1536 return maxSupportedBdexVersion(0);
1541int BigEndianUint64::maxSupportedBdexVersion(
int )
1554template <
class STREAM>
1555STREAM& BigEndianUint64::bdexStreamIn(STREAM& stream,
int version)
1559 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1563 stream.invalidate();
1578template <
class STREAM>
1579STREAM& BigEndianUint64::bdexStreamOut(STREAM& stream,
int version)
const
1583 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1587 stream.invalidate();
1596bool bdlb::operator==(
const BigEndianUint64& lhs,
const BigEndianUint64& rhs)
1598 return lhs.d_value == rhs.d_value;
1602bool bdlb::operator!=(
const BigEndianUint64& lhs,
const BigEndianUint64& rhs)
1604 return lhs.d_value != rhs.d_value;
1609 const BigEndianUint64& integer)
1611 integer.print(stream, 0, -1);
1615template <
class HASH_ALGORITHM>
1618 const BigEndianUint64&
object)
1620 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1621 sizeof(BigEndianUint64));
Definition bdlb_bigendian.h:173
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianInt16, bsl::is_trivially_copyable)
BigEndianInt16(const BigEndianInt16 &other)=default
friend bool operator==(const BigEndianInt16 &lhs, const BigEndianInt16 &rhs)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
friend bool operator!=(const BigEndianInt16 &lhs, const BigEndianInt16 &rhs)
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianInt16, bdlb::HasPrintMethod)
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1003
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1050
~BigEndianInt16()=default
BigEndianInt16 & operator=(const BigEndianInt16 &other)=default
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1024
static BigEndianInt16 make(short value)
Definition bdlb_bigendian.h:995
Definition bdlb_bigendian.h:451
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianInt32, bsl::is_trivially_copyable)
friend bool operator!=(const BigEndianInt32 &lhs, const BigEndianInt32 &rhs)
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1262
BigEndianInt32 & operator=(const BigEndianInt32 &other)=default
friend bool operator==(const BigEndianInt32 &lhs, const BigEndianInt32 &rhs)
BigEndianInt32(const BigEndianInt32 &other)=default
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1238
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
~BigEndianInt32()=default
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1217
static BigEndianInt32 make(int value)
Definition bdlb_bigendian.h:1209
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianInt32, bdlb::HasPrintMethod)
Definition bdlb_bigendian.h:727
friend bool operator==(const BigEndianInt64 &lhs, const BigEndianInt64 &rhs)
BigEndianInt64 & operator=(const BigEndianInt64 &other)=default
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianInt64, bsl::is_trivially_copyable)
BigEndianInt64(const BigEndianInt64 &other)=default
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1429
friend bool operator!=(const BigEndianInt64 &lhs, const BigEndianInt64 &rhs)
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1474
static BigEndianInt64 make(bsls::Types::Int64 value)
Definition bdlb_bigendian.h:1421
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
~BigEndianInt64()=default
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianInt64, bdlb::HasPrintMethod)
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1450
Definition bdlb_bigendian.h:312
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1157
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1110
BigEndianUint16 & operator=(const BigEndianUint16 &other)=default
~BigEndianUint16()=default
BigEndianUint16()=default
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianUint16, bdlb::HasPrintMethod)
static BigEndianUint16 make(unsigned short value)
Definition bdlb_bigendian.h:1102
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1131
BigEndianUint16(const BigEndianUint16 &other)=default
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
friend bool operator!=(const BigEndianUint16 &lhs, const BigEndianUint16 &rhs)
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianUint16, bsl::is_trivially_copyable)
friend bool operator==(const BigEndianUint16 &lhs, const BigEndianUint16 &rhs)
Definition bdlb_bigendian.h:589
BigEndianUint32(const BigEndianUint32 &other)=default
BigEndianUint32 & operator=(const BigEndianUint32 &other)=default
static BigEndianUint32 make(unsigned int value)
Definition bdlb_bigendian.h:1314
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianUint32, bsl::is_trivially_copyable)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
~BigEndianUint32()=default
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1322
BigEndianUint32()=default
friend bool operator!=(const BigEndianUint32 &lhs, const BigEndianUint32 &rhs)
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianUint32, bdlb::HasPrintMethod)
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1343
friend bool operator==(const BigEndianUint32 &lhs, const BigEndianUint32 &rhs)
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1369
Definition bdlb_bigendian.h:866
BigEndianUint64()=default
friend bool operator!=(const BigEndianUint64 &lhs, const BigEndianUint64 &rhs)
~BigEndianUint64()=default
BigEndianUint64(const BigEndianUint64 &other)=default
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1579
BigEndianUint64 & operator=(const BigEndianUint64 &other)=default
static BigEndianUint64 make(bsls::Types::Uint64 value)
Definition bdlb_bigendian.h:1526
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianUint64, bsl::is_trivially_copyable)
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1534
friend bool operator==(const BigEndianUint64 &lhs, const BigEndianUint64 &rhs)
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianUint64, bdlb::HasPrintMethod)
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1555
#define BSLS_BYTEORDER_BE_U16_TO_HOST(x)
Definition bsls_byteorder.h:369
#define BSLS_BYTEORDER_HOST_U16_TO_BE(x)
Definition bsls_byteorder.h:373
#define BSLS_BYTEORDER_HOST_U32_TO_BE(x)
Definition bsls_byteorder.h:374
#define BSLS_BYTEORDER_BE_U32_TO_HOST(x)
Definition bsls_byteorder.h:370
#define BSLS_BYTEORDER_BE_U64_TO_HOST(x)
Definition bsls_byteorder.h:371
#define BSLS_BYTEORDER_HOST_U64_TO_BE(x)
Definition bsls_byteorder.h:375
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlb_algorithmworkaroundutil.h:74
bool operator!=(const BigEndianInt16 &lhs, const BigEndianInt16 &rhs)
bsl::ostream & operator<<(bsl::ostream &stream, const BigEndianInt16 &integer)
void hashAppend(HASH_ALGORITHM &hashAlgorithm, const BigEndianInt16 &object)
bool operator==(const BigEndianInt16 &lhs, const BigEndianInt16 &rhs)
Definition bdlb_printmethods.h:306
Definition bslmf_istriviallycopyable.h:329
unsigned long long Uint64
Definition bsls_types.h:137
long long Int64
Definition bsls_types.h:132