7namespace datahandlinglibs {
9template<
typename DataType>
12 std::lock_guard<std::mutex> guard(
m_mutex);
14 TLOG() <<
"Registering DataMoveCallback with ID: " << id;
17 TLOG() <<
"Callback is already registered with ID: " <<
id <<
" Ignoring this registration.";
21template<
typename DataType>
22inline std::shared_ptr<std::function<void(DataType&&)>>
25 std::lock_guard<std::mutex> guard(
m_mutex);
27 TLOG() <<
"Providing DataMoveCallback with ID: " << id;
29 return callback->m_callback;
34 std::format(
"Callback cast failed for function signature with datatypes (expected vs. registered) : {} vs. {}",
39 TLOG() <<
"No callback registered with ID: " <<
id <<
" Returning nullptr.";
static std::shared_ptr< DataMoveCallbackRegistry > get()
void register_callback(const std::string &id, std::function< void(DataType &&)> callback)
std::shared_ptr< std::function< void(DataType &&)> > get_callback(const std::string &id)
Gets the callback function registered with the given ID.
std::map< std::string, std::shared_ptr< CallbackConcept > > m_callback_map
SourceID[" << sourceid << "] Command daqdataformats::SourceID Readout Initialization std::string initerror Configuration std::string conferror GenericConfigurationError