40 myParentDemandElement(demandElementParent),
41 myChildDemandElement(demandElementChild),
42 myOperation(operation),
43 myOriginalChildElements(demandElementParent->getChildDemandElements()),
44 myEditedChildElements(demandElementParent->getChildDemandElements()) {
45 myParentDemandElement->incRef(
"GNEChange_Children");
47 auto it = std::find(myEditedChildElements.begin(), myEditedChildElements.end(), myChildDemandElement);
49 if (it != myEditedChildElements.end()) {
50 if ((operation == Operation::MOVE_FRONT) && (it != (myEditedChildElements.end() - 1))) {
52 it = myEditedChildElements.erase(it);
54 myEditedChildElements.insert(it + 1, myChildDemandElement);
55 }
else if ((operation == Operation::MOVE_BACK) && (it != myEditedChildElements.begin())) {
57 it = myEditedChildElements.erase(it);
59 myEditedChildElements.insert(it - 1, myChildDemandElement);