Version Getter Function #575
Reference in New Issue
Block a user
Delete Branch "eive/fsfw:mueller/version-getter-upstream"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@@ -0,0 +8,4 @@struct Version {uint32_t major = 0;uint32_t minor = 0;uint32_t revision = 0;Can you changed that to the next milestone 5.0.0?
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..
Good point :)
Still I am with Steffen on this one. How about making the
Versionmembers evenstatic const. I think the basic task was to make the Version accessible in a native C way, whichfsfw::Version:majorin my view is.Instead of a getter, I would propose to add operators
>==<<=>=for Version, to allow doing something with the information, likeNB My example would need a non static const Variant of the class, maybe someone finds a more clever version.
Implemented extended
Versionclass and constFSFW_VERSIONclass.WIP, TODO:
<<operator to print<Major>.<Minor>.<Revision>.Version Getter Functionto WIP: Version Getter Function@@ -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)); }};If I am not mistaken,
>=equalsnot <and>equalsnot(==) and not(<)Also, +1 for the
<<operatorDone. Added C-style
getVersionas well.WIP: Version Getter Functionto Version Getter FunctionVersion Getter Functionto WIP: Version Getter FunctionWIP: Version Getter Functionto Version Getter FunctionVersion Getter Functionto WIP: Version Getter FunctionWIP: Version Getter Functionto Version Getter FunctionLGTM