File: Data\IdDispenser.cs
Web Access
Project: src\src\runtime\src\native\managed\cdac\Microsoft.Diagnostics.DataContractReader.Contracts\Microsoft.Diagnostics.DataContractReader.Contracts.csproj (Microsoft.Diagnostics.DataContractReader.Contracts)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;

namespace Microsoft.Diagnostics.DataContractReader.Data;

internal sealed class IdDispenser : IData<IdDispenser>
{
    static IdDispenser IData<IdDispenser>.Create(Target target, TargetPointer address) => new IdDispenser(target, address);
    public IdDispenser(Target target, TargetPointer address)
    {
        Target.TypeInfo type = target.GetTypeInfo(DataType.IdDispenser);
        IdToThread = target.ReadPointerField(address, type, nameof(IdToThread));
        HighestId = target.ReadField<uint>(address, type, nameof(HighestId));
    }

    public TargetPointer IdToThread { get; init; }
    public uint HighestId { get; init; }
}