yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::RomSandboxManager Class Referenceabstract

#include <rom_sandbox_manager.h>

Classes

struct  SandboxMetadata
 

Public Member Functions

void SetRootDirectory (const std::filesystem::path &root)
 
const std::filesystem::path & RootDirectory () const
 
absl::StatusOr< SandboxMetadataCreateSandbox (Rom &rom, absl::string_view description)
 
absl::StatusOr< SandboxMetadataActiveSandbox () const
 
absl::StatusOr< std::filesystem::path > ActiveSandboxRomPath () const
 
std::vector< SandboxMetadataListSandboxes () const
 
absl::Status RemoveSandbox (const std::string &id)
 
absl::StatusOr< int > CleanupOlderThan (absl::Duration max_age)
 

Static Public Member Functions

static RomSandboxManagerInstance ()
 

Private Member Functions

 RomSandboxManager ()
 
absl::Status EnsureRootExistsLocked ()
 
std::string GenerateSandboxIdLocked ()
 
int sequence_ ABSL_GUARDED_BY (mutex_)=0
 

Private Attributes

std::filesystem::path root_directory_
 
std::mutex mutex_
 
std::unordered_map< std::string, SandboxMetadatasandboxes_
 
std::optional< std::string > active_sandbox_id_
 

Detailed Description

Definition at line 27 of file rom_sandbox_manager.h.

Constructor & Destructor Documentation

◆ RomSandboxManager()

yaze::cli::RomSandboxManager::RomSandboxManager ( )
private

Definition at line 45 of file rom_sandbox_manager.cc.

Referenced by Instance().

Member Function Documentation

◆ Instance()

RomSandboxManager & yaze::cli::RomSandboxManager::Instance ( )
static

◆ SetRootDirectory()

void yaze::cli::RomSandboxManager::SetRootDirectory ( const std::filesystem::path &  root)

Definition at line 48 of file rom_sandbox_manager.cc.

References EnsureRootExistsLocked(), mutex_, and root_directory_.

Here is the call graph for this function:

◆ RootDirectory()

const std::filesystem::path & yaze::cli::RomSandboxManager::RootDirectory ( ) const

Definition at line 54 of file rom_sandbox_manager.cc.

References root_directory_.

◆ CreateSandbox()

◆ ActiveSandbox()

absl::StatusOr< RomSandboxManager::SandboxMetadata > yaze::cli::RomSandboxManager::ActiveSandbox ( ) const

◆ ActiveSandboxRomPath()

absl::StatusOr< std::filesystem::path > yaze::cli::RomSandboxManager::ActiveSandboxRomPath ( ) const

Definition at line 149 of file rom_sandbox_manager.cc.

References ActiveSandbox(), and ASSIGN_OR_RETURN.

Here is the call graph for this function:

◆ ListSandboxes()

std::vector< RomSandboxManager::SandboxMetadata > yaze::cli::RomSandboxManager::ListSandboxes ( ) const

Definition at line 155 of file rom_sandbox_manager.cc.

References mutex_, and sandboxes_.

◆ RemoveSandbox()

absl::Status yaze::cli::RomSandboxManager::RemoveSandbox ( const std::string &  id)

◆ CleanupOlderThan()

absl::StatusOr< int > yaze::cli::RomSandboxManager::CleanupOlderThan ( absl::Duration  max_age)

Definition at line 188 of file rom_sandbox_manager.cc.

References mutex_, RemoveSandbox(), and sandboxes_.

Here is the call graph for this function:

◆ EnsureRootExistsLocked()

absl::Status yaze::cli::RomSandboxManager::EnsureRootExistsLocked ( )
private

Definition at line 58 of file rom_sandbox_manager.cc.

References root_directory_.

Referenced by CreateSandbox(), and SetRootDirectory().

◆ GenerateSandboxIdLocked()

std::string yaze::cli::RomSandboxManager::GenerateSandboxIdLocked ( )
private

Definition at line 70 of file rom_sandbox_manager.cc.

Referenced by CreateSandbox().

◆ ABSL_GUARDED_BY()

int sequence_ yaze::cli::RomSandboxManager::ABSL_GUARDED_BY ( mutex_  )
privatepure virtual

Member Data Documentation

◆ root_directory_

std::filesystem::path yaze::cli::RomSandboxManager::root_directory_
private

◆ mutex_

std::mutex yaze::cli::RomSandboxManager::mutex_
mutableprivate

◆ sandboxes_

std::unordered_map<std::string, SandboxMetadata> yaze::cli::RomSandboxManager::sandboxes_
private

◆ active_sandbox_id_

std::optional<std::string> yaze::cli::RomSandboxManager::active_sandbox_id_
private

Definition at line 85 of file rom_sandbox_manager.h.

Referenced by ActiveSandbox(), CreateSandbox(), and RemoveSandbox().


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