Jpp
Public Member Functions | List of all members
JDETECTOR::JPutDetectorVersion Struct Reference

Auxiliary class to map detector version to detector variant. More...

#include <JDetectorVersion.hh>

Inheritance diagram for JDETECTOR::JPutDetectorVersion:
std::map< JDetectorVersion::JVersion_t, std::string >

Public Member Functions

 JPutDetectorVersion (const JGetDetectorVersion &input)
 Constructor. More...
 
const std::string & operator() (const JDetectorVersion::JVersion_t &version) const
 Put detector version. More...
 

Detailed Description

Auxiliary class to map detector version to detector variant.

Definition at line 126 of file JDetectorVersion.hh.

Constructor & Destructor Documentation

◆ JPutDetectorVersion()

JDETECTOR::JPutDetectorVersion::JPutDetectorVersion ( const JGetDetectorVersion input)
inline

Constructor.

Parameters
inputdetector versions

Definition at line 134 of file JDetectorVersion.hh.

135  {
136  using namespace std;
137 
138  for (JGetDetectorVersion::const_iterator i = input.begin(); i != input.end(); ++i) {
139  this->insert(make_pair(i->second, i->first));
140  }
141  }

Member Function Documentation

◆ operator()()

const std::string& JDETECTOR::JPutDetectorVersion::operator() ( const JDetectorVersion::JVersion_t version) const
inline

Put detector version.

Parameters
versionversion
Returns
version

Definition at line 150 of file JDetectorVersion.hh.

151  {
152  const_iterator i = this->find(version);
153 
154  if (i != this->end()) {
155  return i->second;
156  } else {
157  THROW(JTypeInformationException, "Invalid version <" << version << ">");
158  }
159  }

The documentation for this struct was generated from the following file:
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:669
std
Definition: jaanetDictionary.h:36