Version Getter Function #575

Merged
gaisser merged 14 commits from eive/fsfw:mueller/version-getter-upstream into development 2022-03-14 14:44:38 +01:00
Owner
No description provided.
muellerr added 2 commits 2022-03-08 10:09:39 +01:00
fsfw/fsfw/pipeline/pr-development This commit looks good Details
77e5fba7fd
update changelog
muellerr requested review from gaisser 2022-03-08 10:10:55 +01:00
muellerr added the
feature
label 2022-03-08 10:11:00 +01:00
muellerr added this to the v5.0.0 milestone 2022-03-08 10:40:27 +01:00
gaisser reviewed 2022-03-09 12:55:26 +01:00
@ -0,0 +8,4 @@
struct Version {
uint32_t major = 0;
uint32_t minor = 0;
uint32_t revision = 0;
Owner

Can you changed that to the next milestone 5.0.0?

Can you changed that to the next milestone 5.0.0?
Author
Owner

AH, you want the struct default value to be the current version? Then it might sense to initialize these values to the preprocessor define values right aways.. which would make the geztter function kind of obsolete..

AH, you want the struct default value to be the current version? Then it might sense to initialize these values to the preprocessor define values right aways.. which would make the geztter function kind of obsolete..
Owner

Good point :)

Still I am with Steffen on this one. How about making the Version members even static const. I think the basic task was to make the Version accessible in a native C way, which fsfw::Version:major in my view is.

Instead of a getter, I would propose to add operators > == < <= >= for Version, to allow doing something with the information, like

if (fsfw::Version >= fsfw::VersionUser(4,3,0))

NB My example would need a non static const Variant of the class, maybe someone finds a more clever version.

Good point :) Still I am with Steffen on this one. How about making the `Version` members even `static const`. I think the basic task was to make the Version accessible in a native C way, which `fsfw::Version:major` in my view is. Instead of a getter, I would propose to add operators `>` `==` `<` `<=` `>=` for Version, to allow doing something with the information, like ``` if (fsfw::Version >= fsfw::VersionUser(4,3,0)) ``` NB My example would need a non static const Variant of the class, maybe someone finds a more clever version.
mohr marked this conversation as resolved
Author
Owner

Implemented extended Version class and const FSFW_VERSION class.

WIP, TODO:

  • Still need to unit test this. Also, it might be not the most efficient implementation (maybe at least the least simple one for the operators?) but that should not be too concerning for this use-case
  • Other feature: Implement << operator to print <Major>.<Minor>.<Revision>.
  • Update CHANGELOG
Implemented extended `Version` class and const `FSFW_VERSION` class. WIP, TODO: - Still need to unit test this. Also, it might be not the most efficient implementation (maybe at least the least simple one for the operators?) but that should not be too concerning for this use-case - Other feature: Implement `<<` operator to print `<Major>.<Minor>.<Revision>.` - Update CHANGELOG
muellerr changed title from Version Getter Function to WIP: Version Getter Function 2022-03-09 19:07:38 +01:00
muellerr added 1 commit 2022-03-09 19:08:18 +01:00
fsfw/fsfw/pipeline/pr-development This commit looks good Details
345a799031
improved version.h
muellerr added 1 commit 2022-03-09 19:10:34 +01:00
fsfw/fsfw/pipeline/pr-development This commit looks good Details
ca508bfe61
getter not required anymore
mohr reviewed 2022-03-09 20:18:12 +01:00
@ -0,0 +28,4 @@
friend bool operator<=(const Version& v1, const Version& v2) { return ((v1 == v2) or (v1 < v2)); }
friend bool operator>=(const Version& v1, const Version& v2) { return ((v1 == v2) or (v1 > v2)); }
};
Owner

If I am not mistaken, >= equals not < and > equals not(==) and not(<)

If I am not mistaken, `>=` equals `not <` and `>` equals `not(==) and not(<)`
Owner

Also, +1 for the << operator

Also, +1 for the `<<` operator
Author
Owner

Done. Added C-style getVersion as well.

Done. Added C-style `getVersion` as well.
muellerr changed title from WIP: Version Getter Function to Version Getter Function 2022-03-10 09:35:33 +01:00
muellerr added 1 commit 2022-03-10 09:35:41 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
7daa9812ff
added tests
muellerr added 1 commit 2022-03-10 09:36:46 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
949549178a
update changelog
muellerr changed title from Version Getter Function to WIP: Version Getter Function 2022-03-10 09:38:21 +01:00
muellerr added 1 commit 2022-03-10 09:38:47 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
3779b44813
added some more minor tests
muellerr added 1 commit 2022-03-10 09:40:43 +01:00
fsfw/fsfw/pipeline/pr-development This commit looks good Details
6b1a81ee92
minor tweaks
muellerr changed title from WIP: Version Getter Function to Version Getter Function 2022-03-10 09:40:49 +01:00
muellerr added 1 commit 2022-03-10 09:44:14 +01:00
fsfw/fsfw/pipeline/pr-development This commit looks good Details
14ac852b7e
this tests even a bit more
muellerr changed title from Version Getter Function to WIP: Version Getter Function 2022-03-10 09:57:22 +01:00
muellerr added 2 commits 2022-03-10 09:58:49 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
e684680d60
avoid namespace pollution
muellerr changed title from WIP: Version Getter Function to Version Getter Function 2022-03-10 10:00:32 +01:00
muellerr added 1 commit 2022-03-14 14:24:46 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
97c93afeff
Merge remote-tracking branch 'upstream/development' into mueller/version-getter-upstream
muellerr added 1 commit 2022-03-14 14:37:45 +01:00
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details
ce5bcc5897
bugfix
muellerr added 1 commit 2022-03-14 14:38:27 +01:00
gaisser merged commit 288d453978 into development 2022-03-14 14:44:38 +01:00
gaisser deleted branch mueller/version-getter-upstream 2022-03-14 14:44:40 +01:00
gaisser approved these changes 2022-03-14 14:48:37 +01:00
gaisser left a comment
Owner

LGTM

LGTM
Sign in to join this conversation.
No description provided.