#include <ParameterSetRegistry.h>
|
static std::recursive_mutex | mutex_ {} |
|
Definition at line 46 of file ParameterSetRegistry.h.
fhicl::ParameterSetRegistry::ParameterSetRegistry |
( |
ParameterSet const & |
| ) |
|
|
delete |
fhicl::ParameterSetRegistry::ParameterSetRegistry |
( |
ParameterSet && |
| ) |
|
|
delete |
fhicl::ParameterSetRegistry::~ParameterSetRegistry |
( |
| ) |
|
Definition at line 65 of file ParameterSetRegistry.cc.
67 sqlite3_finalize(
stmt_);
72 std::cerr << e.what() <<
'\n';
79 }
while (retcode == SQLITE_BUSY);
void throwOnSQLiteFailure(int rc, char *msg=nullptr)
cet::coded_exception< error, detail::translate > exception
fhicl::ParameterSetRegistry::ParameterSetRegistry |
( |
| ) |
|
|
private |
bool fhicl::ParameterSetRegistry::empty |
( |
| ) |
|
|
inlinestatic |
Definition at line 110 of file ParameterSetRegistry.h.
112 std::lock_guard sentry{
mutex_};
collection_type registry_
static std::recursive_mutex mutex_
static ParameterSetRegistry & instance_()
void fhicl::ParameterSetRegistry::exportTo |
( |
sqlite3 * |
db | ) |
|
|
static |
Definition at line 127 of file ParameterSetRegistry.cc.
130 std::lock_guard sentry{
mutex_};
134 "DROP TABLE IF EXISTS ParameterSets;" 135 "CREATE TABLE ParameterSets(ID PRIMARY KEY, PSetBlob);");
141 "INSERT OR IGNORE INTO ParameterSets(ID, PSetBlob) VALUES(?, ?);",
149 sqlite3_bind_text(oStmt, 1,
id.c_str(),
id.
size() + 1, SQLITE_STATIC);
152 oStmt, 2, psBlob.c_str(), psBlob.size() + 1, SQLITE_STATIC);
154 switch (sqlite3_step(oStmt)) {
156 sqlite3_reset(oStmt);
167 regPSes <<
select(
"*").from(primaryDB,
"ParameterSets");
169 for (
auto const& [idString, psBlob] : regPSes) {
171 oStmt, 1, idString.c_str(), idString.size() + 1, SQLITE_STATIC);
174 oStmt, 2, psBlob.c_str(), psBlob.size() + 1, SQLITE_STATIC);
176 switch (sqlite3_step(oStmt)) {
178 sqlite3_reset(oStmt);
185 sqlite3_finalize(oStmt);
struct sqlite3_stmt sqlite3_stmt
collection_type registry_
auto select(T const &...t)
static std::recursive_mutex mutex_
void throwOnSQLiteFailure(int rc, char *msg=nullptr)
void exec(sqlite3 *db, std::string const &ddl)
static ParameterSetRegistry & instance_()
Definition at line 214 of file ParameterSetRegistry.cc.
220 if (
stmt_ ==
nullptr) {
222 "SELECT PSetBlob FROM ParameterSets WHERE ID = ?;",
228 auto idString =
id.to_string();
229 auto result = sqlite3_bind_text(
230 stmt_, 1, idString.c_str(), idString.size() + 1, SQLITE_STATIC);
237 reinterpret_cast<char const*>(sqlite3_column_text(
stmt_, 0)));
246 sqlite3_reset(
stmt_);
static ParameterSet make(intermediate_table const &tbl)
collection_type registry_
void throwOnSQLiteFailure(int rc, char *msg=nullptr)
auto fhicl::ParameterSetRegistry::get |
( |
| ) |
|
|
inlinestaticnoexcept |
Definition at line 165 of file ParameterSetRegistry.h.
167 std::lock_guard sentry{
mutex_};
collection_type registry_
static std::recursive_mutex mutex_
static ParameterSetRegistry & instance_()
Definition at line 172 of file ParameterSetRegistry.h.
175 std::lock_guard sentry{
mutex_};
179 <<
"with ID " <<
id.to_string() <<
" in the registry.";
collection_type registry_
static std::recursive_mutex mutex_
const_iterator find_(ParameterSetID const &id)
cet::coded_exception< error, detail::translate > exception
static ParameterSetRegistry & instance_()
Definition at line 185 of file ParameterSetRegistry.h.
187 std::lock_guard sentry{
mutex_};
static constexpr double ps
collection_type registry_
static std::recursive_mutex mutex_
const_iterator find_(ParameterSetID const &id)
static ParameterSetRegistry & instance_()
Definition at line 198 of file ParameterSetRegistry.h.
200 std::lock_guard sentry{
mutex_};
static const_iterator cend()
collection_type registry_
static std::recursive_mutex mutex_
static ParameterSetRegistry & instance_()
void fhicl::ParameterSetRegistry::importFrom |
( |
sqlite3 * |
db | ) |
|
|
static |
Definition at line 83 of file ParameterSetRegistry.cc.
86 std::lock_guard sentry{
mutex_};
96 "INSERT OR IGNORE INTO ParameterSets(ID, PSetBlob) VALUES(?, ?);",
104 inputPSes <<
select(
"*").from(db,
"ParameterSets");
106 for (
auto const& [idString, psBlob] : inputPSes) {
108 oStmt, 1, idString.c_str(), idString.size() + 1, SQLITE_STATIC);
111 oStmt, 2, psBlob.c_str(), psBlob.size() + 1, SQLITE_STATIC);
113 switch (sqlite3_step(oStmt)) {
119 sqlite3_reset(oStmt);
122 sqlite3_finalize(oStmt);
struct sqlite3_stmt sqlite3_stmt
auto select(T const &...t)
static std::recursive_mutex mutex_
void throwOnSQLiteFailure(int rc, char *msg=nullptr)
static ParameterSetRegistry & instance_()
auto fhicl::ParameterSetRegistry::instance_ |
( |
| ) |
|
|
inlinestaticprivate |
auto fhicl::ParameterSetRegistry::put |
( |
ParameterSet const & |
ps | ) |
|
|
inlinestatic |
Definition at line 125 of file ParameterSetRegistry.h.
128 std::lock_guard sentry{
mutex_};
static constexpr double ps
collection_type registry_
static std::recursive_mutex mutex_
static ParameterSetRegistry & instance_()
template<class FwdIt >
static std::enable_if_t< std::is_same_v<typename std::iterator_traits<FwdIt>::value_type, mapped_type> > fhicl::ParameterSetRegistry::put |
( |
FwdIt |
begin, |
|
|
FwdIt |
end |
|
) |
| |
|
static |
template<class FwdIt >
static std::enable_if_t< std::is_same_v<typename std::iterator_traits<FwdIt>::value_type, value_type> > fhicl::ParameterSetRegistry::put |
( |
FwdIt |
begin, |
|
|
FwdIt |
end |
|
) |
| |
|
static |
template<class FwdIt >
auto fhicl::ParameterSetRegistry::put |
( |
FwdIt |
b, |
|
|
FwdIt const |
e |
|
) |
| -> std::enable_if_t<
std::is_same_v<typename std::iterator_traits<FwdIt>::value_type, mapped_type>>
|
|
inline |
auto fhicl::ParameterSetRegistry::size |
( |
| ) |
|
|
inlinestatic |
Definition at line 117 of file ParameterSetRegistry.h.
119 std::lock_guard sentry{
mutex_};
collection_type registry_
static std::recursive_mutex mutex_
static ParameterSetRegistry & instance_()
void fhicl::ParameterSetRegistry::stageIn |
( |
| ) |
|
|
static |
Definition at line 190 of file ParameterSetRegistry.cc.
192 std::lock_guard sentry{
mutex_};
198 entriesToStageIn <<
select(
"*").from(primaryDB,
"ParameterSets");
201 std::inserter(registry,
std::begin(registry)),
202 [](
auto const&
row) {
203 auto const& [idString, psBlob] =
row;
205 return std::make_pair(ParameterSetID{idString}, pset);
static ParameterSet make(intermediate_table const &tbl)
auto transform_all(Container &, OutputIt, UnaryOp)
collection_type registry_
auto select(T const &...t)
static std::recursive_mutex mutex_
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
static ParameterSetRegistry & instance_()
std::recursive_mutex fhicl::ParameterSetRegistry::mutex_ {} |
|
staticprivate |
sqlite3* fhicl::ParameterSetRegistry::primaryDB_ |
|
private |
The documentation for this class was generated from the following files: