mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 20:33:40 +01:00
Slight style updates, make caches to structs.
This commit is contained in:
parent
58192240ff
commit
293590bd51
3 changed files with 57 additions and 21 deletions
|
|
@ -3,18 +3,34 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Dalamud.Plugin.Ipc.Internal;
|
||||
|
||||
internal class DataCache
|
||||
/// <summary>
|
||||
/// A helper struct for reference-counted, type-safe shared access across plugin boundaries.
|
||||
/// </summary>
|
||||
internal readonly struct DataCache
|
||||
{
|
||||
internal readonly string CreatorAssemblyName;
|
||||
internal readonly List<string> UserAssemblyNames;
|
||||
internal readonly Type Type;
|
||||
internal readonly object? Data;
|
||||
/// <summary> The assembly name of the initial creator. </summary>
|
||||
internal readonly string CreatorAssemblyName;
|
||||
|
||||
internal DataCache(string creatorAssemblyName, object? data, Type type)
|
||||
/// <summary> A not-necessarily distinct list of current users. </summary>
|
||||
internal readonly List<string> UserAssemblyNames;
|
||||
|
||||
/// <summary> The type the data was registered as. </summary>
|
||||
internal readonly Type Type;
|
||||
|
||||
/// <summary> A reference to data. </summary>
|
||||
internal readonly object? Data;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DataCache"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="creatorAssemblyName">The assembly name of the initial creator.</param>
|
||||
/// <param name="data">A reference to data.</param>
|
||||
/// <param name="type">The type of the data.</param>
|
||||
public DataCache(string creatorAssemblyName, object? data, Type type)
|
||||
{
|
||||
this.CreatorAssemblyName = creatorAssemblyName;
|
||||
this.UserAssemblyNames = new List<string>{ creatorAssemblyName };
|
||||
this.Data = data;
|
||||
this.Type = type;
|
||||
this.UserAssemblyNames = new List<string> { creatorAssemblyName };
|
||||
this.Data = data;
|
||||
this.Type = type;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue