Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::Internal::TemporaryFile Class Referencefinal

A simple utility class that creates a temporary file in its ctor and deletes that file in its dtor; this is useful for temporary files that you want to ensure are deleted when exiting a certain scope. More...

#include <Util.h>

Public Member Functions

 TemporaryFile (const std::string &prefix, const std::string &suffix)
 
const std::string & pathname () const
 
 ~TemporaryFile ()
 
void detach ()
 
 TemporaryFile (const TemporaryFile &)=delete
 
TemporaryFileoperator= (const TemporaryFile &)=delete
 
 TemporaryFile (TemporaryFile &&)=delete
 
TemporaryFileoperator= (TemporaryFile &&)=delete
 

Detailed Description

A simple utility class that creates a temporary file in its ctor and deletes that file in its dtor; this is useful for temporary files that you want to ensure are deleted when exiting a certain scope.

Since this is essentially just an RAII wrapper around file_make_temp() and file_unlink(), it has the same failure modes (i.e.: assertion upon error).

Definition at line 332 of file Util.h.

Constructor & Destructor Documentation

◆ TemporaryFile() [1/3]

Halide::Internal::TemporaryFile::TemporaryFile ( const std::string & prefix,
const std::string & suffix )
inline

Definition at line 334 of file Util.h.

◆ ~TemporaryFile()

Halide::Internal::TemporaryFile::~TemporaryFile ( )
inline

Definition at line 340 of file Util.h.

References Halide::Internal::file_unlink().

◆ TemporaryFile() [2/3]

Halide::Internal::TemporaryFile::TemporaryFile ( const TemporaryFile & )
delete

◆ TemporaryFile() [3/3]

Halide::Internal::TemporaryFile::TemporaryFile ( TemporaryFile && )
delete

Member Function Documentation

◆ pathname()

const std::string & Halide::Internal::TemporaryFile::pathname ( ) const
inline

Definition at line 337 of file Util.h.

◆ detach()

void Halide::Internal::TemporaryFile::detach ( )
inline

Definition at line 348 of file Util.h.

◆ operator=() [1/2]

TemporaryFile & Halide::Internal::TemporaryFile::operator= ( const TemporaryFile & )
delete

◆ operator=() [2/2]

TemporaryFile & Halide::Internal::TemporaryFile::operator= ( TemporaryFile && )
delete

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