diff --git a/src/encoding/block.cpp b/src/encoding/block.cpp index 7306276..d15b7af 100644 --- a/src/encoding/block.cpp +++ b/src/encoding/block.cpp @@ -306,6 +306,7 @@ Block::reset() m_type = std::numeric_limits::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 @@ -346,6 +347,8 @@ Block::parse() const 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 } @@ -431,6 +434,7 @@ Block::remove(uint32_t type) 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 @@ -540,11 +544,16 @@ Block::erase(Block::element_const_iterator position) 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 } @@ -560,7 +569,10 @@ Block::erase(Block::element_const_iterator first, Block::element_const_iterator 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 } @@ -569,6 +581,7 @@ Block::push_back(const Block& element) { resetWire(); m_subBlocks.push_back(element); + std::cout << this << " PUSH_BACK2 Size of Sub block container: " << m_subBlocks.size() << std::endl; } Block::element_iterator @@ -577,11 +590,15 @@ Block::insert(Block::element_const_iterator pos, const Block& element) 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 }