SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND


Namespace Platform::Util

namespace Platform::Util

Provides utility operations such as min, max, gcd, lcm, swap etc.

Inner Compounds, Typedefs, and Enumscollapse
class FileLog
          A file logger.
class ILog
          Provides interface for text message logging.

Method Summarycollapse
template <typename Type>
Type*
addressOf(Type& object)
          Retrieves the address of a specified object.
template <typename Type>
Type*
addressOf(Type object[])
          Retrieves the address of a specified array.
Bool clamp(Bool value, Bool minValue, Bool maxValue)
          Constrains a given value within the specified interval.
template <typename Type>
const Type&
clamp(const Type& value, const Type& minValue, const Type& maxValue)
          Constrains a given value within the specified interval.
template <typename Type,
typename Comparator>
const Type&
clamp(const Type& value, const Type& minValue, const Type& maxValue, Comparator compareFn)
          Constrains a given value within the specified interval.
Double clamp(Double value, Double minValue, Double maxValue)
          Constrains a given value within the specified interval.
Float clamp(Float value, Float minValue, Float maxValue)
          Constrains a given value within the specified interval.
Int clamp(Int value, Int minValue, Int maxValue)
          Constrains a given value within the specified interval.
LatinChar clamp(LatinChar value, LatinChar minValue, LatinChar maxValue)
          Constrains a given value within the specified interval.
Long clamp(Long value, Long minValue, Long maxValue)
          Constrains a given value within the specified interval.
Short clamp(Short value, Short minValue, Short maxValue)
          Constrains a given value within the specified interval.
Small clamp(Small value, Small minValue, Small maxValue)
          Constrains a given value within the specified interval.
UInt clamp(UInt value, UInt minValue, UInt maxValue)
          Constrains a given value within the specified interval.
ULong clamp(ULong value, ULong minValue, ULong maxValue)
          Constrains a given value within the specified interval.
UniChar clamp(UniChar value, UniChar minValue, UniChar maxValue)
          Constrains a given value within the specified interval.
UShort clamp(UShort value, UShort minValue, UShort maxValue)
          Constrains a given value within the specified interval.
USmall clamp(USmall value, USmall minValue, USmall maxValue)
          Constrains a given value within the specified interval.
UInt computeAdler32(UInt crc, const Void* ptr, Int size)
          Computes an Adler-32 checksum on an array of bytes.
UShort computeCRC16(UShort crc, const Void* ptr, Int size)
          Computes a CRC-16 checksum on an array of bytes.
UInt computeCRC32(UInt crc, const Void* ptr, Int size)
          Computes a CRC-32 checksum on an array of bytes.
Void computeMD5(Byte crc[16], const Void* ptr, Int size)
          Computes a MD5 checksum on an array of bytes.
String computeMD5AsString(const Void* ptr, Int size)
          Computes a MD5 checksum on an array of bytes.
template <typename Type>
Type
gcd(Type valueA, Type valueB)
          Computes the Greatest Common Divisor of values valueA and valueB.
template <typename Type>
UInt
identityHashCodeOf(const Type* object)
          Computes a 32-bit hash code for an address identifying an object.
template <typename Type>
Type
lcm(Type valueA, Type valueB)
          Computes the Least Common Multiple of values valueA and valueB.
ByteArray loadByteArray(const Path& path)
          Loads the contents of a file into the specified byte array.
Bool max(Bool valueA, Bool valueB)
          Returns the larger of two numbers.
template <typename Type>
const Type&
max(const Type& valueA, const Type& valueB)
          Returns the larger of two numbers.
template <typename Type,
typename Comparator>
const Type&
max(const Type& valueA, const Type& valueB, Comparator compareFn)
          Returns the larger of two numbers.
Double max(Double valueA, Double valueB)
          Returns the larger of two numbers.
Float max(Float valueA, Float valueB)
          Returns the larger of two numbers.
Int max(Int valueA, Int valueB)
          Returns the larger of two numbers.
LatinChar max(LatinChar valueA, LatinChar valueB)
          Returns the larger of two numbers.
Long max(Long valueA, Long valueB)
          Returns the larger of two numbers.
Short max(Short valueA, Short valueB)
          Returns the larger of two numbers.
