diff --git a/src/libraries/JANA/Omni/JComponent.h b/src/libraries/JANA/Omni/JComponent.h index 11439c893..b37ab587e 100644 --- a/src/libraries/JANA/Omni/JComponent.h +++ b/src/libraries/JANA/Omni/JComponent.h @@ -97,11 +97,11 @@ class JComponent::Service : public JComponent::ServiceBase { return *m_data; } - ServiceT& operator->() { + ServiceT* operator->() { if (m_data == nullptr) { throw JException("Attempted to access a Service which hasn't been attached to this Component yet!"); } - return *m_data; + return m_data.get(); } protected: diff --git a/src/libraries/JANA/Services/JComponentManager.cc b/src/libraries/JANA/Services/JComponentManager.cc index 9f3b7899e..d9b34939c 100644 --- a/src/libraries/JANA/Services/JComponentManager.cc +++ b/src/libraries/JANA/Services/JComponentManager.cc @@ -32,11 +32,11 @@ JComponentManager::~JComponentManager() { void JComponentManager::Init() { - m_params().SetDefaultParameter("event_source_type", m_user_evt_src_typename, "Manually specifies which JEventSource should open the input file"); - m_params().SetDefaultParameter("record_call_stack", m_enable_call_graph_recording, "Records a trace of who called each factory. Reduces performance but necessary for plugins such as janadot."); - m_params().SetDefaultParameter("jana:nevents", m_nevents, "Max number of events that sources can emit"); - m_params().SetDefaultParameter("jana:nskip", m_nskip, "Number of events that sources should skip before starting emitting"); - m_params().FilterParameters(m_default_tags, "DEFTAG:"); + m_params->SetDefaultParameter("event_source_type", m_user_evt_src_typename, "Manually specifies which JEventSource should open the input file"); + m_params->SetDefaultParameter("record_call_stack", m_enable_call_graph_recording, "Records a trace of who called each factory. Reduces performance but necessary for plugins such as janadot."); + m_params->SetDefaultParameter("jana:nevents", m_nevents, "Max number of events that sources can emit"); + m_params->SetDefaultParameter("jana:nskip", m_nskip, "Number of events that sources should skip before starting emitting"); + m_params->FilterParameters(m_default_tags, "DEFTAG:"); // Look for factories to auto-activate // Right now AutoActivator parameter won't show up in parameters list. Reconsider this. @@ -48,23 +48,23 @@ void JComponentManager::Init() { void JComponentManager::configure_components() { for (auto* src : m_evt_srces) { src->SetApplication(GetApplication()); - src->SetLogger(m_logging().get_logger(src->GetLoggerName())); + src->SetLogger(m_logging->get_logger(src->GetLoggerName())); } for (auto* proc : m_evt_procs) { proc->SetApplication(GetApplication()); - proc->SetLogger(m_logging().get_logger(proc->GetLoggerName())); + proc->SetLogger(m_logging->get_logger(proc->GetLoggerName())); } for (auto* fac_gen : m_fac_gens) { fac_gen->SetApplication(GetApplication()); - //fac_gen->SetLogger(m_logging().get_logger(fac_gen->GetLoggerName())); + //fac_gen->SetLogger(m_logging->get_logger(fac_gen->GetLoggerName())); } for (auto* src_gen : m_src_gens) { src_gen->SetJApplication(GetApplication()); - //src_gen->SetLogger(m_logging().get_logger(src_gen->GetLoggerName())); + //src_gen->SetLogger(m_logging->get_logger(src_gen->GetLoggerName())); } for (auto* unfolder : m_unfolders) { unfolder->SetApplication(GetApplication()); - unfolder->SetLogger(m_logging().get_logger(unfolder->GetLoggerName())); + unfolder->SetLogger(m_logging->get_logger(unfolder->GetLoggerName())); } } diff --git a/src/libraries/JANA/Services/JPluginLoader.cc b/src/libraries/JANA/Services/JPluginLoader.cc index c524d3294..eee7c5eee 100644 --- a/src/libraries/JANA/Services/JPluginLoader.cc +++ b/src/libraries/JANA/Services/JPluginLoader.cc @@ -16,10 +16,10 @@ class JApplication; void JPluginLoader::Init() { - m_params().SetDefaultParameter("plugins", m_plugins_to_include, "Comma-separated list of plugins to load."); - m_params().SetDefaultParameter("plugins_to_ignore", m_plugins_to_exclude, "Comma-separated list of plugins to NOT load, even if they are specified in 'plugins'."); - m_params().SetDefaultParameter("jana:plugin_path", m_plugin_paths_str, "Colon-separated list of paths to search for plugins"); - m_params().SetDefaultParameter("jana:debug_plugin_loading", m_verbose, "Trace the plugin search path and display any loading errors"); + m_params->SetDefaultParameter("plugins", m_plugins_to_include, "Comma-separated list of plugins to load."); + m_params->SetDefaultParameter("plugins_to_ignore", m_plugins_to_exclude, "Comma-separated list of plugins to NOT load, even if they are specified in 'plugins'."); + m_params->SetDefaultParameter("jana:plugin_path", m_plugin_paths_str, "Colon-separated list of paths to search for plugins"); + m_params->SetDefaultParameter("jana:debug_plugin_loading", m_verbose, "Trace the plugin search path and display any loading errors"); if (m_verbose) { // The jana:debug_plugin_loading parameter is kept around for backwards compatibility diff --git a/src/programs/unit_tests/JServiceLocatorTests.cc b/src/programs/unit_tests/JServiceLocatorTests.cc index 329e9685b..41f00b369 100644 --- a/src/programs/unit_tests/JServiceLocatorTests.cc +++ b/src/programs/unit_tests/JServiceLocatorTests.cc @@ -81,7 +81,7 @@ struct OmniService : public JService { void Init() override { LOG_INFO(GetLogger()) << "Calling OmniService::Init" << LOG_END; - REQUIRE(parman().GetParameterValue("bucket_count") == 22); + REQUIRE(parman->GetParameterValue("bucket_count") == 22); REQUIRE(bucket_count() == 22); } };