Skip to content

Commit

Permalink
Merge branch 'cherry-pick-ea31b7b4' into 'master'
Browse files Browse the repository at this point in the history
[Fix] Cherry pick MR 'hotfix/github/PIRA#7' into 'devel'

See merge request tuda-sc/projects/metacg!131
  • Loading branch information
jplehr committed Dec 21, 2023
2 parents 5c557fa + e99ffb5 commit 2cf688a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions graph/include/MCGBaseInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@
namespace metacg {

struct MCGFileFormatVersion {
MCGFileFormatVersion(int major, int minor) : major(major), minor(minor) {}
MCGFileFormatVersion(int versionMajor, int versionMinor) : versionMajor(versionMajor), versionMinor(versionMinor) {}
MCGFileFormatVersion(const MCGFileFormatVersion &other) = default;
MCGFileFormatVersion(MCGFileFormatVersion &&other) = default;
bool operator==(const MCGFileFormatVersion &rhs) const { return major == rhs.major && minor == rhs.minor; }
bool operator==(const MCGFileFormatVersion &rhs) const { return versionMajor == rhs.versionMajor && versionMinor == rhs.versionMinor; }
bool operator!=(const MCGFileFormatVersion &rhs) const { return !(rhs == *this); }
bool operator<(const MCGFileFormatVersion &rhs) const {
return major < rhs.major || (major == rhs.major && minor < rhs.minor);
return versionMajor < rhs.versionMajor || (versionMajor == rhs.versionMajor && versionMinor < rhs.versionMinor);
}
bool operator>(const MCGFileFormatVersion &rhs) const { return !this->operator<(rhs); }

[[nodiscard]] std::string getVersionStr() const { return std::to_string(major) + '.' + std::to_string(minor); }
[[nodiscard]] std::string getVersionStr() const { return std::to_string(versionMajor) + '.' + std::to_string(versionMinor); }

[[nodiscard]] std::string getJsonIdentifier() const { return {"version"}; }

int major;
int minor;
int versionMajor;
int versionMinor;
};

struct MCGGeneratorVersionInfo {
MCGGeneratorVersionInfo(std::string &name, int major, int minor, std::string gitSHA = {})
: name(name), major(major), minor(minor), sha(std::move(gitSHA)) {}
MCGGeneratorVersionInfo(std::string &name, int versionMajor, int versionMinor, std::string gitSHA = {})
: name(name), versionMajor(versionMajor), versionMinor(versionMinor), sha(std::move(gitSHA)) {}
MCGGeneratorVersionInfo(const MCGGeneratorVersionInfo &other) = default;
MCGGeneratorVersionInfo(MCGGeneratorVersionInfo &&other) = default;

[[nodiscard]] std::string getVersionStr() const { return std::to_string(major) + '.' + std::to_string(minor); }
[[nodiscard]] std::string getVersionStr() const { return std::to_string(versionMajor) + '.' + std::to_string(versionMinor); }

[[nodiscard]] std::string getJsonIdentifier() const { return {"generator"}; }

Expand All @@ -47,13 +47,13 @@ struct MCGGeneratorVersionInfo {
[[nodiscard]] std::string getJsonShaIdentifier() const { return {"sha"}; }

std::string name;
int major;
int minor;
int versionMajor;
int versionMinor;
std::string sha;
};

struct MCGFileFormatInfo {
MCGFileFormatInfo(int major, int minor) : version(major, minor), cgFieldName("_CG"), metaInfoFieldName("_MetaCG") {}
MCGFileFormatInfo(int versionMajor, int versionMinor) : version(versionMajor, versionMinor), cgFieldName("_CG"), metaInfoFieldName("_MetaCG") {}
MCGFileFormatInfo(const MCGFileFormatInfo &other) = default;
MCGFileFormatInfo(MCGFileFormatInfo &&other) = default;

Expand Down

0 comments on commit 2cf688a

Please sign in to comment.