dlr-gtlab / gtlab-core

GTlab Core Framework
https://www.gtlab.de
Other
7 stars 2 forks source link

💡 [REQUEST] - Improve comparison of mode and modetype property #1203

Closed jensschmeink closed 2 weeks ago

jensschmeink commented 4 months ago

Summary

Report from Gitlab-Bug-Tracking:

Not sure if this is possible, but I would like to directly compare a GtModeProperty to a GtModeTypeProperty in order to find out whether this GtModeTypeProperty is selected:
if (m_mode == m_modetype)
currently, I have to use their getVal() function for this:
`if (m_mode.getVal() == m_modetype.getVal())
This makes the code quite lengthy.

Improvements

Implement some kind of comparison operator to simplify usage

Drawbacks

Cannot see drawbacks

Current workarounds

Currently it is sufficient to use the .get on one side like in
if (m_mode.get() == m_modetype) but that is still not comfortable and intuitive.

jensschmeink commented 4 months ago

Idea: add function in modepropety like "bool isSelected(GtModeTypeProperty const& type)"