// Copyright Epic Games, Inc. All Rights Reserved.
namespace EpicGames.BuildGraph
{
///
/// Helper class for writing BuildGraph bytecode to a buffer.
///
public abstract class BgBytecodeWriter
{
///
/// Writes an opcode to the output
///
///
public abstract void WriteOpcode(BgOpcode opcode);
///
/// Writes a string to the output
///
///
public abstract void WriteString(string str);
///
/// Writes a reference to an interned string to the output
///
/// Name to write
public abstract void WriteName(string name);
///
/// Writes a signed integer value to the output
///
///
public abstract void WriteSignedInteger(long value);
///
/// Writes an unsigned integer to the output
///
///
public void WriteUnsignedInteger(int value) => WriteUnsignedInteger((ulong)value);
///
/// Writes an unsigned integer to the output
///
///
public abstract void WriteUnsignedInteger(ulong value);
///
/// Writes an expression to the output buffer
///
///
public abstract void WriteExpr(BgExpr expr);
///
/// Writes an expression as a standalone fragment, encoding just the fragment index into the output stream
///
///
public abstract void WriteExprAsFragment(BgExpr expr);
///
/// Writes a thunk to native code.
///
/// Method to be called
public abstract void WriteThunk(BgThunkDef thunk);
}
}