Fix crash when printing type of recursive structures.

Also slightly fix indentation in Type.h
This commit is contained in:
Johanna Amann 2016-02-03 13:22:05 -08:00
parent 13c4489578
commit c5a14d1bc1
6 changed files with 50 additions and 6 deletions

View file

@ -351,3 +351,24 @@ void ODesc::Clear()
}
}
bool ODesc::PushType(const BroType* type)
{
auto res = encountered_types.insert(type);
return std::get<1>(res);
}
bool ODesc::PopType(const BroType* type)
{
size_t res = encountered_types.erase(type);
return (res == 1);
}
bool ODesc::FindType(const BroType* type)
{
auto res = encountered_types.find(type);
if ( res != encountered_types.end() )
return true;
return false;
}