Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize OSGridController #571

Open
jmarrec opened this issue Oct 18, 2022 · 0 comments
Open

Modernize OSGridController #571

jmarrec opened this issue Oct 18, 2022 · 0 comments
Labels

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Oct 18, 2022

Enhancement Request

void OSGridController::setConceptValue(model::ModelObject t_setterMO, model::ModelObject t_getterMO,
const QSharedPointer<BaseConcept>& t_baseConcept) {
if (QSharedPointer<CheckBoxConcept> osConcept = t_baseConcept.dynamicCast<CheckBoxConcept>()) {
auto setter = std::bind(&CheckBoxConcept::set, osConcept.data(), t_setterMO, std::placeholders::_1);
auto getter = std::bind(&CheckBoxConcept::get, osConcept.data(), t_getterMO);
auto temp = getter();
setter(temp);
} else if (QSharedPointer<CheckBoxConceptBoolReturn> osConcept = t_baseConcept.dynamicCast<CheckBoxConceptBoolReturn>()) {
auto setter = std::bind(&CheckBoxConceptBoolReturn::set, osConcept.data(), t_setterMO, std::placeholders::_1);
auto getter = std::bind(&CheckBoxConceptBoolReturn::get, osConcept.data(), t_getterMO);
auto temp = getter();
setter(temp);

Detailed Description

Possible Implementation

Use lambdas instead of std::bind.

does t_setterMO / t_getterMO require a pass by value instead of a reference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant