Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ObjectId Struct

    Namespace: Stride.Core.Storage
    Assembly: Stride.Core.dll

    A hash to uniquely identify data.

    [DataContract("ObjectId")]
    [Serializable]
    [DataSerializer(typeof(ObjectId.Serializer))]
    public struct ObjectId : IEquatable<ObjectId>, IComparable<ObjectId>
    Name Description
    Constructors
    ObjectId(Byte[])

    Initializes a new instance of the ObjectId struct.

    ObjectId(UInt32, UInt32, UInt32, UInt32)
    Fields
    Empty
    HashSize
    HashStringLength
    Methods
    Combine(ObjectId, ObjectId)
    Combine(ref ObjectId, ref ObjectId, out ObjectId)
    CompareTo(ObjectId)
    Equals(ObjectId)
    Equals(Object)
    FromBytes(Byte[])

    Computes a hash from a byte buffer.

    FromBytes(Byte[], Int32, Int32)

    Computes a hash from a byte buffer.

    FromObject<T>(T)

    Computes a hash from an object using BinarySerializationWriter.

    FromObject<T>(T, out Byte[])

    Computes a hash from an object using BinarySerializationWriter.

    GetHashCode()
    New()

    News this instance.

    ToGuid()

    Gets a System.Guid from this object identifier.

    ToString()
    TryParse(String, out ObjectId)

    Tries to parse an ObjectId from a string.

    Operators
    Equality(ObjectId, ObjectId)

    Implements the ==.

    Explicit(ObjectId to Byte[])

    Performs an explicit conversion from ObjectId to .

    Explicit(Guid to ObjectId)
    Inequality(ObjectId, ObjectId)

    Implements the !=.

    | Improve this Doc View Source

    Constructors


    ObjectId(Byte[])

    Initializes a new instance of the ObjectId struct.

    public ObjectId(byte[] hash)
    Parameters
    Type Name Description
    System.Byte[] hash

    The hash.

    Exceptions
    Type Condition
    System.ArgumentNullException

    hash

    System.InvalidOperationException

    ObjectId value doesn't match expected size.


    ObjectId(UInt32, UInt32, UInt32, UInt32)

    public ObjectId(uint hash1, uint hash2, uint hash3, uint hash4)
    Parameters
    Type Name Description
    System.UInt32 hash1
    System.UInt32 hash2
    System.UInt32 hash3
    System.UInt32 hash4
    | Improve this Doc View Source

    Fields


    Empty

    public static readonly ObjectId Empty
    Field Value
    Type Description
    ObjectId

    HashSize

    public const int HashSize = 16
    Field Value
    Type Description
    System.Int32

    HashStringLength

    public const int HashStringLength = 32
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Methods


    Combine(ObjectId, ObjectId)

    public static ObjectId Combine(ObjectId left, ObjectId right)
    Parameters
    Type Name Description
    ObjectId left
    ObjectId right
    Returns
    Type Description
    ObjectId

    Combine(ref ObjectId, ref ObjectId, out ObjectId)

    public static void Combine(ref ObjectId left, ref ObjectId right, out ObjectId result)
    Parameters
    Type Name Description
    ObjectId left
    ObjectId right
    ObjectId result

    CompareTo(ObjectId)

    public int CompareTo(ObjectId other)
    Parameters
    Type Name Description
    ObjectId other
    Returns
    Type Description
    System.Int32

    Equals(ObjectId)

    public bool Equals(ObjectId other)
    Parameters
    Type Name Description
    ObjectId other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    FromBytes(Byte[])

    Computes a hash from a byte buffer.

    public static ObjectId FromBytes(byte[] buffer)
    Parameters
    Type Name Description
    System.Byte[] buffer

    The byte buffer.

    Returns
    Type Description
    ObjectId

    The hash of the object.

    Exceptions
    Type Condition
    System.ArgumentNullException

    buffer


    FromBytes(Byte[], Int32, Int32)

    Computes a hash from a byte buffer.

    public static ObjectId FromBytes(byte[] buffer, int offset, int count)
    Parameters
    Type Name Description
    System.Byte[] buffer

    The byte buffer.

    System.Int32 offset

    The offset into the buffer.

    System.Int32 count

    The number of bytes to read from the buffer starting at offset position.

    Returns
    Type Description
    ObjectId

    The hash of the object.

    Exceptions
    Type Condition
    System.ArgumentNullException

    buffer


    FromObject<T>(T)

    Computes a hash from an object using BinarySerializationWriter.

    public static ObjectId FromObject<T>(T obj)
    Parameters
    Type Name Description
    T obj

    The object.

    Returns
    Type Description
    ObjectId

    The hash of the object.

    Type Parameters
    Name Description
    T

    FromObject<T>(T, out Byte[])

    Computes a hash from an object using BinarySerializationWriter.

    public static ObjectId FromObject<T>(T obj, out byte[] buffer)
    Parameters
    Type Name Description
    T obj

    The object.

    System.Byte[] buffer

    The buffer containing the serialized object.

    Returns
    Type Description
    ObjectId

    The hash of the object.

    Type Parameters
    Name Description
    T

    The type of the object to serialize


    GetHashCode()

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    New()

    News this instance.

    public static ObjectId New()
    Returns
    Type Description
    ObjectId

    ObjectId.


    ToGuid()

    Gets a System.Guid from this object identifier.

    public Guid ToGuid()
    Returns
    Type Description
    System.Guid

    Guid.


    ToString()

    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()

    TryParse(String, out ObjectId)

    Tries to parse an ObjectId from a string.

    public static bool TryParse(string input, out ObjectId result)
    Parameters
    Type Name Description
    System.String input

    The input hexa string.

    ObjectId result

    The result ObjectId.

    Returns
    Type Description
    System.Boolean

    true if parsing was successfull, false otherwise

    | Improve this Doc View Source

    Operators


    Equality(ObjectId, ObjectId)

    Implements the ==.

    public static bool operator ==(ObjectId left, ObjectId right)
    Parameters
    Type Name Description
    ObjectId left

    The left.

    ObjectId right

    The right.

    Returns
    Type Description
    System.Boolean

    The result of the operator.


    Explicit(ObjectId to Byte[])

    Performs an explicit conversion from ObjectId to .

    public static explicit operator byte[](ObjectId objectId)
    Parameters
    Type Name Description
    ObjectId objectId

    The object id.

    Returns
    Type Description
    System.Byte[]

    The result of the conversion.


    Explicit(Guid to ObjectId)

    public static explicit operator ObjectId(Guid guid)
    Parameters
    Type Name Description
    System.Guid guid
    Returns
    Type Description
    ObjectId

    Inequality(ObjectId, ObjectId)

    Implements the !=.

    public static bool operator !=(ObjectId left, ObjectId right)
    Parameters
    Type Name Description
    ObjectId left

    The left.

    ObjectId right

    The right.

    Returns
    Type Description
    System.Boolean

    The result of the operator.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation