LLVM 22.0.0git
llvm::vfs::OutputBackend Class Referenceabstract

Interface for virtualized outputs. More...

#include "llvm/Support/VirtualOutputBackend.h"

Inheritance diagram for llvm::vfs::OutputBackend:
[legend]

Public Member Functions

IntrusiveRefCntPtr< OutputBackendclone () const
 Get a backend that points to the same destination as this one but that has independent settings.
Expected< OutputFilecreateFile (const Twine &Path, std::optional< OutputConfig > Config=std::nullopt)
 Create a file.
virtual ~OutputBackend ()=default
Public Member Functions inherited from llvm::RefCountedBase< OutputBackend >
unsigned UseCount () const
void Retain () const
void Release () const

Protected Member Functions

virtual IntrusiveRefCntPtr< OutputBackendcloneImpl () const =0
 Must be thread-safe.
virtual Expected< std::unique_ptr< OutputFileImpl > > createFileImpl (StringRef Path, std::optional< OutputConfig > Config)=0
 Create a file for Path.
 OutputBackend ()=default
Protected Member Functions inherited from llvm::RefCountedBase< OutputBackend >
 RefCountedBase ()=default
RefCountedBaseoperator= (const RefCountedBase &)=delete
 ~RefCountedBase ()

Detailed Description

Interface for virtualized outputs.

If virtual functions are added here, also add them to ProxyOutputBackend.

Definition at line 34 of file VirtualOutputBackend.h.

Constructor & Destructor Documentation

◆ OutputBackend()

llvm::vfs::OutputBackend::OutputBackend ( )
protecteddefault

◆ ~OutputBackend()

virtual llvm::vfs::OutputBackend::~OutputBackend ( )
virtualdefault

Member Function Documentation

◆ clone()

IntrusiveRefCntPtr< OutputBackend > llvm::vfs::OutputBackend::clone ( ) const
inline

Get a backend that points to the same destination as this one but that has independent settings.

Not thread-safe, but all operations are thread-safe when performed on separate clones of the same backend.

Definition at line 43 of file VirtualOutputBackend.h.

References cloneImpl().

◆ cloneImpl()

virtual IntrusiveRefCntPtr< OutputBackend > llvm::vfs::OutputBackend::cloneImpl ( ) const
protectedpure virtual

Must be thread-safe.

Virtual function has a different name than clone() so that implementations can override the return value.

Implemented in llvm::vfs::HashingOutputBackend< HasherT >, and llvm::vfs::OnDiskOutputBackend.

Referenced by clone().

◆ createFile()

Expected< OutputFile > OutputBackend::createFile ( const Twine & Path,
std::optional< OutputConfig > Config = std::nullopt )

Create a file.

If Config is std::nullopt, uses the backend's default OutputConfig (may match OutputConfig::OutputConfig(), or may have been customized).

Thread-safe.

Definition at line 24 of file VirtualOutputBackend.cpp.

References assert(), createFileImpl(), and llvm::make_error().

◆ createFileImpl()

virtual Expected< std::unique_ptr< OutputFileImpl > > llvm::vfs::OutputBackend::createFileImpl ( StringRef Path,
std::optional< OutputConfig > Config )
protectedpure virtual

Create a file for Path.

Must be thread-safe.

Precondition
Config is valid or std::nullopt.

Implemented in llvm::vfs::HashingOutputBackend< HasherT >, llvm::vfs::OnDiskOutputBackend, and llvm::vfs::ProxyOutputBackend.

Referenced by createFile().


The documentation for this class was generated from the following files: