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

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

Definition at line 22 of file ReleaseVersion.cc.

References cppFunctionSkipper::exception, irregular_, major_, minor_, CfgNavigationSchool_cfi::parts, and split.

Referenced by edm::releaseversion::isEarlierRelease().

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  }
double split
Definition: MVATrainer.cc:139

Member Function Documentation

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

Definition at line 52 of file ReleaseVersion.cc.

References irregular_, major_, and minor_.

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  }

Member Data Documentation

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

Definition at line 15 of file ReleaseVersion.h.

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

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

Definition at line 16 of file ReleaseVersion.h.

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

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

Definition at line 17 of file ReleaseVersion.h.

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