7namespace datahandlinglibs {
9template<
typename DataType>
13 std::lock_guard<std::mutex> guard(
m_mutex);
14 std::string
id = conf->
UID();
16 TLOG() <<
"Registering DataMoveCallback with ID: " << id;
19 TLOG() <<
"Callback is already registered with ID: " <<
id <<
" Ignoring this registration.";
23template<
typename DataType>
24inline std::shared_ptr<std::function<void(DataType&&)>>
27 std::lock_guard<std::mutex> guard(
m_mutex);
28 std::string
id = conf->
UID();
30 TLOG() <<
"Providing DataMoveCallback with ID: " << id;
32 return callback->m_callback;
38 std::format(
"Callback cast failed for function signature with datatypes (expected vs. registered) : {} vs. {}",
43 TLOG() <<
"No callback registered with ID: " <<
id <<
" Returning nullptr.";
const std::string & UID() const noexcept
static std::shared_ptr< DataMoveCallbackRegistry > get()
std::map< std::string, std::shared_ptr< CallbackConcept > > m_callback_map
std::shared_ptr< std::function< void(DataType &&)> > get_callback(const appmodel::DataMoveCallbackConf *conf)
Gets the callback function registered with the given configuration.
void register_callback(const appmodel::DataMoveCallbackConf *conf, std::function< void(DataType &&)> callback)
Registers a callback function with a configuration object.
SourceID[" << sourceid << "] Command daqdataformats::SourceID Readout Initialization std::string initerror Configuration std::string conferror GenericConfigurationError