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
update changelog
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
77e5fba7fd
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
improved version.h
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
345a799031
muellerr added 1 commit 2022-03-09 19:10:34 +01:00
getter not required anymore
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
ca508bfe61
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
added tests
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
7daa9812ff
muellerr added 1 commit 2022-03-10 09:36:46 +01:00
update changelog
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
949549178a
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
added some more minor tests
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
3779b44813
muellerr added 1 commit 2022-03-10 09:40:43 +01:00
minor tweaks
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
6b1a81ee92
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
this tests even a bit more
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
14ac852b7e
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
avoid namespace pollution
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
e684680d60
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
Merge remote-tracking branch 'upstream/development' into mueller/version-getter-upstream
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
97c93afeff
muellerr added 1 commit 2022-03-14 14:37:45 +01:00
bugfix
Some checks failed
fsfw/fsfw/pipeline/pr-development There was a failure building this commit
ce5bcc5897
muellerr added 1 commit 2022-03-14 14:38:27 +01:00
Merge remote-tracking branch 'upstream/development' into mueller/version-getter-upstream
All checks were successful
fsfw/fsfw/pipeline/pr-development This commit looks good
522cbc7f3d
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.