Add Val::AsFuncPtr() convenience method

Since it's not trivial to store IntrusivePtr in BroValUnion and also
not satisfying to store IntrusivePtr*.
This commit is contained in:
Jon Siwek 2020-05-21 00:50:48 -07:00
parent 5af962e11f
commit 3b6f60a810
4 changed files with 10 additions and 3 deletions

View file

@ -257,6 +257,8 @@ public:
ACCESSOR(TYPE_PATTERN, RE_Matcher*, re_val, AsPattern)
ACCESSOR(TYPE_VECTOR, std::vector<Val*>*, vector_val, AsVector)
IntrusivePtr<Func> AsFuncPtr() const;
const IPPrefix& AsSubNet()
{
CHECK_TAG(type->Tag(), TYPE_SUBNET, "Val::SubNet", type_name)