origen_std_lib 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/application.rb +13 -0
- data/config/version.rb +1 -1
- data/stdlib/v93k/origen/Debug/liborigen.so +0 -0
- data/stdlib/v93k/origen/Debug/makefile +63 -0
- data/stdlib/v93k/origen/Debug/objects.mk +8 -0
- data/stdlib/v93k/origen/Debug/origen.d +1477 -0
- data/stdlib/v93k/origen/Debug/origen.o +0 -0
- data/stdlib/v93k/origen/Debug/origen/helpers/console.d +1483 -0
- data/stdlib/v93k/origen/Debug/origen/helpers/console.o +0 -0
- data/stdlib/v93k/origen/Debug/origen/helpers/misc.d +1483 -0
- data/stdlib/v93k/origen/Debug/origen/helpers/misc.o +0 -0
- data/stdlib/v93k/origen/Debug/origen/helpers/subdir.mk +27 -0
- data/stdlib/v93k/origen/Debug/origen/site.d +1469 -0
- data/stdlib/v93k/origen/Debug/origen/site.o +0 -0
- data/stdlib/v93k/origen/Debug/origen/subdir.mk +24 -0
- data/stdlib/v93k/origen/Debug/origen/test_method/dc_measurement.d +1501 -0
- data/stdlib/v93k/origen/Debug/origen/test_method/dc_measurement.o +0 -0
- data/stdlib/v93k/origen/Debug/origen/test_method/frequency_measurement.d +1502 -0
- data/stdlib/v93k/origen/Debug/origen/test_method/frequency_measurement.o +0 -0
- data/stdlib/v93k/origen/Debug/origen/test_method/functional_test.d +1501 -0
- data/stdlib/v93k/origen/Debug/origen/test_method/functional_test.o +0 -0
- data/stdlib/v93k/origen/Debug/origen/test_method/subdir.mk +30 -0
- data/stdlib/v93k/origen/Debug/origen/utils/subdir.mk +24 -0
- data/stdlib/v93k/origen/Debug/origen/utils/version.d +4 -0
- data/stdlib/v93k/origen/Debug/origen/utils/version.o +0 -0
- data/stdlib/v93k/origen/Debug/sources.mk +32 -0
- data/stdlib/v93k/origen/Debug/subdir.mk +24 -0
- data/stdlib/v93k/origen/Debug/test_methods/ApplyBin.d +1487 -0
- data/stdlib/v93k/origen/Debug/test_methods/ApplyBin.o +0 -0
- data/stdlib/v93k/origen/Debug/test_methods/DCMeasurement.d +1508 -0
- data/stdlib/v93k/origen/Debug/test_methods/DCMeasurement.o +0 -0
- data/stdlib/v93k/origen/Debug/test_methods/FrequencyMeasurement.d +1508 -0
- data/stdlib/v93k/origen/Debug/test_methods/FrequencyMeasurement.o +0 -0
- data/stdlib/v93k/origen/Debug/test_methods/FunctionalTest.d +1511 -0
- data/stdlib/v93k/origen/Debug/test_methods/FunctionalTest.o +0 -0
- data/stdlib/v93k/origen/Debug/test_methods/RecordBin.d +1487 -0
- data/stdlib/v93k/origen/Debug/test_methods/RecordBin.o +0 -0
- data/stdlib/v93k/origen/Debug/test_methods/subdir.mk +36 -0
- data/stdlib/v93k/origen/origen.cpp +22 -0
- data/stdlib/v93k/origen/origen.hpp +22 -0
- data/stdlib/v93k/origen/origen/helpers.hpp +44 -0
- data/stdlib/v93k/origen/origen/helpers/console.cpp +105 -0
- data/stdlib/v93k/origen/origen/helpers/misc.cpp +305 -0
- data/stdlib/v93k/origen/origen/site.cpp +220 -0
- data/stdlib/v93k/origen/origen/site.hpp +51 -0
- data/stdlib/v93k/origen/origen/test_method.hpp +17 -0
- data/stdlib/v93k/origen/origen/test_method/base.hpp +151 -0
- data/stdlib/v93k/origen/origen/test_method/dc_measurement.cpp +182 -0
- data/stdlib/v93k/origen/origen/test_method/dc_measurement.hpp +59 -0
- data/stdlib/v93k/origen/origen/test_method/frequency_measurement.cpp +109 -0
- data/stdlib/v93k/origen/origen/test_method/frequency_measurement.hpp +48 -0
- data/stdlib/v93k/origen/origen/test_method/functional_test.cpp +119 -0
- data/stdlib/v93k/origen/origen/test_method/functional_test.hpp +51 -0
- data/stdlib/v93k/origen/origen/utils.hpp +12 -0
- data/stdlib/v93k/origen/origen/utils/version.cpp +79 -0
- data/stdlib/v93k/origen/origen/utils/version.hpp +64 -0
- data/stdlib/v93k/origen/test_methods/ApplyBin.cpp +41 -0
- data/stdlib/v93k/origen/test_methods/DCMeasurement.cpp +127 -0
- data/stdlib/v93k/origen/test_methods/FrequencyMeasurement.cpp +91 -0
- data/stdlib/v93k/origen/test_methods/FunctionalTest.cpp +92 -0
- data/stdlib/v93k/origen/test_methods/RecordBin.cpp +48 -0
- metadata +60 -1
@@ -0,0 +1,59 @@
|
|
1
|
+
#ifndef ORIGEN_TEST_METHOD_DC_MEASUREMENT_INCLUDED
|
2
|
+
#define ORIGEN_TEST_METHOD_DC_MEASUREMENT_INCLUDED
|
3
|
+
|
4
|
+
#include "base.hpp"
|
5
|
+
#include "mapi.hpp"
|
6
|
+
#include "rdi.hpp"
|
7
|
+
|
8
|
+
using namespace std;
|
9
|
+
|
10
|
+
namespace Origen {
|
11
|
+
namespace TestMethod {
|
12
|
+
|
13
|
+
class DCMeasurement: public Base {
|
14
|
+
void serialProcessing(int site);
|
15
|
+
|
16
|
+
int _applyShutdown;
|
17
|
+
string _shutdownPattern;
|
18
|
+
int _checkShutdown;
|
19
|
+
string _measure;
|
20
|
+
double _settlingTime;
|
21
|
+
string _pin;
|
22
|
+
double _forceValue;
|
23
|
+
double _iRange;
|
24
|
+
int _processResults;
|
25
|
+
int _badc;
|
26
|
+
|
27
|
+
public:
|
28
|
+
DCMeasurement();
|
29
|
+
virtual ~DCMeasurement();
|
30
|
+
void SMC_backgroundProcessing();
|
31
|
+
void execute();
|
32
|
+
|
33
|
+
DCMeasurement & applyShutdown(int v);
|
34
|
+
DCMeasurement & shutdownPattern(string v);
|
35
|
+
DCMeasurement & checkShutdown(int v);
|
36
|
+
DCMeasurement & measure(string v);
|
37
|
+
DCMeasurement & settlingTime(double v);
|
38
|
+
DCMeasurement & pin(string v);
|
39
|
+
DCMeasurement & forceValue(double v);
|
40
|
+
DCMeasurement & iRange(double v);
|
41
|
+
DCMeasurement & processResults(int v);
|
42
|
+
DCMeasurement & badc(int v);
|
43
|
+
|
44
|
+
protected:
|
45
|
+
DCMeasurement & getThis();
|
46
|
+
|
47
|
+
// Member/instance variables, declared outside the execute function body since
|
48
|
+
// they may be useful to refer to in callback functions
|
49
|
+
ARRAY_I activeSites;
|
50
|
+
string testSuiteName;
|
51
|
+
string label;
|
52
|
+
vector<int> funcResultsPre;
|
53
|
+
vector<int> funcResultsPost;
|
54
|
+
vector<double> results;
|
55
|
+
};
|
56
|
+
|
57
|
+
}
|
58
|
+
}
|
59
|
+
#endif
|
@@ -0,0 +1,109 @@
|
|
1
|
+
#include "frequency_measurement.hpp"
|
2
|
+
|
3
|
+
using namespace std;
|
4
|
+
|
5
|
+
namespace Origen {
|
6
|
+
namespace TestMethod {
|
7
|
+
|
8
|
+
|
9
|
+
FrequencyMeasurement::FrequencyMeasurement() {
|
10
|
+
samples(2000);
|
11
|
+
processResults(1);
|
12
|
+
}
|
13
|
+
FrequencyMeasurement::~FrequencyMeasurement() { }
|
14
|
+
|
15
|
+
/// By default the limits are assumed to be expressed as a frequency, set this to 1 if they refer to a target period
|
16
|
+
FrequencyMeasurement & FrequencyMeasurement::periodBased(int v) { _periodBased = v; return *this; }
|
17
|
+
/// REQUIRED: The name of the pin being measured
|
18
|
+
FrequencyMeasurement & FrequencyMeasurement::pin(string v) { _pin = v; return *this; }
|
19
|
+
/// The number of samples captured by the pattern, the default is 2000
|
20
|
+
FrequencyMeasurement & FrequencyMeasurement::samples(int v) { _samples = v; return *this; }
|
21
|
+
/// REQUIRED: Supply the period of the captured vectors in nanoseconds
|
22
|
+
FrequencyMeasurement & FrequencyMeasurement::periodInNs(int v) { _periodInNs = v; return *this; }
|
23
|
+
/// When set to 0 the results of the test will not be judged or logged
|
24
|
+
FrequencyMeasurement & FrequencyMeasurement::processResults(int v) { _processResults = v; return *this; }
|
25
|
+
|
26
|
+
// All test methods must implement these functions
|
27
|
+
FrequencyMeasurement & FrequencyMeasurement::getThis() { return *this; }
|
28
|
+
|
29
|
+
void FrequencyMeasurement::execute() {
|
30
|
+
|
31
|
+
int site, physicalSites;
|
32
|
+
ARRAY_I sites;
|
33
|
+
|
34
|
+
RDI_INIT();
|
35
|
+
|
36
|
+
ON_FIRST_INVOCATION_BEGIN();
|
37
|
+
|
38
|
+
enableHiddenUpload();
|
39
|
+
GET_ACTIVE_SITES(activeSites);
|
40
|
+
physicalSites = GET_CONFIGURED_SITES(sites);
|
41
|
+
funcResults.resize(physicalSites + 1);
|
42
|
+
GET_TESTSUITE_NAME(testSuiteName);
|
43
|
+
label = Primary.getLabel();
|
44
|
+
pin(extractPinsFromGroup(_pin));
|
45
|
+
|
46
|
+
callPreTestFunc();
|
47
|
+
|
48
|
+
RDI_BEGIN();
|
49
|
+
|
50
|
+
SMART_RDI::DIG_CAP & prdi = rdi.digCap(testSuiteName)
|
51
|
+
.label(label)
|
52
|
+
.pin(_pin)
|
53
|
+
.bitPerWord(1)
|
54
|
+
.samples(_samples);
|
55
|
+
|
56
|
+
filterRDI(prdi);
|
57
|
+
prdi.execute();
|
58
|
+
|
59
|
+
RDI_END();
|
60
|
+
|
61
|
+
FOR_EACH_SITE_BEGIN();
|
62
|
+
site = CURRENT_SITE_NUMBER();
|
63
|
+
funcResults[site] = rdi.getBurstPassFail();
|
64
|
+
FOR_EACH_SITE_END();
|
65
|
+
|
66
|
+
ON_FIRST_INVOCATION_END();
|
67
|
+
|
68
|
+
callPostTestFunc(this);
|
69
|
+
}
|
70
|
+
|
71
|
+
void FrequencyMeasurement::serialProcessing(int site) {
|
72
|
+
if (_processResults) {
|
73
|
+
double result;
|
74
|
+
ARRAY_I captureData = rdi.site(site).id(testSuiteName).getVector();
|
75
|
+
|
76
|
+
if (_periodBased) {
|
77
|
+
result = calculatePeriod(captureData, _periodInNs);
|
78
|
+
} else {
|
79
|
+
result = calculateFrequency(captureData, _periodInNs);
|
80
|
+
}
|
81
|
+
logFunctionalTest(testSuiteName, site, funcResults[site] == 1, label);
|
82
|
+
TESTSET().judgeAndLog_FunctionalTest(funcResults[site] == 1);
|
83
|
+
|
84
|
+
logParametricTest(testSuiteName, site, filterResult(result), limits(), _pin);
|
85
|
+
TESTSET().judgeAndLog_ParametricTest(_pin, testSuiteName, limits(), filterResult(result));
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
void FrequencyMeasurement::SMC_backgroundProcessing() {
|
90
|
+
double result;
|
91
|
+
|
92
|
+
for (int i = 0; i < activeSites.size(); i++) {
|
93
|
+
int site = activeSites[i];
|
94
|
+
processFunc(site);
|
95
|
+
if (_processResults) {
|
96
|
+
ARRAY_I captureData = rdi.site(site).id(testSuiteName).getVector();
|
97
|
+
if (_periodBased) {
|
98
|
+
result = calculatePeriod(captureData, _periodInNs);
|
99
|
+
} else {
|
100
|
+
result = calculateFrequency(captureData, _periodInNs);
|
101
|
+
}
|
102
|
+
SMC_TEST(site, "", testSuiteName, LIMIT(TM::GE, 1, TM::LE, 1), funcResults[site]);
|
103
|
+
SMC_TEST(site, _pin, testSuiteName, limits(), filterResult(result));
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
}
|
109
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#ifndef ORIGEN_TEST_METHOD_FREQUENCY_MEASUREMENT_INCLUDED
|
2
|
+
#define ORIGEN_TEST_METHOD_FREQUENCY_MEASUREMENT_INCLUDED
|
3
|
+
|
4
|
+
#include "base.hpp"
|
5
|
+
#include "mapi.hpp"
|
6
|
+
#include "rdi.hpp"
|
7
|
+
|
8
|
+
using namespace std;
|
9
|
+
|
10
|
+
namespace Origen {
|
11
|
+
namespace TestMethod {
|
12
|
+
|
13
|
+
class FrequencyMeasurement: public Base {
|
14
|
+
void serialProcessing(int site);
|
15
|
+
|
16
|
+
int _periodBased;
|
17
|
+
string _pin;
|
18
|
+
int _samples;
|
19
|
+
int _periodInNs;
|
20
|
+
int _processResults;
|
21
|
+
|
22
|
+
public:
|
23
|
+
FrequencyMeasurement();
|
24
|
+
virtual ~FrequencyMeasurement();
|
25
|
+
void SMC_backgroundProcessing();
|
26
|
+
void execute();
|
27
|
+
|
28
|
+
FrequencyMeasurement & periodBased(int v);
|
29
|
+
FrequencyMeasurement & pin(string v);
|
30
|
+
FrequencyMeasurement & samples(int v);
|
31
|
+
FrequencyMeasurement & periodInNs(int v);
|
32
|
+
FrequencyMeasurement & processResults(int v);
|
33
|
+
|
34
|
+
protected:
|
35
|
+
FrequencyMeasurement & getThis();
|
36
|
+
|
37
|
+
// Internal variables, declared outside the the execute function body since
|
38
|
+
// they may be useful in callback functions
|
39
|
+
ARRAY_I activeSites;
|
40
|
+
string testSuiteName;
|
41
|
+
string label;
|
42
|
+
vector<int> funcResults;
|
43
|
+
|
44
|
+
};
|
45
|
+
|
46
|
+
}
|
47
|
+
}
|
48
|
+
#endif
|
@@ -0,0 +1,119 @@
|
|
1
|
+
#include "functional_test.hpp"
|
2
|
+
|
3
|
+
using namespace std;
|
4
|
+
|
5
|
+
namespace Origen {
|
6
|
+
namespace TestMethod {
|
7
|
+
|
8
|
+
|
9
|
+
FunctionalTest::FunctionalTest() {
|
10
|
+
pin("");
|
11
|
+
capture(0);
|
12
|
+
processResults(1);
|
13
|
+
bitPerWord(1);
|
14
|
+
}
|
15
|
+
|
16
|
+
FunctionalTest::~FunctionalTest() { }
|
17
|
+
|
18
|
+
/// The functional test method can optionally capture data by supplying the number of vectors to capture
|
19
|
+
FunctionalTest & FunctionalTest::capture(int v) { _capture = v; return *this; }
|
20
|
+
/// If data capture is requested, supply the pin to capture data from
|
21
|
+
FunctionalTest & FunctionalTest::pin(string v) { _pin = v; return *this; }
|
22
|
+
/// Serial capture data will be grouped into words, specify how many bits per word in the serial stream (default 1)
|
23
|
+
FunctionalTest & FunctionalTest::bitPerWord(int v) { _bitPerWord = v; return *this; }
|
24
|
+
/// When set to 0 the results of the test will not be judged or logged
|
25
|
+
FunctionalTest & FunctionalTest::processResults(int v) { _processResults = v; return *this; }
|
26
|
+
|
27
|
+
// All test methods must implement this function
|
28
|
+
FunctionalTest & FunctionalTest::getThis() { return *this; }
|
29
|
+
|
30
|
+
void FunctionalTest::execute() {
|
31
|
+
|
32
|
+
int site, physicalSites;
|
33
|
+
ARRAY_I sites;
|
34
|
+
|
35
|
+
RDI_INIT();
|
36
|
+
ON_FIRST_INVOCATION_BEGIN();
|
37
|
+
|
38
|
+
enableHiddenUpload();
|
39
|
+
GET_ACTIVE_SITES(activeSites);
|
40
|
+
physicalSites = GET_CONFIGURED_SITES(sites);
|
41
|
+
results.resize(physicalSites + 1);
|
42
|
+
GET_TESTSUITE_NAME(testSuiteName);
|
43
|
+
// testSuiteName = testSuiteName + toStr(CURRENT_SITE_NUMBER());
|
44
|
+
// cout << testSuiteName << endl;
|
45
|
+
label = Primary.getLabel();
|
46
|
+
|
47
|
+
if (_capture) {
|
48
|
+
pinName = extractPinsFromGroup(_pin);
|
49
|
+
}
|
50
|
+
|
51
|
+
callPreTestFunc();
|
52
|
+
|
53
|
+
RDI_BEGIN();
|
54
|
+
|
55
|
+
if (_capture) {
|
56
|
+
SMART_RDI::DIG_CAP & prdi = rdi.digCap(testSuiteName)
|
57
|
+
.label(label)
|
58
|
+
.pin(pinName)
|
59
|
+
.bitPerWord(_bitPerWord)
|
60
|
+
.samples(_capture);
|
61
|
+
filterRDI(prdi);
|
62
|
+
prdi.execute();
|
63
|
+
|
64
|
+
} else {
|
65
|
+
SMART_RDI::FUNC & prdi = rdi.func(testSuiteName).label(label);
|
66
|
+
// SMART_RDI::FUNC & prdi = rdi.func(testSuiteName).burst(label);
|
67
|
+
filterRDI(prdi);
|
68
|
+
prdi.execute();
|
69
|
+
}
|
70
|
+
|
71
|
+
RDI_END();
|
72
|
+
|
73
|
+
FOR_EACH_SITE_BEGIN();
|
74
|
+
site = CURRENT_SITE_NUMBER();
|
75
|
+
if (_capture) {
|
76
|
+
results[site] = rdi.site(site).getBurstPassFail();
|
77
|
+
// cout << "PRE " << site << ": " << results[site] << endl;
|
78
|
+
|
79
|
+
} else {
|
80
|
+
results[site] = rdi.site(site).id(testSuiteName).getPassFail();
|
81
|
+
// cout << "PRE " << site << ": " << results[site] << endl;
|
82
|
+
}
|
83
|
+
FOR_EACH_SITE_END();
|
84
|
+
|
85
|
+
ON_FIRST_INVOCATION_END();
|
86
|
+
|
87
|
+
callPostTestFunc(this);
|
88
|
+
}
|
89
|
+
|
90
|
+
/// Returns the captured data for the site currently in focus
|
91
|
+
ARRAY_I FunctionalTest::capturedData() {
|
92
|
+
return rdi.id(testSuiteName).getVector(pinName);
|
93
|
+
}
|
94
|
+
|
95
|
+
/// Returns the captured data for the given site number
|
96
|
+
ARRAY_I FunctionalTest::capturedData(int site) {
|
97
|
+
return rdi.site(site).id(testSuiteName).getVector(pinName);
|
98
|
+
}
|
99
|
+
|
100
|
+
void FunctionalTest::serialProcessing(int site) {
|
101
|
+
if (_processResults) {
|
102
|
+
// cout << "POST " << site << ": " << results[site] << endl;
|
103
|
+
logFunctionalTest(testSuiteName, site, results[site] == 1, label);
|
104
|
+
TESTSET().judgeAndLog_FunctionalTest(results[site] == 1);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
void FunctionalTest::SMC_backgroundProcessing() {
|
109
|
+
for (int i = 0; i < activeSites.size(); i++) {
|
110
|
+
int site = activeSites[i];
|
111
|
+
processFunc(site);
|
112
|
+
if (_processResults) {
|
113
|
+
SMC_TEST(site, "", testSuiteName, LIMIT(TM::GE, 1, TM::LE, 1), results[activeSites[i]]);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
}
|
119
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#ifndef ORIGEN_TEST_METHOD_FUNCTIONAL_TEST_INCLUDED
|
2
|
+
#define ORIGEN_TEST_METHOD_FUNCTIONAL_TEST_INCLUDED
|
3
|
+
|
4
|
+
#include "base.hpp"
|
5
|
+
#include "mapi.hpp"
|
6
|
+
#include "rdi.hpp"
|
7
|
+
|
8
|
+
using namespace std;
|
9
|
+
|
10
|
+
namespace Origen {
|
11
|
+
namespace TestMethod {
|
12
|
+
|
13
|
+
class FunctionalTest: public Base {
|
14
|
+
void serialProcessing(int site);
|
15
|
+
|
16
|
+
string _pin;
|
17
|
+
int _capture;
|
18
|
+
int _bitPerWord;
|
19
|
+
int _processResults;
|
20
|
+
|
21
|
+
public:
|
22
|
+
FunctionalTest();
|
23
|
+
|
24
|
+
virtual ~FunctionalTest();
|
25
|
+
void SMC_backgroundProcessing();
|
26
|
+
void execute();
|
27
|
+
|
28
|
+
FunctionalTest & capture(int v);
|
29
|
+
FunctionalTest & pin(string v);
|
30
|
+
FunctionalTest & bitPerWord(int v);
|
31
|
+
FunctionalTest & processResults(int v);
|
32
|
+
|
33
|
+
|
34
|
+
protected:
|
35
|
+
FunctionalTest & getThis();
|
36
|
+
ARRAY_I capturedData();
|
37
|
+
ARRAY_I capturedData(int);
|
38
|
+
|
39
|
+
// Internal variables, declared outside the the execute function body since
|
40
|
+
// they may be useful in callback functions
|
41
|
+
ARRAY_I activeSites;
|
42
|
+
string testSuiteName;
|
43
|
+
string label;
|
44
|
+
vector<int> results;
|
45
|
+
string pinName;
|
46
|
+
};
|
47
|
+
|
48
|
+
|
49
|
+
}
|
50
|
+
}
|
51
|
+
#endif
|
@@ -0,0 +1,79 @@
|
|
1
|
+
#include "version.hpp"
|
2
|
+
using namespace std;
|
3
|
+
|
4
|
+
#include <sstream>
|
5
|
+
|
6
|
+
namespace Origen {
|
7
|
+
namespace Utils {
|
8
|
+
|
9
|
+
Version::Version(string ver) {
|
10
|
+
vector<int> v = parse(ver);
|
11
|
+
_major = v[0];
|
12
|
+
_minor = v[1];
|
13
|
+
_tiny = v[2];
|
14
|
+
}
|
15
|
+
|
16
|
+
int Version::major() {
|
17
|
+
return _major;
|
18
|
+
}
|
19
|
+
int Version::minor() {
|
20
|
+
return _minor;
|
21
|
+
}
|
22
|
+
int Version::tiny() {
|
23
|
+
return _tiny;
|
24
|
+
}
|
25
|
+
|
26
|
+
string Version::str() {
|
27
|
+
ostringstream str;
|
28
|
+
str << _major;
|
29
|
+
str << ".";
|
30
|
+
str << _minor;
|
31
|
+
str << ".";
|
32
|
+
str << _tiny;
|
33
|
+
return str.str();
|
34
|
+
}
|
35
|
+
|
36
|
+
bool Version::operator==(string rhs) {
|
37
|
+
vector<int> v = parse(rhs);
|
38
|
+
return _major == v[0] && _minor == v[1] && _tiny == v[2];
|
39
|
+
}
|
40
|
+
|
41
|
+
bool Version::operator!=(string rhs) {
|
42
|
+
vector<int> v = parse(rhs);
|
43
|
+
return _major != v[0] || _minor != v[1] || _tiny != v[2];
|
44
|
+
}
|
45
|
+
|
46
|
+
bool Version::operator<(string rhs) {
|
47
|
+
vector<int> v = parse(rhs);
|
48
|
+
return _major < v[0] || (_major == v[0] && _minor < v[1])
|
49
|
+
|| (_major == v[0] && _minor == v[1] && _tiny < v[2]);
|
50
|
+
}
|
51
|
+
|
52
|
+
bool Version::operator<=(string rhs) {
|
53
|
+
return operator==(rhs) || operator<(rhs);
|
54
|
+
}
|
55
|
+
|
56
|
+
bool Version::operator>(string rhs) {
|
57
|
+
vector<int> v = parse(rhs);
|
58
|
+
return _major > v[0] || (_major == v[0] && _minor > v[1])
|
59
|
+
|| (_major == v[0] && _minor == v[1] && _tiny > v[2]);
|
60
|
+
}
|
61
|
+
|
62
|
+
bool Version::operator>=(string rhs) {
|
63
|
+
return operator==(rhs) || operator>(rhs);
|
64
|
+
}
|
65
|
+
|
66
|
+
vector<int> Version::parse(string ver) {
|
67
|
+
vector<int> v(3);
|
68
|
+
|
69
|
+
istringstream parser(ver);
|
70
|
+
parser >> v[0];
|
71
|
+
for (int i = 1; i < 3; i++) {
|
72
|
+
parser.get(); //Skip dot
|
73
|
+
parser >> v[i];
|
74
|
+
}
|
75
|
+
return v;
|
76
|
+
}
|
77
|
+
|
78
|
+
}
|
79
|
+
}
|