Small max(Small valueA, Small valueB)
          Returns the larger of two numbers.
UInt max(UInt valueA, UInt valueB)
          Returns the larger of two numbers.
ULong max(ULong valueA, ULong valueB)
          Returns the larger of two numbers.
UniChar max(UniChar valueA, UniChar valueB)
          Returns the larger of two numbers.
UShort max(UShort valueA, UShort valueB)
          Returns the larger of two numbers.
USmall max(USmall valueA, USmall valueB)
          Returns the larger of two numbers.
Bool median3(Bool valueA, Bool valueB, Bool valueC)
          Returns the median of three numbers.
template <typename Type>
const Type&
median3(const Type& valueA, const Type& valueB, const Type& valueC)
          Returns the median of three numbers.
template <typename Type,
typename Comparator>
const Type&
median3(const Type& valueA, const Type& valueB, const Type& valueC, Comparator compareFn)
          Returns the median of three numbers.
Double median3(Double valueA, Double valueB, Double valueC)
          Returns the median of three numbers.
Float median3(Float valueA, Float valueB, Float valueC)
          Returns the median of three numbers.
Int median3(Int valueA, Int valueB, Int valueC)
          Returns the median of three numbers.
LatinChar median3(LatinChar valueA, LatinChar valueB, LatinChar valueC)
          Returns the median of three numbers.
Long median3(Long valueA, Long valueB, Long valueC)
          Returns the median of three numbers.
Short median3(Short valueA, Short valueB, Short valueC)
          Returns the median of three numbers.
Small median3(Small valueA, Small valueB, Small valueC)
          Returns the median of three numbers.
UInt median3(UInt valueA, UInt valueB, UInt valueC)
          Returns the median of three numbers.
ULong median3(ULong valueA, ULong valueB, ULong valueC)
          Returns the median of three numbers.
UniChar median3(UniChar valueA, UniChar valueB, UniChar valueC)
          Returns the median of three numbers.
UShort median3(UShort valueA, UShort valueB, UShort valueC)
          Returns the median of three numbers.
USmall median3(USmall valueA, USmall valueB, USmall valueC)
          Returns the median of three numbers.
Bool min(Bool valueA, Bool valueB)
          Returns the smaller of two numbers.
template <typename Type>
const Type&
min(const Type& valueA, const Type& valueB)
          Returns the smaller of two numbers.
template <typename Type,
typename Comparator>
const Type&
min(const Type& valueA, const Type& valueB, Comparator compareFn)
          Returns the smaller of two numbers.
Double min(Double valueA, Double valueB)
          Returns the smaller of two numbers.
Float min(Float valueA, Float valueB)
          Returns the smaller of two numbers.
Int min(Int valueA, Int valueB)
          Returns the smaller of two numbers.
LatinChar min(LatinChar valueA, LatinChar valueB)
          Returns the smaller of two numbers.
Long min(Long valueA, Long valueB)
          Returns the smaller of two numbers.
Short min(Short valueA, Short valueB)
          Returns the smaller of two numbers.
Small min(Small valueA, Small valueB)
          Returns the smaller of two numbers.
UInt min(UInt valueA, UInt valueB)
          Returns the smaller of two numbers.
ULong min(ULong valueA, ULong valueB)
          Returns the smaller of two numbers.
UniChar min(UniChar valueA, UniChar valueB)
          Returns the smaller of two numbers.
UShort min(UShort valueA, UShort valueB)
          Returns the smaller of two numbers.
USmall min(USmall valueA, USmall valueB)
          Returns the smaller of two numbers.
Void nop()
          A dummy function with no side effects.
template <typename Type>
Type
power(Type base, UInt exponent)
          Returns the value of base raised to the power of exponent.
template <typename Type>
Type
reverseEndian(Type value)
          Swaps the byte-order of a given value.
template <typename Type>
Type
roundUp(Type value, UInt alignment)
          Rounds up the value argument to the specified alignment.
template <typename Type>
Void
swap(Type& objectA, Type& objectB)
          Swaps the contents of two specified objects.
template <typename Type>
Type
toBigEndian(Type value)
          Swaps the byte-order of a given value on LittleEndian machines.
template <typename Type>
Type
toLittleEndian(Type value)
          Swaps the byte-order of a given value on BigEndian machines.
