Project

General

Profile

Bug #2664 » 2664-print-Name-dtor.patch

Junxiao Shi, 03/23/2015 09:39 AM

View differences:

src/name.cpp
const size_t Name::npos = std::numeric_limits<size_t>::max();
static std::set<const Name*>&
getAllNameSet()
{
static std::set<const Name*> s;
return s;
}
Name::Name()
: m_nameBlock(tlv::Name)
{
getAllNameSet().insert(this);
}
Name::Name(const Block& wire)
{
getAllNameSet().insert(this);
m_nameBlock = wire;
m_nameBlock.parse();
}
Name::Name(const char* uri)
{
getAllNameSet().insert(this);
construct(uri);
}
Name::Name(const std::string& uri)
{
getAllNameSet().insert(this);
construct(uri.c_str());
}
Name::Name(const Name& other)
{
getAllNameSet().insert(this);
*this = other;
}
Name::~Name()
{
auto it = getAllNameSet().find(this);
BOOST_ASSERT(it != getAllNameSet().end());
std::cout << "Name::~Name(" << this << " " << *this << ")" << std::endl;
getAllNameSet().erase(it);
}
template<encoding::Tag TAG>
size_t
Name::wireEncode(EncodingImpl<TAG>& encoder) const
src/name.hpp
*/
Name(const std::string& uri);
Name(const Name& other);
Name&
operator=(const Name& other) = default;
~Name();
/**
* @brief Fast encoding or block size estimation
*/
(1-1/2)