CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 26 of file ReleaseVersion.cc.

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

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

Member Function Documentation

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

Definition at line 56 of file ReleaseVersion.cc.

References irregular_, major_, and minor_.

56  {
57  if(irregular_ || other.irregular_) return false;
58  if(major_ < other.major_) return true;
59  if(major_ > other.major_) return false;
60  if(minor_ < other.minor_) 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 14 of file ReleaseVersion.h.

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

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

Definition at line 15 of file ReleaseVersion.h.

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

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

Definition at line 16 of file ReleaseVersion.h.

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