ATLAS Offline Software
Loading...
Searching...
No Matches
Version.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <sstream>
8#include <string>
9#include <iomanip>
10
11namespace InDetDD {
12
13Version::Version(const std::string & tag,
14 const std::string & name,
15 const std::string & layout,
16 const std::string & description,
17 int major,
18 int minor,
19 int patch)
20 : m_tag(tag),
21 m_name(name),
24 m_major(major),
25 m_minor(minor),
26 m_patch(patch)
27{}
28
29
30
32 : m_major(0),
33 m_minor(0),
34 m_patch(0)
35{}
36
37const std::string &
39{
40 return m_tag;
41}
42
43const std::string &
45{
46 return m_name;
47}
48
49const std::string &
51{
52 return m_layout;
53}
54
55const std::string &
57{
58 return m_description;
59}
60
61int
63{
64 return m_major;
65}
66
67int
69{
70 return m_minor;
71}
72
73int
75{
76 return m_patch;
77}
78
79std::string
81{
82 std::ostringstream ostr;
83 ostr << m_major
84 << "." << std::setfill('0') << std::setw(2) << m_minor
85 << "." << std::setfill('0') << std::setw(2) << m_patch;
86 return ostr.str();
87}
88
89std::string
91{
92
93 // Output of the form
94 // Version: SCT-DC1-00, Name: DC1, Layout: Final, Code Version: 02.01.01, Description: DC1 Geometry
95
96 std::ostringstream ostr;
97 ostr << "Version: " << m_tag << ", Name: " << m_name << ", Layout: " << m_layout
98 << ", Code Version: " << versionNumber();
99 if (!m_description.empty()) {
100 ostr << ", Description: " << m_description;
101 }
102 return ostr.str();
103}
104
105} // namespace InDetDD
std::string fullDescription() const
Full Description For example, Version: SCT-DC1-00, Name: DC1, Layout: Final, Code Version: 2....
Definition Version.cxx:90
int minorNum() const
Minor version number.
Definition Version.cxx:68
Version()
Empty Constructor.
Definition Version.cxx:31
std::string versionNumber() const
Print out version number (eg.
Definition Version.cxx:80
const std::string & layout() const
Layout (eg Initial, Final, TestBeam)
Definition Version.cxx:50
std::string m_name
Definition Version.h:73
std::string m_layout
Definition Version.h:74
std::string m_description
Definition Version.h:75
const std::string & name() const
Version label.
Definition Version.cxx:44
int majorNum() const
Major version number.
Definition Version.cxx:62
const std::string & tag() const
Version tag.
Definition Version.cxx:38
int patchNum() const
Patch version number.
Definition Version.cxx:74
std::string m_tag
Definition Version.h:72
const std::string & description() const
Description or comment.
Definition Version.cxx:56
Message Stream Member.