8#ifndef INCLUDED_BDLB_BIGENDIAN
9#define INCLUDED_BDLB_BIGENDIAN
139#include <bdlscm_version.h>
150#include <bsl_iosfwd.h>
196#ifndef BDE_OMIT_INTERNAL_DEPRECATED
238 template <
class STREAM>
245 operator short()
const;
256 bsl::ostream&
print(bsl::ostream& stream,
258 int spacesPerLevel = 4)
const;
268 template <
class STREAM>
294template <
class HASH_ALGORITHM>
320 unsigned short d_value;
340#ifndef BDE_OMIT_INTERNAL_DEPRECATED
382 template <
class STREAM>
389 operator unsigned short()
const;
400 bsl::ostream&
print(bsl::ostream& stream,
402 int spacesPerLevel = 4)
const;
412 template <
class STREAM>
438template <
class HASH_ALGORITHM>
482#ifndef BDE_OMIT_INTERNAL_DEPRECATED
523 template <
class STREAM>
530 operator int()
const;
541 bsl::ostream&
print(bsl::ostream& stream,
543 int spacesPerLevel = 4)
const;
553 template <
class STREAM>
579template <
class HASH_ALGORITHM>
605 unsigned int d_value;
625#ifndef BDE_OMIT_INTERNAL_DEPRECATED
666 template <
class STREAM>
673 operator unsigned int()
const;
684 bsl::ostream&
print(bsl::ostream& stream,
686 int spacesPerLevel = 4)
const;
696 template <
class STREAM>
722template <
class HASH_ALGORITHM>
766#ifndef BDE_OMIT_INTERNAL_DEPRECATED
808 template <
class STREAM>
826 bsl::ostream&
print(bsl::ostream& stream,
828 int spacesPerLevel = 4)
const;
838 template <
class STREAM>
864template <
class HASH_ALGORITHM>
910#ifndef BDE_OMIT_INTERNAL_DEPRECATED
951 template <
class STREAM>
969 bsl::ostream&
print(bsl::ostream& stream,
971 int spacesPerLevel = 4)
const;
981 template <
class STREAM>
1006template <
class HASH_ALGORITHM>
1025#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1047template <
class STREAM>
1053 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1057 stream.invalidate();
1067bdlb::BigEndianInt16::operator short()
const
1073template <
class STREAM>
1078 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1082 stream.invalidate();
1093 return lhs.d_value == rhs.d_value;
1099 return lhs.d_value !=
rhs.d_value;
1104 const BigEndianInt16& integer)
1106 integer.print(stream, 0, -1);
1110template <
class HASH_ALGORITHM>
1113 const BigEndianInt16&
object)
1115 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1116 sizeof(BigEndianInt16));
1132#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1154template <
class STREAM>
1160 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1164 stream.invalidate();
1174bdlb::BigEndianUint16::operator
unsigned short()
const
1180template <
class STREAM>
1185 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1189 stream.invalidate();
1198bool bdlb::operator==(
const BigEndianUint16& lhs,
const BigEndianUint16& rhs)
1200 return lhs.d_value == rhs.d_value;
1204bool bdlb::operator!=(
const BigEndianUint16& lhs,
const BigEndianUint16& rhs)
1206 return lhs.d_value !=
rhs.d_value;
1211 const BigEndianUint16& integer)
1213 integer.print(stream, 0, -1);
1217template <
class HASH_ALGORITHM>
1220 const BigEndianUint16&
object)
1222 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1223 sizeof(BigEndianUint16));
1239#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1261template <
class STREAM>
1266 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1270 stream.invalidate();
1279bdlb::BigEndianInt32::operator int()
const
1285template <
class STREAM>
1290 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1294 stream.invalidate();
1305 return lhs.d_value == rhs.d_value;
1311 return lhs.d_value !=
rhs.d_value;
1316 const BigEndianInt32& integer)
1318 integer.print(stream, 0, -1);
1322template <
class HASH_ALGORITHM>
1325 const BigEndianInt32&
object)
1327 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1328 sizeof(BigEndianInt32));
1344#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1366template <
class STREAM>
1372 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1376 stream.invalidate();
1386bdlb::BigEndianUint32::operator
unsigned int()
const
1392template <
class STREAM>
1397 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1401 stream.invalidate();
1410bool bdlb::operator==(
const BigEndianUint32& lhs,
const BigEndianUint32& rhs)
1412 return lhs.d_value == rhs.d_value;
1416bool bdlb::operator!=(
const BigEndianUint32& lhs,
const BigEndianUint32& rhs)
1418 return lhs.d_value !=
rhs.d_value;
1423 const BigEndianUint32& integer)
1425 integer.print(stream, 0, -1);
1429template <
class HASH_ALGORITHM>
1432 const BigEndianUint32&
object)
1434 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1435 sizeof(BigEndianUint32));
1451#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1473template <
class STREAM>
1478 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1482 stream.invalidate();
1497template <
class STREAM>
1498STREAM& BigEndianInt64::bdexStreamOut(STREAM& stream,
int version)
const
1502 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1506 stream.invalidate();
1517 return lhs.d_value == rhs.d_value;
1523 return lhs.d_value !=
rhs.d_value;
1528 const BigEndianInt64& integer)
1530 integer.print(stream, 0, -1);
1534template <
class HASH_ALGORITHM>
1537 const BigEndianInt64&
object)
1539 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1540 sizeof(BigEndianInt64));
1556#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1558int BigEndianUint64::maxSupportedBdexVersion()
1560 return maxSupportedBdexVersion(0);
1565int BigEndianUint64::maxSupportedBdexVersion(
int )
1578template <
class STREAM>
1579STREAM& BigEndianUint64::bdexStreamIn(STREAM& stream,
int version)
1583 stream.getArrayUint8(
reinterpret_cast<unsigned char *
>(&d_value),
1587 stream.invalidate();
1602template <
class STREAM>
1603STREAM& BigEndianUint64::bdexStreamOut(STREAM& stream,
int version)
const
1607 stream.putArrayUint8(
reinterpret_cast<const unsigned char *
>(&d_value),
1611 stream.invalidate();
1620bool bdlb::operator==(
const BigEndianUint64& lhs,
const BigEndianUint64& rhs)
1622 return lhs.d_value == rhs.d_value;
1626bool bdlb::operator!=(
const BigEndianUint64& lhs,
const BigEndianUint64& rhs)
1628 return lhs.d_value !=
rhs.d_value;
1633 const BigEndianUint64& integer)
1635 integer.print(stream, 0, -1);
1639template <
class HASH_ALGORITHM>
1642 const BigEndianUint64&
object)
1644 hashAlgorithm(
reinterpret_cast<const char *
>(&
object),
1645 sizeof(BigEndianUint64));
Definition bdlb_bigendian.h:174
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:1027
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1074
~BigEndianInt16()=default
BigEndianInt16 & operator=(const BigEndianInt16 &other)=default
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1048
static BigEndianInt16 make(short value)
Definition bdlb_bigendian.h:1019
Definition bdlb_bigendian.h:460
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:1286
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:1262
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
~BigEndianInt32()=default
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1241
static BigEndianInt32 make(int value)
Definition bdlb_bigendian.h:1233
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianInt32, bdlb::HasPrintMethod)
Definition bdlb_bigendian.h:744
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:1453
friend bool operator!=(const BigEndianInt64 &lhs, const BigEndianInt64 &rhs)
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1498
static BigEndianInt64 make(bsls::Types::Int64 value)
Definition bdlb_bigendian.h:1445
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:1474
Definition bdlb_bigendian.h:317
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1181
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1134
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:1126
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlb_bigendian.h:1155
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:602
BigEndianUint32(const BigEndianUint32 &other)=default
BigEndianUint32 & operator=(const BigEndianUint32 &other)=default
static BigEndianUint32 make(unsigned int value)
Definition bdlb_bigendian.h:1338
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:1346
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:1367
friend bool operator==(const BigEndianUint32 &lhs, const BigEndianUint32 &rhs)
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlb_bigendian.h:1393
Definition bdlb_bigendian.h:887
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:1603
BigEndianUint64 & operator=(const BigEndianUint64 &other)=default
static BigEndianUint64 make(bsls::Types::Uint64 value)
Definition bdlb_bigendian.h:1550
BSLMF_NESTED_TRAIT_DECLARATION(BigEndianUint64, bsl::is_trivially_copyable)
static int maxSupportedBdexVersion()
Definition bdlb_bigendian.h:1558
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:1579
#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)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
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)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
ALLOCATOR & lhs
Definition bslstl_string.h:3917
Definition bdlb_printmethods.h:306
Definition bslmf_istriviallycopyable.h:324
unsigned long long Uint64
Definition bsls_types.h:139
long long Int64
Definition bsls_types.h:134