DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::oks::GitFoldersHolder Class Reference

Public Member Functions

 ~GitFoldersHolder ()
 
void insert (const std::string &path)
 
void erase (const std::string &path)
 

Static Public Member Functions

static void remove (const std::string &path)
 

Private Attributes

std::mutex s_git_folders_mutex
 
std::set< std::string > s_git_folders
 

Detailed Description

Definition at line 64 of file kernel.cpp.

Constructor & Destructor Documentation

◆ ~GitFoldersHolder()

dunedaq::oks::GitFoldersHolder::~GitFoldersHolder ( )
inline

Definition at line 67 of file kernel.cpp.

68 {
69 std::lock_guard scoped_lock(s_git_folders_mutex);
70
71 for (const auto &x : s_git_folders)
72 remove(x);
73
74 s_git_folders.clear();
75 }
static void remove(const std::string &path)
Definition kernel.cpp:78
std::set< std::string > s_git_folders
Definition kernel.cpp:107

Member Function Documentation

◆ erase()

void dunedaq::oks::GitFoldersHolder::erase ( const std::string & path)
inline

Definition at line 98 of file kernel.cpp.

99 {
100 std::lock_guard scoped_lock(s_git_folders_mutex);
101 s_git_folders.erase(path);
102 }

◆ insert()

void dunedaq::oks::GitFoldersHolder::insert ( const std::string & path)
inline

Definition at line 91 of file kernel.cpp.

92 {
93 std::lock_guard scoped_lock(s_git_folders_mutex);
94 s_git_folders.insert(path);
95 }

◆ remove()

static void dunedaq::oks::GitFoldersHolder::remove ( const std::string & path)
inlinestatic

Definition at line 78 of file kernel.cpp.

79 {
80 try
81 {
82 std::filesystem::remove_all(path);
83 }
84 catch (std::exception &ex)
85 {
86 Oks::error_msg("OksKernel::~OksKernel") << "cannot remove user repository \"" << path << "\"" << ex.what() << std::endl;
87 }
88 }
static std::ostream & error_msg(const char *)
Definition kernel.cpp:556

Member Data Documentation

◆ s_git_folders

std::set<std::string> dunedaq::oks::GitFoldersHolder::s_git_folders
private

Definition at line 107 of file kernel.cpp.

◆ s_git_folders_mutex

std::mutex dunedaq::oks::GitFoldersHolder::s_git_folders_mutex
private

Definition at line 106 of file kernel.cpp.


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