// 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
{
///
/// 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 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 the method to be called for a particular node
///
/// Method to be called
public abstract void WriteMethod(BgMethod method);
}
}