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 68 of file kernel.cpp.

Constructor & Destructor Documentation

◆ ~GitFoldersHolder()

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

Definition at line 71 of file kernel.cpp.

72 {
73 std::lock_guard scoped_lock(s_git_folders_mutex);
74
75 for (const auto& x : s_git_folders)
76 remove(x);
77
78 s_git_folders.clear();
79 }
static void remove(const std::string &path)
Definition kernel.cpp:81
std::set< std::string > s_git_folders
Definition kernel.cpp:105

Member Function Documentation

◆ erase()

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

Definition at line 97 of file kernel.cpp.

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

◆ 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()

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

Definition at line 81 of file kernel.cpp.

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

Member Data Documentation

◆ s_git_folders

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

Definition at line 105 of file kernel.cpp.

◆ s_git_folders_mutex

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

Definition at line 104 of file kernel.cpp.


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