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 21 of file ReleaseVersion.cc.

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

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

Member Function Documentation

◆ operator<()

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

Definition at line 51 of file ReleaseVersion.cc.

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

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

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<().