PandaRoot
PndParameterRegister Class Reference

Helper class to indirect the Parameter fetching via the FairRuntimeDb. More...

#include <PndParameterRegister.h>

Public Member Functions

void AddRequest (const std::string &t_request)
 Add a parameter name to the list of requested parameters. More...
 
void AddRequestList (const std::vector< std::string > &t_requests)
 Add a list of parameter names to the list of requested parameters. More...
 
FairParSet * GetParameter (const std::string &t_name) const
 Access the parameter via the name. More...
 
void SetParameter (const std::string &t_name, FairParSet *t_parameter)
 Set the parameter pointer t_parameter for the parameter t_name. More...
 
const std::vector< std::string > & GetRequestList () const
 Get the list of requested parameter names. More...
 

Detailed Description

Helper class to indirect the Parameter fetching via the FairRuntimeDb.

Author
Ben Salisbury salis.nosp@m.bury.nosp@m.@hisk.nosp@m.p.un.nosp@m.i-bon.nosp@m.n.de, HISKP Bonn
Date
2021-02

Definition at line 18 of file PndParameterRegister.h.

Member Function Documentation

◆ AddRequest()

void PndParameterRegister::AddRequest ( const std::string &  t_request)
inline

Add a parameter name to the list of requested parameters.

Parameters
t_request

Definition at line 25 of file PndParameterRegister.h.

Referenced by AddRequestList().

26  {
27  if (std::find(std::begin(fRequests), std::end(fRequests), t_request) == std::end(fRequests)) {
28  fRequests.push_back(t_request);
29  }
30  }

◆ AddRequestList()

void PndParameterRegister::AddRequestList ( const std::vector< std::string > &  t_requests)
inline

Add a list of parameter names to the list of requested parameters.

Parameters
t_requests

Definition at line 37 of file PndParameterRegister.h.

References AddRequest().

38  {
39  for (const std::string &request : t_requests) {
40  AddRequest(request);
41  }
42  }
void AddRequest(const std::string &t_request)
Add a parameter name to the list of requested parameters.

◆ GetParameter()

FairParSet* PndParameterRegister::GetParameter ( const std::string &  t_name) const
inline

Access the parameter via the name.

Parameters
t_name
Returns
FairParSet*

Definition at line 50 of file PndParameterRegister.h.

Referenced by BSEmcParameterLoadingProcess< DataStruct >::SetupParameters().

51  {
52  if (fRegister.find(t_name) != fRegister.end()) {
53  return fRegister.at(t_name);
54  }
55  return nullptr;
56  }

◆ GetRequestList()

const std::vector<std::string>& PndParameterRegister::GetRequestList ( ) const
inline

Get the list of requested parameter names.

Returns
const std::vector<std::string>&

Definition at line 78 of file PndParameterRegister.h.

78 { return fRequests; }

◆ SetParameter()

void PndParameterRegister::SetParameter ( const std::string &  t_name,
FairParSet *  t_parameter 
)
inline

Set the parameter pointer t_parameter for the parameter t_name.

Parameters
t_name
t_parameter

Definition at line 64 of file PndParameterRegister.h.

65  {
66  if (fRegister.find(t_name) != fRegister.end()) {
67  return;
68  } else {
69  fRegister[t_name] = t_parameter;
70  }
71  }

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