TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

struct GUID in Tinman.Core.Util

Helper class for generating 128-bit globally unique identifiers (GUIDs).

struct GUID implements IComparable<GUID>
  IEquatable<GUID>

Remarks

GUIDs are usually given in the following form: {00000000-0000-0000-0000-000000000000}

Serialization

Serializer

The serialization helper object for values of GUID.

public static readonly field Serializer
type ITypeSerializer<GUID>

Public / Constants

Zero

An all-zero GUID: {00000000-0000-0000-0000-000000000000}

public static readonly field Zero
type GUID

Public / Attributes

First

The first 64-bit part of the GUID.

public readonly field First
type int64

Second

The second 64-bit part of the GUID.

public readonly field Second
type int64

Public / Constructors

From

Creates a new instance of GUID from the given GUID string.

public static method From (string guid)
type GUID
params guid [not-null] The GUID string (see remarks).
returns The GUID value.

Remarks:

GUID strings are required to match the following grammar:

guid      := '{' parts '}' | '"' parts '"' | '\'' parts '\'' | parts ;
parts     := hex-digit[8] '-' hex-digit[4] '-' hex-digit[4] '-' hex-digit[4] '-' hex-digit[12] ;
hex-digit := '0'..'9' | 'a'..'f' | 'A'..'F' ;


Creates a new instance of GUID from the next 16 bytes in the given buffer (see BigEndian).

public static method From (ByteBuffer buffer)
type GUID
params buffer [not-null] The byte buffer.
returns The GUID value.

Creates a new instance of GUID from the bytes in the given array (see BigEndian).

public static method From (int8[] bytes, int32 offset = 0)
type GUID
params bytes [not-null] The byte array.
  offset Offset into bytes to first byte. Defaults to 0.
returns The GUID value.

GUID

Creates a new instance of GUID.

public constructor GUID (int64 first, int64 second)
params first The first 64-bit part of the GUID.
  second The second 64-bit part of the GUID.

Remarks:

{00000000-0000-0000-0000-000000000000}
 ........ .... .... .... ............
 \__/          \__/ \__/         \__/
  MSB           LSB  MSB          LSB
   \_____________/    \____________/
        first             second

Public / Methods

CompareTo

public method CompareTo (GUID other)
type int32
params other

Digest

Digests the given string values and returns a GUID as a result.

[Pure]
public static method Digest (IEnumerable<string> values)
type GUID
params values The string list.
returns The GUID.

Equals

public method Equals (GUID other)
type bool
params other

Generate

Generates a new GUID value.

public static method Generate ()
type GUID
returns The generated value.

GetHashCode

[Pure]
public override method GetHashCode ()
type int32

Process

Processes this GUID with the given block codec.

public method Process (IBlockCodec codec)
type GUID
params codec [not-null] The block codec to use. The codec should have a block size of 16 bytes.
returns The resulting GUID.

ToBuffer

Converts this GUID into a sequence of bytes.

[OwnerReturn]
public method ToBuffer ()
type ByteBuffer
returns [not-null] The byte buffer that contains this GUID between its position and limit.

Converts this GUID into a sequence of bytes (see BigEndian).

public method ToBuffer (ByteBuffer buffer)
params buffer [not-null] Output byte buffer.

Remarks:

The bytes of this GUID will be appended to the given byte buffer.

ToBytes

Converts this GUID into a sequence of bytes (see BigEndian).

public method ToBytes (int8[] bytes = null, int32 offset = 0)
type int8[]
params bytes Output byte array or null.
  offset [>=0] Offset into bytes to first byte to write. Defaults to 0.
returns [not-null] The byte array that contains this GUID, beginning at offset.

ToString

public override method ToString ()
type string