Minor interface changes to provide more accessor methods for class

information.

In particular, adding a few const versions of methods.
This commit is contained in:
Robin Sommer 2013-11-26 10:57:02 -08:00
parent b6c1b35bb8
commit f0fe270029
4 changed files with 39 additions and 6 deletions

View file

@ -32,9 +32,11 @@ public:
void SetType(BroType* t) { Unref(type); type = t; }
BroType* Type() { return type; }
const BroType* Type() const { return type; }
void MakeType() { is_type = 1; }
BroType* AsType() { return is_type ? Type() : 0; }
const BroType* AsType() const { return is_type ? Type() : 0; }
// If weak_ref is false, the Val is assumed to be already ref'ed
// and will be deref'ed when the ID is deleted.