CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::releaseversion::DecomposedReleaseVersion Class Reference

#include <ReleaseVersion.h>

Public Member Functions

 DecomposedReleaseVersion (std::string releaseVersion)
 
bool operator< (DecomposedReleaseVersion const &other) const
 

Private Attributes

bool irregular_
 
unsigned int major_
 
unsigned int minor_
 

Detailed Description

Definition at line 9 of file ReleaseVersion.h.

Constructor & Destructor Documentation

◆ DecomposedReleaseVersion()

edm::releaseversion::DecomposedReleaseVersion::DecomposedReleaseVersion ( std::string  releaseVersion)
explicit

Definition at line 22 of file ReleaseVersion.cc.

23  : irregular_(true), major_(0), minor_(0) /*, point_(0), patch_(0), pre_(0)*/ {
24  try {
25  std::vector<std::string> parts;
26  parts.reserve(releaseVersion.size());
27  boost::algorithm::split(parts, releaseVersion, IsNotDigit(), boost::algorithm::token_compress_on);
28  parts.erase(remove_if(parts.begin(), parts.end(), IsEmpty()), parts.end());
29 
30  if (parts.size() < 3) {
31  return;
32  }
33  /*
34  if(parts.size() == 4) {
35  if(releaseVersion.find("patch") != std::string::npos) {
36  patch_ = boost::lexical_cast<unsigned int>(parts[3]);
37  } else if(releaseVersion.find("pre") != std::string::npos) {
38  pre_ = boost::lexical_cast<unsigned int>(parts[3]);
39  } else {
40  return;
41  }
42  }
43 */
44  major_ = boost::lexical_cast<unsigned int>(parts[0]);
45  minor_ = boost::lexical_cast<unsigned int>(parts[1]);
46  // point_ = boost::lexical_cast<unsigned int>(parts[2]);
47  irregular_ = false;
48  } catch (std::exception const&) {
49  }
50  }

References cppFunctionSkipper::exception, irregular_, major_, minor_, contentValuesFiles::parts, and submitPVValidationJobs::split().

Member Function Documentation

◆ operator<()

bool edm::releaseversion::DecomposedReleaseVersion::operator< ( DecomposedReleaseVersion const &  other) const

Definition at line 52 of file ReleaseVersion.cc.

52  {
53  if (irregular_ || other.irregular_)
54  return false;
55  if (major_ < other.major_)
56  return true;
57  if (major_ > other.major_)
58  return false;
59  if (minor_ < other.minor_)
60  return true;
61  // if(minor_ > other.minor_) return false;
62  // if(point_ < other.point_) return true;
63  // if(point_ > other.point_) return false;
64  // if(patch_ < other.patch_) return true;
65  // if(patch_ > other.patch_) return false;
66  // if(pre_ < other.pre_) return true;
67  return false;
68  }

References irregular_, major_, minor_, and trackingPlots::other.

Member Data Documentation

◆ irregular_

bool edm::releaseversion::DecomposedReleaseVersion::irregular_
private

Definition at line 15 of file ReleaseVersion.h.

Referenced by DecomposedReleaseVersion(), and operator<().

◆ major_

unsigned int edm::releaseversion::DecomposedReleaseVersion::major_
private

Definition at line 16 of file ReleaseVersion.h.

Referenced by DecomposedReleaseVersion(), and operator<().

◆ minor_

unsigned int edm::releaseversion::DecomposedReleaseVersion::minor_
private

Definition at line 17 of file ReleaseVersion.h.

Referenced by DecomposedReleaseVersion(), and operator<().

contentValuesFiles.parts
parts
Definition: contentValuesFiles.py:58
submitPVValidationJobs.split
def split(sequence, size)
Definition: submitPVValidationJobs.py:352
edm::releaseversion::DecomposedReleaseVersion::major_
unsigned int major_
Definition: ReleaseVersion.h:16
trackingPlots.other
other
Definition: trackingPlots.py:1460
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
edm::releaseversion::DecomposedReleaseVersion::minor_
unsigned int minor_
Definition: ReleaseVersion.h:17
edm::releaseversion::DecomposedReleaseVersion::irregular_
bool irregular_
Definition: ReleaseVersion.h:15