Project

General

Profile

Bug #3618 » block_cpp.diff

Anil Jangam, 05/13/2016 02:08 AM

View differences:

src/encoding/block.cpp
m_type = std::numeric_limits<uint32_t>::max();
m_begin = m_end = m_value_begin = m_value_end = Buffer::const_iterator();
std::cout << this << " RESET Size of Sub block container: " << m_subBlocks.size() << std::endl;
}
void
......
element_begin, element_end,
begin, element_end));
std::cout << this << " PUSH_BACK1 Size of Sub block container: " << m_subBlocks.size() << std::endl;
begin = element_end;
// don't do recursive parsing, just the top level
}
......
auto it = std::remove_if(m_subBlocks.begin(), m_subBlocks.end(),
[type] (const Block& subBlock) { return subBlock.type() == type; });
m_subBlocks.resize(it - m_subBlocks.begin());
std::cout << this << " REMOVE Size of Sub block container: " << m_subBlocks.size() << std::endl;
}
Block
......
resetWire();
#ifdef NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR
return m_subBlocks.erase(position);
element_iterator i1 = m_subBlocks.erase(it);
std::cout << this << " ERASE Size of Sub block container: " << m_subBlocks.size() << std::endl;
return i1;
#else
element_iterator it = m_subBlocks.begin();
std::advance(it, std::distance(m_subBlocks.cbegin(), position));
return m_subBlocks.erase(it);
element_iterator i2 = m_subBlocks.erase(it);
std::cout << this << " ERASE Size of Sub block container: " << m_subBlocks.size() << std::endl;
return i2;
#endif
}
......
element_iterator itEnd = m_subBlocks.begin();
std::advance(itStart, std::distance(m_subBlocks.cbegin(), first));
std::advance(itEnd, std::distance(m_subBlocks.cbegin(), last));
return m_subBlocks.erase(itStart, itEnd);
element_iterator i = m_subBlocks.erase(itStart, itEnd);
std::cout << this << " ERASE Size of Sub block container: " << m_subBlocks.size() << std::endl;
return i;
#endif
}
......
{
resetWire();
m_subBlocks.push_back(element);
std::cout << this << " PUSH_BACK2 Size of Sub block container: " << m_subBlocks.size() << std::endl;
}
Block::element_iterator
......
resetWire();
#ifdef NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR
return m_subBlocks.insert(pos, element);
element_iterator i1 = m_subBlocks.insert(pos, element);
std::cout << this << " INSERT Size of Sub block container: " << m_subBlocks.size() << std::endl;
return i1;
#else
element_iterator it = m_subBlocks.begin();
std::advance(it, std::distance(m_subBlocks.cbegin(), pos));
return m_subBlocks.insert(it, element);
element_iterator i2 = m_subBlocks.insert(it, element);
std::cout << this << " INSERT Size of Sub block container: " << m_subBlocks.size() << std::endl;
return i2;
#endif
}
(4-4/9)