42 m_log = &bitpit::log::cout(MIMMO_LOG_FILE);
59 std::swap(m_id,x.m_id);
60 std::swap(m_objects,x.m_objects);
61 std::swap(m_idObjects,x.m_idObjects);
62 std::swap(m_objcounter,x.m_objcounter);
63 std::swap(m_plotDebRes,x.m_plotDebRes);
64 std::swap(m_outputDebRes,x.m_outputDebRes);
73 std::unique_ptr<Chain> res(
new Chain());
153 if (
m_objects[idx]->getParent() !=
nullptr ||
m_objects[idx]->getNChild() != 0) cut =
true;
181 std::vector<BaseManipulation*>::iterator itchild =
m_objects.end();
182 std::vector<BaseManipulation*>::iterator itparent;
189 idxchild = std::min(idxchild,
int(std::distance(
m_objects.begin(), itchild)));
198 idxparent[i] = std::distance(
m_objects.begin(), itparent);
204 if (idxparent[i] == idxchild)
return -1;
207 bool parentsMinor =
true;
209 if (idxparent[i] > idxchild){
210 parentsMinor =
false;
215 std::vector<BaseManipulation*> parent(obj->
getNParent());
217 if (idxparent[i] > idxchild){
220 int idxtemp = std::distance(
m_objects.begin(), itparent);
228 if (idxparent[i] > idxchild){
286 std::vector<BaseManipulation*>::iterator it, itb =
m_objects.begin();
287 std::vector<BaseManipulation*>::iterator itend =
m_objects.end();
288 bitpit::log::Priority oldPriority =
m_log->getPriority();
290 m_log->setPriority(bitpit::log::NORMAL);
291 (*m_log) <<
" " << std::endl;
292 (*m_log) <<
"--------------------------------------------------" << std::endl;
293 (*m_log) <<
" Execution of chain - "<<
m_objcounter <<
" objects" << std::endl;
295 (*m_log) <<
"--------------------------------------------------" << std::endl;
296 (*m_log) <<
" Plotting of Debug Results is active"<< std::endl;
297 (*m_log) <<
" Results will be stored in the directory: "<<
m_outputDebRes<< std::endl;
298 (*m_log) <<
"--------------------------------------------------" << std::endl;
300 (*m_log) <<
" " << std::endl;
303 for (it = itb; it != itend; ++it){
305 m_log->setPriority(bitpit::log::NORMAL);
306 (*m_log) <<
" execution object " << i <<
" : " << (*it)->getName() << std::endl;
316 (*m_log) <<
" " << std::endl;
317 (*m_log) <<
"--------------------------------------------------" << std::endl;
318 (*m_log) <<
" " << std::endl;
319 m_log->setPriority(oldPriority);
338 std::vector<BaseManipulation*>::iterator it, itb =
m_objects.begin();
339 std::vector<BaseManipulation*>::iterator itend =
m_objects.end();
341 for (it = itb; it != itend; ++it){
342 for (
int i=0; i<(*it)->getNChild(); i++){
344 if (idxchild <= actualidx){
345 (*m_log) <<
" error : loop in chain : "<< (*it)->getName() <<
" linked to " << (*it)->getChild(i)->getName() << std::endl;
346 (*m_log) <<
" " << std::endl;
347 throw std::runtime_error (
"loop in chain : " + (*it)->getName() +
" linked to " + (*it)->getChild(i)->getName());