Files
UnrealEngineUWP/Engine/Source/Programs/Shared/EpicGames.BuildGraph/BgBytecodeWriter.cs
Ben Marsh c32dfb7acb BuildGraph: Move option classes alongside their underlying types, and fix up a lot of namespaces.
#preflight none

[CL 20819013 by Ben Marsh in ue5-main branch]
2022-06-24 19:08:20 -04:00

71 lines
1.9 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using EpicGames.Core;
using EpicGames.Serialization;
using EpicGames.BuildGraph.Expressions;
namespace EpicGames.BuildGraph
{
/// <summary>
/// Helper class for writing BuildGraph bytecode to a buffer.
/// </summary>
public abstract class BgBytecodeWriter
{
/// <summary>
/// Writes an opcode to the output
/// </summary>
/// <param name="opcode"></param>
public abstract void WriteOpcode(BgOpcode opcode);
/// <summary>
/// Writes a string to the output
/// </summary>
/// <param name="str"></param>
public abstract void WriteString(string str);
/// <summary>
/// Writes a signed integer value to the output
/// </summary>
/// <param name="value"></param>
public abstract void WriteSignedInteger(long value);
/// <summary>
/// Writes an unsigned integer to the output
/// </summary>
/// <param name="value"></param>
public void WriteUnsignedInteger(int value) => WriteUnsignedInteger((ulong)value);
/// <summary>
/// Writes an unsigned integer to the output
/// </summary>
/// <param name="value"></param>
public abstract void WriteUnsignedInteger(ulong value);
/// <summary>
/// Writes an expression to the output buffer
/// </summary>
/// <param name="expr"></param>
public abstract void WriteExpr(BgExpr expr);
/// <summary>
/// Writes an expression as a standalone fragment, encoding just the fragment index into the output stream
/// </summary>
/// <param name="expr"></param>
public abstract void WriteExprAsFragment(BgExpr expr);
/// <summary>
/// Writes the method to be called for a particular node
/// </summary>
/// <param name="method">Method to be called</param>
public abstract void WriteMethod(BgMethod method);
}
}