DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
OksValidateJob Struct Reference
Inheritance diagram for OksValidateJob:
[legend]
Collaboration diagram for OksValidateJob:
[legend]

Public Member Functions

 OksValidateJob (OksKernel &kernel, const std::string &file_name)
void run ()
Public Member Functions inherited from dunedaq::oks::OksJob
virtual ~OksJob ()

Private Member Functions

 OksValidateJob (const OksValidateJob &)
OksValidateJob & operator= (const OksValidateJob &)

Private Attributes

OksKernel m_kernel
const std::string & m_file_name

Detailed Description

Definition at line 55 of file oks_validate_repository.cxx.

Constructor & Destructor Documentation

◆ OksValidateJob() [1/2]

OksValidateJob::OksValidateJob ( OksKernel & kernel,
const std::string & file_name )
inline

Definition at line 58 of file oks_validate_repository.cxx.

59 : m_kernel(kernel)
60 , m_file_name(file_name)
61 {
62 ;
63 }
const std::string & m_file_name

◆ OksValidateJob() [2/2]

OksValidateJob::OksValidateJob ( const OksValidateJob & )
private

Member Function Documentation

◆ operator=()

OksValidateJob & OksValidateJob::operator= ( const OksValidateJob & )
private

◆ run()

void OksValidateJob::run ( void )
inlinevirtual

Implements dunedaq::oks::OksJob.

Definition at line 65 of file oks_validate_repository.cxx.

66 {
67 static std::mutex s_mutex;
68
69 try {
70 auto start_usage = std::chrono::steady_clock::now();
71
73
75
77 std::lock_guard lock(s_mutex);
78
79 if (s_load_error.empty()) {
81
82 if (!m_kernel.get_bind_classes_status().empty()) {
83 s_load_error += "the schema contains dangling references to non-loaded classes:\n";
85 }
86
87 if (!m_kernel.get_bind_objects_status().empty()) {
88 s_load_error += "the data contain dangling references to non-loaded objects:\n";
90 }
91 }
92 }
93
94 static std::mutex s_log_mutex;
95 std::lock_guard scoped_lock(s_log_mutex);
96
97 log_timestamp() << "validated file \"" << m_file_name << "\" in "
98 << std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() -
99 start_usage)
100 .count() /
101 1000.
102 << " ms\n";
103 } catch (std::exception& ex) {
104 std::lock_guard lock(s_mutex);
105
106 if (s_load_error.empty()) {
108 s_load_error += ex.what();
109
110 const std::string& user_repository(m_kernel.get_user_repository_root());
111 const std::size_t user_repository_len(m_kernel.get_user_repository_root().length() + 1);
112
113 std::size_t pos;
114 while ((pos = s_load_error.find(user_repository)) != std::string::npos)
115 s_load_error.replace(pos, user_repository_len, "");
116 }
117 }
118 }
const std::string & get_user_repository_root() const
Get user OKS repository root.
Definition kernel.cpp:335
OksFile * load_file(const std::string &name, bool bind=true)
Load OKS database file.
Definition kernel.cpp:1625
const std::string & get_bind_classes_status() const noexcept
Return status of oks classes binding.
Definition kernel.hpp:1934
void set_silence_mode(const bool b)
Set status of silence mode. To switch 'On'/'Off' use the method's parameter:
Definition kernel.hpp:730
const std::string & get_bind_objects_status() const noexcept
Return status of oks objects binding.
Definition kernel.hpp:1922
std::ostream & log_timestamp(__LogSeverity__ severity=Log)
Definition kernel.cpp:5470
static void init_file_load_error(const std::string &file)
std::string s_load_error

Member Data Documentation

◆ m_file_name

const std::string& OksValidateJob::m_file_name
private

Definition at line 122 of file oks_validate_repository.cxx.

◆ m_kernel

OksKernel OksValidateJob::m_kernel
private

Definition at line 121 of file oks_validate_repository.cxx.


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