BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsls::PlatformUtil Struct Reference

#include <bsls_platformutil.h>

Detailed Description

Provide a namespace for a suite of typedefs and pure procedures that encapsulate, platform-dependent types and APIs.

See bsls_platformutil

Public Types

typedef Types::size_type size_type
 
typedef Types::UintPtr UintPtr
 
typedef Types::IntPtr IntPtr
 
typedef Types::Int64 Int64
 
typedef Types::Uint64 Uint64
 
typedef AlignmentUtil::MaxAlignedType MaxAlign
 

Static Public Member Functions

static bool isBigEndian ()
 
static bool isLittleEndian ()
 
static int roundUpToMaximalAlignment (int size)
 

Member Typedef Documentation

◆ Int64

◆ IntPtr

The aliases UintPtr and IntPtr are guaranteed to have the same size as pointers.

Deprecated:
Use Types::UintPtr` and `TypesIntPtr instead.

◆ MaxAlign

The alias MaxAlign refers to a type that is maximally-aligned on the current platform.

Deprecated:
Use AlignmentUtil::MaxAlignedType instead.

◆ size_type

The alias size_type refers to the preferred type for denoting a number of elements in either bslma allocators or container types.

Note
Note that this type is signed, as negative values may make sense in certain contexts. Also note that the standard-compliant allocators (e.g., bsl::allocator and std::allocator) use an unsigned size type, but that is fine because they also have a mechanism (max_size ) to determine overflows resulting from converting from one size type to the other.
Deprecated:
Use Types::size_type instead.

◆ Uint64

The aliases Int64 and Uint64 stand for whatever type Types implements for the appropriate supported platforms.

Deprecated:
Use Types::Int64` and `TypesUint64 instead.

◆ UintPtr

Member Function Documentation

◆ isBigEndian()

bool bsls::PlatformUtil::isBigEndian ( )
inlinestatic

Return true if this platform is "big-endian", and false otherwise.

Note
Note that "big-endian" (i.e., the most significant byte of data at the lowest byte address) is consistent with network byte order.
Deprecated:
Use preprocessor macro BSLS_PLATFORM_IS_BIG_ENDIAN defined in bsls_platform instead.

◆ isLittleEndian()

bool bsls::PlatformUtil::isLittleEndian ( )
inlinestatic

Return true if this platform is "little-endian", and false otherwise.

Note
Note that "little-endian" (i.e., the least significant byte of data at the lowest byte address) is inconsistent with network byte order.
Deprecated:
Use preprocessor macro BSLS_PLATFORMUTIL_IS_BIG_ENDIAN defined in bsls_platform instead.

◆ roundUpToMaximalAlignment()

int bsls::PlatformUtil::roundUpToMaximalAlignment ( int  size)
inlinestatic

Return the specified size (in bytes) rounded up to the smallest integral multiple of the maximum alignment.

Precondition
The behavior is undefined unless 0 <= size.

lmf_ForwardingTypeDEPRECATED: Use AlignmentUtil::roundUpToMaximalAlignment instead.


The documentation for this struct was generated from the following file: