-
Notifications
You must be signed in to change notification settings - Fork 30
Modeler 6.5: valid location [ANT-4045] #3258
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
Conversation
| } | ||
| } | ||
|
|
||
| void checkModel(Model& model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
| } | ||
| } | ||
|
|
||
| void checkLocations(Modeler::Data& data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
| const std::vector<const Node*> ParentNode::getConstOperands() const | ||
| { | ||
| std::vector<const Node*> constOperands; | ||
| for (const auto* operand: operands_) | ||
| { | ||
| constOperands.push_back(operand); | ||
| } | ||
| return constOperands; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Naming You can have 2 member functions with the same name but different constness. The compiler will get the correct one without any problem
- Style You can construct a
std::vectorfrom two iterators
| const std::vector<const Node*> ParentNode::getConstOperands() const | |
| { | |
| std::vector<const Node*> constOperands; | |
| for (const auto* operand: operands_) | |
| { | |
| constOperands.push_back(operand); | |
| } | |
| return constOperands; | |
| } | |
| const std::vector<const Node*> ParentNode::getOperands() const | |
| { | |
| std::vector<const Node*> constOperands(operands_.begin(), operands_.end()); | |
| return constOperands; | |
| } | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Style For a function
f,ReturnType f()andconst ReturnType f()are equivalent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions that differ only in their return type cannot be overloaded
ParentNode.h:74:31: note: previous declaration is here [ovl_diff_return_type]
| // Convert the tree to a string, used for error messages | ||
| Expressions::Visitors::PrintVisitor printVisitor; | ||
| std::string nodeExpression = printVisitor.dispatch(n); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print the whole expression, don't bother
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our expression object contains the node, in this instance we only have the node.
I created a function expressionAtPortField to avoid using the printVisitor
src/modeler/checks/include/antares/solver/modeler/checks/checkLocation.h
Show resolved
Hide resolved
| const std::vector<const Node*> ParentNode::getConstOperands() const | ||
| { | ||
| std::vector<const Node*> constOperands; | ||
| for (const auto* operand: operands_) | ||
| { | ||
| constOperands.push_back(operand); | ||
| } | ||
| return constOperands; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Style For a function
f,ReturnType f()andconst ReturnType f()are equivalent
…mulatorTeam/Antares_Simulator into feature/valid-location
|



No description provided.