Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 128 of file JDetectorVersion.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
inputdetector versions

Definition at line 136 of file JDetectorVersion.hh.

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

Member Function Documentation

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

Put detector version.

Parameters
versionversion
Returns
version

Definition at line 152 of file JDetectorVersion.hh.

153  {
154  using namespace JPP;
155 
156  const_iterator i = this->find(version);
157 
158  if (i != this->end()) {
159 
160  return i->second;
161 
162  } else {
163 
164  THROW(JTypeInformationException, "Invalid version <" << version << ">");
165  }
166  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633

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