template <typename Type>
const Type&
valueOf(const Type& object)
          Retrieves the value of a specified object.
template <typename Type>
const Type&
valueOf(const Type* object)
          Retrieves the value of a specified object.
template <typename Type>
Type&
valueOf(Type& object)
          Retrieves the value of a specified object.
template <typename Type>
Type&
valueOf(Type* object)
          Retrieves the value of a specified object.

 

Method Detail

addressOf[nothrow, inline]

template <typename Type>
Type* addressOf(Type& object)

Retrieves the address of a specified object.

Parameters:
object - an object to take address of
Returns:
the address of (pointer to) object

addressOf[nothrow, inline]

template <typename Type>
Type* addressOf(Type object[])

Retrieves the address of a specified array.

Parameters:
object - an array to take address of
Returns:
the address of (pointer to) the first element in the array

clamp[nothrow, inline]

Bool clamp(Bool value, Bool minValue, Bool maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[inline]

template <typename Type>
const Type& clamp(const Type& value, const Type& minValue, const Type& maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by Lang::TypeActors::Comparator<Type>().

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue
See Also:
Lang::TypeActors::Comparator

clamp[inline]

template <typename Type, typename Comparator>
const Type& clamp(const Type& value, const Type& minValue, const Type& maxValue, Comparator compareFn)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by the specified Comparator.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
compareFn - comparator function
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue
See Also:
Lang::TypeActors::Comparator

clamp[nothrow, inline]

Double clamp(Double value, Double minValue, Double maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

Float clamp(Float value, Float minValue, Float maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

Int clamp(Int value, Int minValue, Int maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

LatinChar clamp(LatinChar value, LatinChar minValue, LatinChar maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

Long clamp(Long value, Long minValue, Long maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

Short clamp(Short value, Short minValue, Short maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

Small clamp(Small value, Small minValue, Small maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

UInt clamp(UInt value, UInt minValue, UInt maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

ULong clamp(ULong value, ULong minValue, ULong maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

UniChar clamp(UniChar value, UniChar minValue, UniChar maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

UShort clamp(UShort value, UShort minValue, UShort maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

clamp[nothrow, inline]

USmall clamp(USmall value, USmall minValue, USmall maxValue)

Constrains a given value within the specified interval. The result of this function is guaranteed to be no smaller than the specified minValue and no greater than maxValue.

Parameters:
value - argument to be clamped
minValue - the lower end of the interval
maxValue - the upper end if the interval
Returns:
a value in range [minValue, maxValue] such that minValue <= value <= maxValue

computeAdler32[nothrow]

UInt computeAdler32(UInt crc, const Void* ptr, Int size)

Computes an Adler-32 checksum on an array of bytes.

Parameters:
crc - the initial crc
ptr - pointer to the first byte in the array
size - the number of bytes in the array
Returns:
computed CRC-32 checksum value

computeCRC16[nothrow]

UShort computeCRC16(UShort crc, const Void* ptr, Int size)

Computes a CRC-16 checksum on an array of bytes.

Parameters:
crc - the initial crc
ptr - pointer to the first byte in the array
size - the number of bytes in the array
Returns:
computed CRC-16 checksum value

computeCRC32[nothrow]

UInt computeCRC32(UInt crc, const Void* ptr, Int size)

Computes a CRC-32 checksum on an array of bytes.

Parameters:
crc - the initial crc
ptr - pointer to the first byte in the array
size - the number of bytes in the array
Returns:
computed CRC-32 checksum value

computeMD5[nothrow]

Void computeMD5(Byte crc[16], const Void* ptr, Int size)

Computes a MD5 checksum on an array of bytes.

Parameters:
crc - the initial crc, updated upon return
ptr - pointer to the first byte in the array
size - the number of bytes in the array

computeMD5AsString[nothrow]

String computeMD5AsString(const Void* ptr, Int size)

Computes a MD5 checksum on an array of bytes.

Parameters:
ptr - pointer to the first byte in the array
size - the number of bytes in the array
Returns:
a string representing the computed MD5 checksum value

gcd[inline]

template <typename Type>
Type gcd(Type valueA, Type valueB)

Computes the Greatest Common Divisor of values valueA and valueB.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the largest divisor common to valueA and valueB
Preconditions:
valueA != 0, valueB != 0
See Also:
Util::lcm

identityHashCodeOf[nothrow, inline]

template <typename Type>
UInt identityHashCodeOf(const Type* object)

Computes a 32-bit hash code for an address identifying an object.

Parameters:
object - address of an object
Returns:
hash code

lcm[inline]

template <typename Type>
Type lcm(Type valueA, Type valueB)

Computes the Least Common Multiple of values valueA and valueB.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smallest number N for which there exist positive integers Na and Nb such that Na * valueA == Nb * valueB == N
Preconditions:
valueA != 0, valueB != 0
See Also:
Util::gcd

loadByteArray[inline]

ByteArray loadByteArray(const Path& path)

Loads the contents of a file into the specified byte array.

Parameters:
path - the path to the file
Returns:
a byte array containing the contents of the loaded file
Throws:
InvalidFileNameException - if the specified path is invalid
InvalidFileHandleException - if the file handle is invalid
FileNotFoundException - if the file cannot be found
AccessDeniedException - if the file is inaccessible
FileException - if the operation failed

max[nothrow, inline]

Bool max(Bool valueA, Bool valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[inline]

template <typename Type>
const Type& max(const Type& valueA, const Type& valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by Lang::TypeActors::Comparator<Type>().

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB
See Also:
Lang::TypeActors::Comparator

max[inline]

template <typename Type, typename Comparator>
const Type& max(const Type& valueA, const Type& valueB, Comparator compareFn)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by the specified Comparator.

Parameters:
valueA - first argument
valueB - second argument
compareFn - comparator function
Returns:
the larger of valueA and valueB
See Also:
Lang::TypeActors::Comparator

max[nothrow, inline]

Double max(Double valueA, Double valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

Float max(Float valueA, Float valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

Int max(Int valueA, Int valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

LatinChar max(LatinChar valueA, LatinChar valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

Long max(Long valueA, Long valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

Short max(Short valueA, Short valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

Small max(Small valueA, Small valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

UInt max(UInt valueA, UInt valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

ULong max(ULong valueA, ULong valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

UniChar max(UniChar valueA, UniChar valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

UShort max(UShort valueA, UShort valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

max[nothrow, inline]

USmall max(USmall valueA, USmall valueB)

Returns the larger of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the larger of valueA and valueB

median3[nothrow, inline]

Bool median3(Bool valueA, Bool valueB, Bool valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[inline]

template <typename Type>
const Type& median3(const Type& valueA, const Type& valueB, const Type& valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by Lang::TypeActors::Comparator<Type>().

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC
See Also:
Lang::TypeActors::Comparator

median3[inline]

template <typename Type, typename Comparator>
const Type& median3(const Type& valueA, const Type& valueB, const Type& valueC, Comparator compareFn)

Returns the median of three numbers. If the arguments have the same value, the result is that same value. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by the specified Comparator.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
compareFn - comparator function
Returns:
the median of valueA, valueB and valueC
See Also:
Lang::TypeActors::Comparator

median3[nothrow, inline]

Double median3(Double valueA, Double valueB, Double valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

Float median3(Float valueA, Float valueB, Float valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

Int median3(Int valueA, Int valueB, Int valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

LatinChar median3(LatinChar valueA, LatinChar valueB, LatinChar valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

Long median3(Long valueA, Long valueB, Long valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

Short median3(Short valueA, Short valueB, Short valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

Small median3(Small valueA, Small valueB, Small valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

UInt median3(UInt valueA, UInt valueB, UInt valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

ULong median3(ULong valueA, ULong valueB, ULong valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

UniChar median3(UniChar valueA, UniChar valueB, UniChar valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

UShort median3(UShort valueA, UShort valueB, UShort valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

median3[nothrow, inline]

USmall median3(USmall valueA, USmall valueB, USmall valueC)

Returns the median of three numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
valueC - third argument
Returns:
the median of valueA, valueB and valueC

min[nothrow, inline]

Bool min(Bool valueA, Bool valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[inline]

template <typename Type>
const Type& min(const Type& valueA, const Type& valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by Lang::TypeActors::Comparator<Type>().

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB
See Also:
Lang::TypeActors::Comparator

min[inline]

template <typename Type, typename Comparator>
const Type& min(const Type& valueA, const Type& valueB, Comparator compareFn)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value. This is a generic function that can be used with any Type that is comparable, e.g. a type for which the total ordering relation on Type can be determined by the specified Comparator.

Parameters:
valueA - first argument
valueB - second argument
compareFn - comparator function
Returns:
the smaller of valueA and valueB
See Also:
Lang::TypeActors::Comparator

min[nothrow, inline]

Double min(Double valueA, Double valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

Float min(Float valueA, Float valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

Int min(Int valueA, Int valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

LatinChar min(LatinChar valueA, LatinChar valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

Long min(Long valueA, Long valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

Short min(Short valueA, Short valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

Small min(Small valueA, Small valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

UInt min(UInt valueA, UInt valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

ULong min(ULong valueA, ULong valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

UniChar min(UniChar valueA, UniChar valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

UShort min(UShort valueA, UShort valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

min[nothrow, inline]

USmall min(USmall valueA, USmall valueB)

Returns the smaller of two numbers. If the arguments have the same value, the result is that same value.

Parameters:
valueA - first argument
valueB - second argument
Returns:
the smaller of valueA and valueB

nop[nothrow, inline]

Void nop()

A dummy function with no side effects. Can be used to insert artificial sequence points, for example for use with debugger.


power[inline]

template <typename Type>
Type power(Type base, UInt exponent)

Returns the value of base raised to the power of exponent.

Parameters:
base - the base
exponent - the exponent
Returns:
the result of baseexponent

reverseEndian[inline]

template <typename Type>
Type reverseEndian(Type value)

Swaps the byte-order of a given value.

Parameters:
value - a number whose byte-order is to be reversed
Returns:
byte-swapped value
See Also:
toLittleEndian, toBigEndian, Runtime::isBigEndian, Runtime::isLittleEndian

roundUp[nothrow, inline]

template <typename Type>
Type roundUp(Type value, UInt alignment)

Rounds up the value argument to the specified alignment.

Parameters:
value - an integral number that is to be rounded up
alignment - the alignment factor, must be a power of 2
Returns:
value rounded up to the specified alignment

swap[inline]

template <typename Type>
Void swap(Type& objectA, Type& objectB)

Swaps the contents of two specified objects.

Parameters:
objectA - first object
objectB - second object

toBigEndian[inline]

template <typename Type>
Type toBigEndian(Type value)

Swaps the byte-order of a given value on LittleEndian machines. On BigEndian machines this is a no-op function.

Parameters:
value - a number whose byte-order is to be converted to BigEndian
Returns:
byte-swapped value on LittleEndian machines, unmodified value on BigEndian machines
See Also:
reverseEndian, Runtime::isBigEndian, Runtime::isLittleEndian

toLittleEndian[inline]

template <typename Type>
Type toLittleEndian(Type value)

Swaps the byte-order of a given value on BigEndian machines. On LittleEndian machines this is a no-op function.

Parameters:
value - a number whose byte-order is to be converted to LittleEndian
Returns:
byte-swapped value on BigEndian machines, unmodified value on LittleEndian machines
See Also:
reverseEndian, Runtime::isBigEndian, Runtime::isLittleEndian

valueOf[nothrow, inline]

template <typename Type>
const Type& valueOf(const Type& object)

Retrieves the value of a specified object. For pointer types the pointer is automatically dereferenced.

Parameters:
object - an object to retrieve value of
Returns:
the value of the specified object

valueOf[nothrow, inline]

template <typename Type>
const Type& valueOf(const Type* object)

Retrieves the value of a specified object. For pointer types the pointer is automatically dereferenced.

Parameters:
object - an object to retrieve value of
Returns:
the value of the specified object

valueOf[nothrow, inline]

template <typename Type>
Type& valueOf(Type& object)

Retrieves the value of a specified object. For pointer types the pointer is automatically dereferenced.

Parameters:
object - an object to retrieve value of
Returns:
the value of the specified object

valueOf[nothrow, inline]

template <typename Type>
Type& valueOf(Type* object)

Retrieves the value of a specified object. For pointer types the pointer is automatically dereferenced.

Parameters:
object - an object to retrieve value of
Returns:
the value of the specified object


SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND