Files
Ben Marsh 38f3bc55ef BuildGraph: Various VM improvements.
* Added support for deserializing BgObject types directly into native classes.
* Removed opcodes for creating graph structures. These are now created in user code from BgObject types.
* Removed BgNodeSpecBuilder. BgNode objects can now be modified directly (returning a modified copy).
* Added concrete types for option parameters. The VM now keeps track of any parameters for evaluated options, allowing them to be added into the graph definition.
* Order dependencies now take nodes rather than outputs.
* Added explicit support for native thunks, whose bindings are saved to a sideband channel during compilation and referenced in bytecode as an index. This generalizes code that was previously specific to node definitions.
* Added a name table to bytecode, to optimize situations where we reference the same string mulitple times.

#preflight 62bf3c583f0d6beee2e8f4a6

[CL 20918762 by Ben Marsh in ue5-main branch]
2022-07-01 14:47:54 -04:00

59 lines
1.6 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml;
namespace EpicGames.BuildGraph
{
/// <summary>
/// Stores a list of nodes which can be executed on a single agent
/// </summary>
[DebuggerDisplay("{Name}")]
[BgObject(typeof(BgAgentDefSerializer))]
public class BgAgentDef
{
/// <summary>
/// Name of this agent. Used for display purposes in a build system.
/// </summary>
public string Name { get; }
/// <summary>
/// Array of valid agent types that these nodes may run on. When running in the build system, this determines the class of machine that should
/// be selected to run these nodes. The first defined agent type for this branch will be used.
/// </summary>
public List<string> PossibleTypes { get; } = new List<string>();
/// <summary>
/// List of nodes in this agent group.
/// </summary>
public List<BgNodeDef> Nodes { get; set; } = new List<BgNodeDef>();
/// <summary>
/// Diagnostics to output if executing this agent
/// </summary>
public List<BgDiagnosticDef> Diagnostics { get; } = new List<BgDiagnosticDef>();
/// <summary>
/// Constructor
/// </summary>
/// <param name="name">Name of this agent group</param>
public BgAgentDef(string name)
{
Name = name;
}
}
class BgAgentDefSerializer : BgObjectSerializer<BgAgentDef>
{
/// <inheritdoc/>
public override BgAgentDef Deserialize(BgObjectDef<BgAgentDef> obj)
{
BgAgentDef agent = new BgAgentDef(obj.Get(x => x.Name, ""));
obj.CopyTo(agent);
return agent;
}
}
}