Skip to content

Commit

Permalink
improve compiletimestatics documentation; add missing using
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-O6U9TBJ\Lilith committed Oct 26, 2023
1 parent 4cb5bc7 commit ba10b7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Arch.SourceGen/QueryGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
var compileTimeStatics = new StringBuilder();
compileTimeStatics.AppendLine("using System;");
compileTimeStatics.AppendLine("using System.Threading;");
compileTimeStatics.AppendLine("namespace Arch.Core.Utils;");
compileTimeStatics.AppendGroups(25);
Expand Down
9 changes: 8 additions & 1 deletion src/Arch/Core/Utils/CompileTimeStatics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ public static implicit operator Type(ComponentType value)
/// The <see cref="ComponentRegistry"/> class, tracks all used components in the project.
/// Those are represented by <see cref="ComponentType"/>'s.
/// </summary>
/// <remarks>
/// Simultaneous readers are supported, but simultaneous readers and writers are not.
/// Ensure that modification happens on an isolated thread.
/// In <see cref="World"/> this is implemented via marked structural-change methods.
/// </remarks>
public static class ComponentRegistry
{

/// <summary>
/// All registered components, maps their <see cref="Type"/> to their <see cref="ComponentType"/>.
/// </summary>
Expand Down Expand Up @@ -406,6 +410,9 @@ public static class Component
/// <summary>
/// Searches a <see cref="ComponentType"/> by its <see cref="Type"/>. If it does not exist, it will be added.
/// </summary>
/// <remarks>
/// Not thread-safe; ensure no other threads are accessing or modifying the <see cref="ComponentRegistry"/>.
/// </remarks>
/// <param name="type">The <see cref="Type"/>.</param>
/// <returns>The <see cref="ComponentType"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit ba10b7e

Please sign in to comment.