Click or drag to resize

UInt24 Structure

Represents a 3-byte, 24-bit unsigned integer.
Inheritance Hierarchy
SystemObject
  SystemValueType
    GSFUInt24

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.205-beta+5ef4169f3b1079d8b163dd363614f656bd140924
Syntax
View Source

The UInt24 type exposes the following members.

Constructors
 NameDescription
Public methodUInt24(UInt24)Creates 24-bit unsigned integer from an existing 24-bit unsigned integer.
Public methodUInt24(UInt32)Creates 24-bit unsigned integer from a 32-bit unsigned integer.
Public methodUInt24(Byte, Int32)Creates 24-bit unsigned integer from three bytes at a specified position in a byte array.
Top
Methods
 NameDescription
Public methodCompareTo(Object) Compares this instance to a specified object and returns an indication of their relative values.
Public methodCompareTo(UInt24) Compares this instance to a specified 24-bit unsigned integer and returns an indication of their relative values.
Public methodCompareTo(UInt32) Compares this instance to a specified 32-bit unsigned integer and returns an indication of their relative values.
Public methodEquals(Object) Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object))
Public methodEquals(UInt24) Returns a value indicating whether this instance is equal to a specified UInt24 value.
Public methodEquals(UInt32) Returns a value indicating whether this instance is equal to a specified uint value.
Public methodGetBytesReturns the UInt24 value as an array of three bytes.
Public methodStatic memberGetBytes(UInt24)Returns the specified UInt24 value as an array of three bytes.
Public methodGetHashCode Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetTypeCode Returns the System.TypeCode for value type System.UInt32 (there is no defined type code for an UInt24).
Public methodStatic memberGetValueReturns a 24-bit unsigned integer from three bytes at a specified position in a byte array.
Public methodStatic memberParse(String) Converts the string representation of a number to its 24-bit unsigned integer equivalent.
Public methodStatic memberParse(String, NumberStyles) Converts the string representation of a number in a specified style to its 24-bit unsigned integer equivalent.
Public methodStatic memberParse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its 24-bit unsigned integer equivalent.
Public methodStatic memberParse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its 24-bit unsigned integer equivalent.
Public methodToString Converts the numeric value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
Public methodToString(IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String) Converts the numeric value of this instance to its equivalent string representation, using the specified format.
Public methodToString(String, IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Public methodStatic memberTryParse(String, UInt24) Converts the string representation of a number to its 24-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed.
Public methodStatic memberTryParse(String, NumberStyles, IFormatProvider, UInt24) Converts the string representation of a number in a specified style and culture-specific format to its 24-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(UInt24, UInt24) Returns computed sum of values.
Public operatorStatic memberAddition(UInt24, UInt32) Returns computed sum of values.
Public operatorStatic memberAddition(UInt32, UInt24) Returns computed sum of values.
Public operatorStatic memberBitwiseAnd(UInt24, UInt24) Returns logical bitwise AND of values.
Public operatorStatic memberBitwiseAnd(UInt24, UInt32) Returns logical bitwise AND of values.
Public operatorStatic memberBitwiseAnd(UInt32, UInt24) Returns logical bitwise AND of values.
Public operatorStatic memberBitwiseOr(UInt24, UInt24) Returns logical bitwise OR of values.
Public operatorStatic memberBitwiseOr(UInt24, UInt32) Returns logical bitwise OR of values.
Public operatorStatic memberBitwiseOr(UInt32, UInt24) Returns logical bitwise OR of values.
Public operatorStatic memberDecrement(UInt24) Returns decremented value.
Public operatorStatic memberDivision(UInt24, UInt24) Returns computed division of values.
Public operatorStatic memberDivision(UInt24, UInt32) Returns computed division of values.
Public operatorStatic memberDivision(UInt32, UInt24) Returns computed division of values.
Public operatorStatic memberEquality(UInt24, UInt24) Compares the two values for equality.
Public operatorStatic memberEquality(UInt24, UInt32) Compares the two values for equality.
Public operatorStatic memberEquality(UInt32, UInt24) Compares the two values for equality.
Public operatorStatic memberExclusiveOr(UInt24, UInt24) Returns logical bitwise exclusive-OR of values.
Public operatorStatic memberExclusiveOr(UInt24, UInt32) Returns logical bitwise exclusive-OR of values.
Public operatorStatic memberExclusiveOr(UInt32, UInt24) Returns logical bitwise exclusive-OR of values.
Public operatorStatic member(Decimal to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic member(Double to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic member(Enum to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic member(Int24 to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic member(Single to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic member(String to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic member(UInt24 to Int24) Explicitly converts value to an Int24.
Public operatorStatic member(UInt24 to Byte) Explicitly converts UInt24 to Byte.
Public operatorStatic member(UInt24 to Int16) Explicitly converts UInt24 to Int16.
Public operatorStatic member(UInt24 to UInt16) Explicitly converts UInt24 to UInt16.
Public operatorStatic member(UInt32 to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic member(UInt64 to UInt24) Explicitly converts value to an UInt24.
Public operatorStatic memberExponent(Int32, UInt24) Returns result of first value raised to power of second value.
Public operatorStatic memberExponent(UInt24, UInt24) Returns result of first value raised to power of second value.
Public operatorStatic memberExponent(UInt24, Int32) Returns result of first value raised to power of second value.
Public operatorStatic memberFalse(UInt24) Returns true if value is equal to zero.
Public operatorStatic memberGreaterThan(UInt24, UInt24) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThan(UInt24, UInt32) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThan(UInt32, UInt24) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThanOrEqual(UInt24, UInt24) Returns true if left value is greater than or equal to right value.
Public operatorStatic memberGreaterThanOrEqual(UInt24, UInt32) Returns true if left value is greater than or equal to right value.
Public operatorStatic memberGreaterThanOrEqual(UInt32, UInt24) Returns true if left value is greater than or equal to right value.
Public operatorStatic member(Byte to UInt24) Implicitly converts value to an UInt24.
Public operatorStatic member(Char to UInt24) Implicitly converts value to an UInt24.
Public operatorStatic member(UInt16 to UInt24) Implicitly converts value to an UInt24.
Public operatorStatic member(UInt24 to Decimal) Implicitly converts UInt24 to Decimal.
Public operatorStatic member(UInt24 to Double) Implicitly converts UInt24 to Double.
Public operatorStatic member(UInt24 to Int32) Implicitly converts UInt24 to Int32.
Public operatorStatic member(UInt24 to Int64) Implicitly converts UInt24 to Int64.
Public operatorStatic member(UInt24 to Single) Implicitly converts UInt24 to Single.
Public operatorStatic member(UInt24 to String) Implicitly converts UInt24 to String.
Public operatorStatic member(UInt24 to UInt32) Implicitly converts UInt24 to UInt32.
Public operatorStatic member(UInt24 to UInt64) Implicitly converts UInt24 to UInt64.
Public operatorStatic memberIncrement(UInt24) Returns incremented value.
Public operatorStatic memberInequality(UInt24, UInt24) Compares the two values for inequality.
Public operatorStatic memberInequality(UInt24, UInt32) Compares the two values for inequality.
Public operatorStatic memberInequality(UInt32, UInt24) Compares the two values for inequality.
Public operatorStatic memberLeftShift(UInt24, Int32) Returns value after left shifts of first value by the number of bits specified by second value.
Public operatorStatic memberLessThan(UInt24, UInt24) Returns true if left value is less than right value.
Public operatorStatic memberLessThan(UInt24, UInt32) Returns true if left value is less than right value.
Public operatorStatic memberLessThan(UInt32, UInt24) Returns true if left value is less than right value.
Public operatorStatic memberLessThanOrEqual(UInt24, UInt24) Returns true if left value is less or equal to than right value.
Public operatorStatic memberLessThanOrEqual(UInt24, UInt32) Returns true if left value is less or equal to than right value.
Public operatorStatic memberLessThanOrEqual(UInt32, UInt24) Returns true if left value is less or equal to than right value.
Public operatorStatic memberModulus(UInt24, UInt24) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberModulus(UInt24, UInt32) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberModulus(UInt32, UInt24) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberMultiply(UInt24, UInt24) Returns computed product of values.
Public operatorStatic memberMultiply(UInt24, UInt32) Returns computed product of values.
Public operatorStatic memberMultiply(UInt32, UInt24) Returns computed product of values.
Public operatorStatic memberOnesComplement(UInt24) Returns bitwise complement of value.
Public operatorStatic memberRightShift(UInt24, Int32) Returns value after right shifts of first value by the number of bits specified by second value.
Public operatorStatic memberSubtraction(UInt24, UInt24) Returns computed difference of values.
Public operatorStatic memberSubtraction(UInt24, UInt32) Returns computed difference of values.
Public operatorStatic memberSubtraction(UInt32, UInt24) Returns computed difference of values.
Public operatorStatic memberTrue(UInt24) Returns true if value is greater than zero.
Top
Fields
 NameDescription
Public fieldStatic memberBitMaskHigh byte bit-mask used when a 24-bit integer is stored within a 32-bit integer. This field is constant.
Public fieldStatic memberMaxValue Represents the largest possible value of an Int24. This field is constant.
Public fieldStatic memberMinValue Represents the smallest possible value of an Int24. This field is constant.
Top
Extension Methods
 NameDescription
Public Extension MethodBitRotL Performs rightwise bit-rotation for the specified number of rotations.
(Defined by BitExtensions)
Public Extension MethodBitRotR Performs rightwise bit-rotation for the specified number of rotations.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodClearBits Returns value with specified bits cleared.
(Defined by BitExtensions)
Public Extension MethodClearBits Returns value with specified bits cleared.
(Defined by BitExtensions)
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetMaskedValue Returns value stored in the bits represented by the specified bitmask.
(Defined by BitExtensions)
Public Extension MethodGetMaskedValue Returns value stored in the bits represented by the specified bitmask.
(Defined by BitExtensions)
Public Extension MethodSetBits Returns value with specified bits set.
(Defined by BitExtensions)
Public Extension MethodSetBits Returns value with specified bits set.
(Defined by BitExtensions)
Public Extension MethodSetMaskedValue Returns value after setting a new value for the bits specified by the bitmask.
(Defined by BitExtensions)
Public Extension MethodSetMaskedValue Returns value after setting a new value for the bits specified by the bitmask.
(Defined by BitExtensions)
Public Extension MethodToBinaryString Encodes value as binary, i.e., a string of bit values (0 or 1).
(Defined by BitExtensions)
Public Extension MethodToggleBits Returns value with specified bits toggled.
(Defined by BitExtensions)
Public Extension MethodToggleBits Returns value with specified bits toggled.
(Defined by BitExtensions)
Top
Remarks

This class behaves like most other intrinsic unsigned integers but allows a 3-byte, 24-bit integer implementation that is often found in many digital-signal processing arenas and different kinds of protocol parsing. An unsigned 24-bit integer is typically used to save storage space on disk where its value range of 0 to 16777215 is sufficient, but the unsigned Int16 value range of 0 to 65535 is too small.

This structure uses an UInt32 internally for storage and most other common expected integer functionality, so using a 24-bit integer will not save memory. However, if the 24-bit unsigned integer range (0 to 16777215) suits your data needs you can save disk space by only storing the three bytes that this integer actually consumes. You can do this by calling the UInt24.GetBytes function to return a three byte binary array that can be serialized to the desired destination and then calling the UInt24.GetValue function to restore the UInt24 value from those three bytes.

All the standard operators for the UInt24 have been fully defined for use with both UInt24 and UInt32 unsigned integers; you should find that without the exception UInt24 can be compared and numerically calculated with an UInt24 or UInt32. Necessary casting should be minimal and typical use should be very simple - just as if you are using any other native unsigned integer.

See Also

Reference

GSF Namespace