Adding override/final to overridden virtual methods.

C++11 compilers complain about overridden virtual methods
not being specified as either final or overridden.
This commit is contained in:
Seth Hall 2016-01-16 23:35:31 -05:00
parent ad61267ce6
commit a58c308427
15 changed files with 282 additions and 282 deletions

View file

@ -93,7 +93,7 @@ public:
void RemoveAttr(attr_tag t); void RemoveAttr(attr_tag t);
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void DescribeReST(ODesc* d) const; void DescribeReST(ODesc* d) const;
attr_list* Attrs() { return attrs; } attr_list* Attrs() { return attrs; }

View file

@ -201,7 +201,7 @@ public:
bool IsPersistent() { return persistent; } bool IsPersistent() { return persistent; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void IDString(ODesc* d) const; void IDString(ODesc* d) const;
TimerMgr* GetTimerMgr() const; TimerMgr* GetTimerMgr() const;
@ -336,7 +336,7 @@ public:
{ Init(arg_conn, arg_timer, arg_do_expire); } { Init(arg_conn, arg_timer, arg_do_expire); }
virtual ~ConnectionTimer(); virtual ~ConnectionTimer();
void Dispatch(double t, int is_expire); void Dispatch(double t, int is_expire) override;
protected: protected:
ConnectionTimer() {} ConnectionTimer() {}

View file

@ -220,18 +220,18 @@ public:
ID* Id() const { return id; } ID* Id() const { return id; }
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN); void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
Expr* MakeLvalue(); Expr* MakeLvalue() override;
int IsPure() const; int IsPure() const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
NameExpr() { id = 0; } NameExpr() { id = 0; }
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(NameExpr); DECLARE_SERIAL(NameExpr);
@ -246,15 +246,15 @@ public:
Val* Value() const { return val; } Val* Value() const { return val; }
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
ConstExpr() { val = 0; } ConstExpr() { val = 0; }
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(ConstExpr); DECLARE_SERIAL(ConstExpr);
Val* val; Val* val;
@ -267,11 +267,11 @@ public:
// UnaryExpr::Eval correctly handles vector types. Any child // UnaryExpr::Eval correctly handles vector types. Any child
// class that overrides Eval() should be modified to handle // class that overrides Eval() should be modified to handle
// vectors correctly as necessary. // vectors correctly as necessary.
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
int IsPure() const; int IsPure() const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
@ -280,7 +280,7 @@ protected:
UnaryExpr(BroExprTag arg_tag, Expr* arg_op); UnaryExpr(BroExprTag arg_tag, Expr* arg_op);
virtual ~UnaryExpr(); virtual ~UnaryExpr();
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
// Returns the expression folded using the given constant. // Returns the expression folded using the given constant.
virtual Val* Fold(Val* v) const; virtual Val* Fold(Val* v) const;
@ -295,14 +295,14 @@ public:
Expr* Op1() const { return op1; } Expr* Op1() const { return op1; }
Expr* Op2() const { return op2; } Expr* Op2() const { return op2; }
int IsPure() const; int IsPure() const override;
// BinaryExpr::Eval correctly handles vector types. Any child // BinaryExpr::Eval correctly handles vector types. Any child
// class that overrides Eval() should be modified to handle // class that overrides Eval() should be modified to handle
// vectors correctly as necessary. // vectors correctly as necessary.
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
@ -340,7 +340,7 @@ protected:
// operands and also set expression's type). // operands and also set expression's type).
void PromoteType(TypeTag t, bool is_vector); void PromoteType(TypeTag t, bool is_vector);
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(BinaryExpr); DECLARE_SERIAL(BinaryExpr);
@ -351,13 +351,13 @@ protected:
class CloneExpr : public UnaryExpr { class CloneExpr : public UnaryExpr {
public: public:
CloneExpr(Expr* op); CloneExpr(Expr* op);
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
protected: protected:
friend class Expr; friend class Expr;
CloneExpr() { } CloneExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(CloneExpr); DECLARE_SERIAL(CloneExpr);
}; };
@ -366,9 +366,9 @@ class IncrExpr : public UnaryExpr {
public: public:
IncrExpr(BroExprTag tag, Expr* op); IncrExpr(BroExprTag tag, Expr* op);
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
Val* DoSingleEval(Frame* f, Val* v) const; Val* DoSingleEval(Frame* f, Val* v) const;
int IsPure() const; int IsPure() const override;
protected: protected:
friend class Expr; friend class Expr;
@ -385,7 +385,7 @@ protected:
friend class Expr; friend class Expr;
NotExpr() { } NotExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(NotExpr); DECLARE_SERIAL(NotExpr);
}; };
@ -398,7 +398,7 @@ protected:
friend class Expr; friend class Expr;
PosExpr() { } PosExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(PosExpr); DECLARE_SERIAL(PosExpr);
}; };
@ -411,7 +411,7 @@ protected:
friend class Expr; friend class Expr;
NegExpr() { } NegExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(NegExpr); DECLARE_SERIAL(NegExpr);
}; };
@ -419,20 +419,20 @@ protected:
class SizeExpr : public UnaryExpr { class SizeExpr : public UnaryExpr {
public: public:
SizeExpr(Expr* op); SizeExpr(Expr* op);
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
protected: protected:
friend class Expr; friend class Expr;
SizeExpr() { } SizeExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(SizeExpr); DECLARE_SERIAL(SizeExpr);
}; };
class AddExpr : public BinaryExpr { class AddExpr : public BinaryExpr {
public: public:
AddExpr(Expr* op1, Expr* op2); AddExpr(Expr* op1, Expr* op2);
void Canonicize(); void Canonicize() override;
protected: protected:
friend class Expr; friend class Expr;
@ -445,7 +445,7 @@ protected:
class AddToExpr : public BinaryExpr { class AddToExpr : public BinaryExpr {
public: public:
AddToExpr(Expr* op1, Expr* op2); AddToExpr(Expr* op1, Expr* op2);
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
protected: protected:
friend class Expr; friend class Expr;
@ -457,7 +457,7 @@ protected:
class RemoveFromExpr : public BinaryExpr { class RemoveFromExpr : public BinaryExpr {
public: public:
RemoveFromExpr(Expr* op1, Expr* op2); RemoveFromExpr(Expr* op1, Expr* op2);
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
protected: protected:
friend class Expr; friend class Expr;
@ -481,7 +481,7 @@ protected:
class TimesExpr : public BinaryExpr { class TimesExpr : public BinaryExpr {
public: public:
TimesExpr(Expr* op1, Expr* op2); TimesExpr(Expr* op1, Expr* op2);
void Canonicize(); void Canonicize() override;
protected: protected:
friend class Expr; friend class Expr;
@ -499,7 +499,7 @@ protected:
friend class Expr; friend class Expr;
DivideExpr() { } DivideExpr() { }
Val* AddrFold(Val* v1, Val* v2) const; Val* AddrFold(Val* v1, Val* v2) const override;
DECLARE_SERIAL(DivideExpr); DECLARE_SERIAL(DivideExpr);
@ -520,7 +520,7 @@ class BoolExpr : public BinaryExpr {
public: public:
BoolExpr(BroExprTag tag, Expr* op1, Expr* op2); BoolExpr(BroExprTag tag, Expr* op1, Expr* op2);
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
Val* DoSingleEval(Frame* f, Val* v1, Expr* op2) const; Val* DoSingleEval(Frame* f, Val* v1, Expr* op2) const;
protected: protected:
@ -533,13 +533,13 @@ protected:
class EqExpr : public BinaryExpr { class EqExpr : public BinaryExpr {
public: public:
EqExpr(BroExprTag tag, Expr* op1, Expr* op2); EqExpr(BroExprTag tag, Expr* op1, Expr* op2);
void Canonicize(); void Canonicize() override;
protected: protected:
friend class Expr; friend class Expr;
EqExpr() { } EqExpr() { }
Val* Fold(Val* v1, Val* v2) const; Val* Fold(Val* v1, Val* v2) const override;
DECLARE_SERIAL(EqExpr); DECLARE_SERIAL(EqExpr);
}; };
@ -547,7 +547,7 @@ protected:
class RelExpr : public BinaryExpr { class RelExpr : public BinaryExpr {
public: public:
RelExpr(BroExprTag tag, Expr* op1, Expr* op2); RelExpr(BroExprTag tag, Expr* op1, Expr* op2);
void Canonicize(); void Canonicize() override;
protected: protected:
friend class Expr; friend class Expr;
@ -565,16 +565,16 @@ public:
const Expr* Op2() const { return op2; } const Expr* Op2() const { return op2; }
const Expr* Op3() const { return op3; } const Expr* Op3() const { return op3; }
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
int IsPure() const; int IsPure() const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
CondExpr() { op1 = op2 = op3 = 0; } CondExpr() { op1 = op2 = op3 = 0; }
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(CondExpr); DECLARE_SERIAL(CondExpr);
@ -587,8 +587,8 @@ class RefExpr : public UnaryExpr {
public: public:
RefExpr(Expr* op); RefExpr(Expr* op);
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN); void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
Expr* MakeLvalue(); Expr* MakeLvalue() override;
protected: protected:
friend class Expr; friend class Expr;
@ -604,12 +604,12 @@ public:
AssignExpr(Expr* op1, Expr* op2, int is_init, Val* val = 0, attr_list* attrs = 0); AssignExpr(Expr* op1, Expr* op2, int is_init, Val* val = 0, attr_list* attrs = 0);
virtual ~AssignExpr() { Unref(val); } virtual ~AssignExpr() { Unref(val); }
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
void EvalIntoAggregate(const BroType* t, Val* aggr, Frame* f) const; void EvalIntoAggregate(const BroType* t, Val* aggr, Frame* f) const override;
BroType* InitType() const; BroType* InitType() const override;
int IsRecordElement(TypeDecl* td) const; int IsRecordElement(TypeDecl* td) const override;
Val* InitVal(const BroType* t, Val* aggr) const; Val* InitVal(const BroType* t, Val* aggr) const override;
int IsPure() const; int IsPure() const override;
protected: protected:
friend class Expr; friend class Expr;
@ -628,28 +628,28 @@ class IndexExpr : public BinaryExpr {
public: public:
IndexExpr(Expr* op1, ListExpr* op2, bool is_slice = false); IndexExpr(Expr* op1, ListExpr* op2, bool is_slice = false);
int CanAdd() const; int CanAdd() const override;
int CanDel() const; int CanDel() const override;
void Add(Frame* f); void Add(Frame* f) override;
void Delete(Frame* f); void Delete(Frame* f) override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN); void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
Expr* MakeLvalue(); Expr* MakeLvalue() override;
// Need to override Eval since it can take a vector arg but does // Need to override Eval since it can take a vector arg but does
// not necessarily return a vector. // not necessarily return a vector.
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
IndexExpr() { } IndexExpr() { }
Val* Fold(Val* v1, Val* v2) const; Val* Fold(Val* v1, Val* v2) const override;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(IndexExpr); DECLARE_SERIAL(IndexExpr);
}; };
@ -662,20 +662,20 @@ public:
int Field() const { return field; } int Field() const { return field; }
const char* FieldName() const { return field_name; } const char* FieldName() const { return field_name; }
int CanDel() const; int CanDel() const override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN); void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
void Delete(Frame* f); void Delete(Frame* f) override;
Expr* MakeLvalue(); Expr* MakeLvalue() override;
protected: protected:
friend class Expr; friend class Expr;
FieldExpr() { field_name = 0; td = 0; } FieldExpr() { field_name = 0; td = 0; }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(FieldExpr); DECLARE_SERIAL(FieldExpr);
@ -697,9 +697,9 @@ protected:
friend class Expr; friend class Expr;
HasFieldExpr() { field_name = 0; } HasFieldExpr() { field_name = 0; }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(HasFieldExpr); DECLARE_SERIAL(HasFieldExpr);
@ -716,10 +716,10 @@ protected:
friend class Expr; friend class Expr;
RecordConstructorExpr() { } RecordConstructorExpr() { }
Val* InitVal(const BroType* t, Val* aggr) const; Val* InitVal(const BroType* t, Val* aggr) const override;
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(RecordConstructorExpr); DECLARE_SERIAL(RecordConstructorExpr);
}; };
@ -732,15 +732,15 @@ public:
Attributes* Attrs() { return attrs; } Attributes* Attrs() { return attrs; }
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
protected: protected:
friend class Expr; friend class Expr;
TableConstructorExpr() { } TableConstructorExpr() { }
Val* InitVal(const BroType* t, Val* aggr) const; Val* InitVal(const BroType* t, Val* aggr) const override;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(TableConstructorExpr); DECLARE_SERIAL(TableConstructorExpr);
@ -755,15 +755,15 @@ public:
Attributes* Attrs() { return attrs; } Attributes* Attrs() { return attrs; }
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
protected: protected:
friend class Expr; friend class Expr;
SetConstructorExpr() { } SetConstructorExpr() { }
Val* InitVal(const BroType* t, Val* aggr) const; Val* InitVal(const BroType* t, Val* aggr) const override;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(SetConstructorExpr); DECLARE_SERIAL(SetConstructorExpr);
@ -774,15 +774,15 @@ class VectorConstructorExpr : public UnaryExpr {
public: public:
VectorConstructorExpr(ListExpr* constructor_list, BroType* arg_type = 0); VectorConstructorExpr(ListExpr* constructor_list, BroType* arg_type = 0);
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
protected: protected:
friend class Expr; friend class Expr;
VectorConstructorExpr() { } VectorConstructorExpr() { }
Val* InitVal(const BroType* t, Val* aggr) const; Val* InitVal(const BroType* t, Val* aggr) const override;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(VectorConstructorExpr); DECLARE_SERIAL(VectorConstructorExpr);
}; };
@ -793,14 +793,14 @@ public:
const char* FieldName() const { return field_name.c_str(); } const char* FieldName() const { return field_name.c_str(); }
void EvalIntoAggregate(const BroType* t, Val* aggr, Frame* f) const; void EvalIntoAggregate(const BroType* t, Val* aggr, Frame* f) const override;
int IsRecordElement(TypeDecl* td) const; int IsRecordElement(TypeDecl* td) const override;
protected: protected:
friend class Expr; friend class Expr;
FieldAssignExpr() { } FieldAssignExpr() { }
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(FieldAssignExpr); DECLARE_SERIAL(FieldAssignExpr);
@ -816,7 +816,7 @@ protected:
ArithCoerceExpr() { } ArithCoerceExpr() { }
Val* FoldSingleVal(Val* v, InternalTypeTag t) const; Val* FoldSingleVal(Val* v, InternalTypeTag t) const;
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(ArithCoerceExpr); DECLARE_SERIAL(ArithCoerceExpr);
}; };
@ -830,8 +830,8 @@ protected:
friend class Expr; friend class Expr;
RecordCoerceExpr() { map = 0; } RecordCoerceExpr() { map = 0; }
Val* InitVal(const BroType* t, Val* aggr) const; Val* InitVal(const BroType* t, Val* aggr) const override;
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(RecordCoerceExpr); DECLARE_SERIAL(RecordCoerceExpr);
@ -850,7 +850,7 @@ protected:
friend class Expr; friend class Expr;
TableCoerceExpr() { } TableCoerceExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(TableCoerceExpr); DECLARE_SERIAL(TableCoerceExpr);
}; };
@ -864,7 +864,7 @@ protected:
friend class Expr; friend class Expr;
VectorCoerceExpr() { } VectorCoerceExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(VectorCoerceExpr); DECLARE_SERIAL(VectorCoerceExpr);
}; };
@ -879,7 +879,7 @@ protected:
friend class Expr; friend class Expr;
FlattenExpr() { } FlattenExpr() { }
Val* Fold(Val* v) const; Val* Fold(Val* v) const override;
DECLARE_SERIAL(FlattenExpr); DECLARE_SERIAL(FlattenExpr);
@ -907,20 +907,20 @@ public:
ScheduleExpr(Expr* when, EventExpr* event); ScheduleExpr(Expr* when, EventExpr* event);
~ScheduleExpr(); ~ScheduleExpr();
int IsPure() const; int IsPure() const override;
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
Expr* When() const { return when; } Expr* When() const { return when; }
EventExpr* Event() const { return event; } EventExpr* Event() const { return event; }
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
ScheduleExpr() { when = 0; event = 0; } ScheduleExpr() { when = 0; event = 0; }
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(ScheduleExpr); DECLARE_SERIAL(ScheduleExpr);
@ -936,7 +936,7 @@ protected:
friend class Expr; friend class Expr;
InExpr() { } InExpr() { }
Val* Fold(Val* v1, Val* v2) const; Val* Fold(Val* v1, Val* v2) const override;
DECLARE_SERIAL(InExpr); DECLARE_SERIAL(InExpr);
@ -950,17 +950,17 @@ public:
Expr* Func() const { return func; } Expr* Func() const { return func; }
ListExpr* Args() const { return args; } ListExpr* Args() const { return args; }
int IsPure() const; int IsPure() const override;
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
CallExpr() { func = 0; args = 0; } CallExpr() { func = 0; args = 0; }
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(CallExpr); DECLARE_SERIAL(CallExpr);
@ -977,15 +977,15 @@ public:
ListExpr* Args() const { return args; } ListExpr* Args() const { return args; }
EventHandlerPtr Handler() const { return handler; } EventHandlerPtr Handler() const { return handler; }
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Expr; friend class Expr;
EventExpr() { args = 0; } EventExpr() { args = 0; }
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(EventExpr); DECLARE_SERIAL(EventExpr);
@ -1006,24 +1006,24 @@ public:
expr_list& Exprs() { return exprs; } expr_list& Exprs() { return exprs; }
// True if the entire list represents pure values. // True if the entire list represents pure values.
int IsPure() const; int IsPure() const override;
// True if the entire list represents constant values. // True if the entire list represents constant values.
int AllConst() const; int AllConst() const;
Val* Eval(Frame* f) const; Val* Eval(Frame* f) const override;
BroType* InitType() const; BroType* InitType() const override;
Val* InitVal(const BroType* t, Val* aggr) const; Val* InitVal(const BroType* t, Val* aggr) const override;
Expr* MakeLvalue(); Expr* MakeLvalue() override;
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN); void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
Val* AddSetInit(const BroType* t, Val* aggr) const; Val* AddSetInit(const BroType* t, Val* aggr) const;
void ExprDescribe(ODesc* d) const; void ExprDescribe(ODesc* d) const override;
DECLARE_SERIAL(ListExpr); DECLARE_SERIAL(ListExpr);
@ -1035,7 +1035,7 @@ class RecordAssignExpr : public ListExpr {
public: public:
RecordAssignExpr(Expr* record, Expr* init_list, int is_init); RecordAssignExpr(Expr* record, Expr* init_list, int is_init);
Val* Eval(Frame* f) const { return ListExpr::Eval(f); } Val* Eval(Frame* f) const override { return ListExpr::Eval(f); }
protected: protected:
friend class Expr; friend class Expr;

View file

@ -49,7 +49,7 @@ public:
// closed, not active, or whatever. // closed, not active, or whatever.
int Close(); int Close();
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void SetRotateInterval(double secs); void SetRotateInterval(double secs);

View file

@ -92,15 +92,15 @@ public:
BroFunc(ID* id, Stmt* body, id_list* inits, int frame_size, int priority); BroFunc(ID* id, Stmt* body, id_list* inits, int frame_size, int priority);
~BroFunc(); ~BroFunc();
int IsPure() const; int IsPure() const override;
Val* Call(val_list* args, Frame* parent) const; Val* Call(val_list* args, Frame* parent) const override;
void AddBody(Stmt* new_body, id_list* new_inits, int new_frame_size, void AddBody(Stmt* new_body, id_list* new_inits, int new_frame_size,
int priority); int priority) override;
int FrameSize() const { return frame_size; } int FrameSize() const { return frame_size; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
protected: protected:
BroFunc() : Func(BRO_FUNC) {} BroFunc() : Func(BRO_FUNC) {}
@ -118,11 +118,11 @@ public:
BuiltinFunc(built_in_func func, const char* name, int is_pure); BuiltinFunc(built_in_func func, const char* name, int is_pure);
~BuiltinFunc(); ~BuiltinFunc();
int IsPure() const; int IsPure() const override;
Val* Call(val_list* args, Frame* parent) const; Val* Call(val_list* args, Frame* parent) const override;
built_in_func TheFunc() const { return func; } built_in_func TheFunc() const { return func; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
protected: protected:
BuiltinFunc() { func = 0; is_pure = 0; } BuiltinFunc() { func = 0; is_pure = 0; }

View file

@ -87,7 +87,7 @@ public:
void Error(const char* msg, const BroObj* o2 = 0); void Error(const char* msg, const BroObj* o2 = 0);
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
// Adds type and value to description. // Adds type and value to description.
void DescribeExtended(ODesc* d) const; void DescribeExtended(ODesc* d) const;
// Produces a description that's reST-ready. // Produces a description that's reST-ready.

View file

@ -48,9 +48,9 @@ public:
protected: protected:
friend class Val; friend class Val;
virtual bool DoInit() /* override */; virtual bool DoInit() override;
virtual bool DoFeed(const void* data, size_t size) /* override */; virtual bool DoFeed(const void* data, size_t size) override;
virtual StringVal* DoGet() /* override */; virtual StringVal* DoGet() override;
DECLARE_SERIAL(MD5Val); DECLARE_SERIAL(MD5Val);
@ -67,9 +67,9 @@ public:
protected: protected:
friend class Val; friend class Val;
virtual bool DoInit() /* override */; virtual bool DoInit() override;
virtual bool DoFeed(const void* data, size_t size) /* override */; virtual bool DoFeed(const void* data, size_t size) override;
virtual StringVal* DoGet() /* override */; virtual StringVal* DoGet() override;
DECLARE_SERIAL(SHA1Val); DECLARE_SERIAL(SHA1Val);
@ -86,9 +86,9 @@ public:
protected: protected:
friend class Val; friend class Val;
virtual bool DoInit() /* override */; virtual bool DoInit() override;
virtual bool DoFeed(const void* data, size_t size) /* override */; virtual bool DoFeed(const void* data, size_t size) override;
virtual StringVal* DoGet() /* override */; virtual StringVal* DoGet() override;
DECLARE_SERIAL(SHA256Val); DECLARE_SERIAL(SHA256Val);

View file

@ -169,10 +169,10 @@ public:
#define DECLARE_SERIAL(classname) \ #define DECLARE_SERIAL(classname) \
static classname* Instantiate(); \ static classname* Instantiate(); \
static SerialTypeRegistrator register_type; \ static SerialTypeRegistrator register_type; \
virtual bool DoSerialize(SerialInfo*) const; \ virtual bool DoSerialize(SerialInfo*) const override; \
virtual bool DoUnserialize(UnserialInfo*); \ virtual bool DoUnserialize(UnserialInfo*) override; \
virtual const TransientID* GetTID() const { return &tid; } \ virtual const TransientID* GetTID() const override { return &tid; } \
virtual SerialType GetSerialType() const; \ virtual SerialType GetSerialType() const override; \
TransientID tid; TransientID tid;
// Only needed (and usable) for non-abstract classes. // Only needed (and usable) for non-abstract classes.

View file

@ -124,7 +124,7 @@ protected:
friend class Stmt; friend class Stmt;
PrintStmt() {} PrintStmt() {}
Val* DoExec(val_list* vals, stmt_flow_type& flow) const; Val* DoExec(val_list* vals, stmt_flow_type& flow) const override;
DECLARE_SERIAL(PrintStmt); DECLARE_SERIAL(PrintStmt);
}; };
@ -134,13 +134,13 @@ public:
ExprStmt(Expr* e); ExprStmt(Expr* e);
virtual ~ExprStmt(); virtual ~ExprStmt();
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
const Expr* StmtExpr() const { return e; } const Expr* StmtExpr() const { return e; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
@ -149,7 +149,7 @@ protected:
virtual Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const; virtual Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const;
int IsPure() const; int IsPure() const override;
DECLARE_SERIAL(ExprStmt); DECLARE_SERIAL(ExprStmt);
@ -164,16 +164,16 @@ public:
const Stmt* TrueBranch() const { return s1; } const Stmt* TrueBranch() const { return s1; }
const Stmt* FalseBranch() const { return s2; } const Stmt* FalseBranch() const { return s2; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
IfStmt() { s1 = s2 = 0; } IfStmt() { s1 = s2 = 0; }
Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const; Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const override;
int IsPure() const; int IsPure() const override;
DECLARE_SERIAL(IfStmt); DECLARE_SERIAL(IfStmt);
@ -192,7 +192,7 @@ public:
const Stmt* Body() const { return s; } const Stmt* Body() const { return s; }
Stmt* Body() { return s; } Stmt* Body() { return s; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
bool Serialize(SerialInfo* info) const; bool Serialize(SerialInfo* info) const;
static Case* Unserialize(UnserialInfo* info); static Case* Unserialize(UnserialInfo* info);
@ -216,16 +216,16 @@ public:
const case_list* Cases() const { return cases; } const case_list* Cases() const { return cases; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
SwitchStmt() { cases = 0; default_case_idx = -1; comp_hash = 0; } SwitchStmt() { cases = 0; default_case_idx = -1; comp_hash = 0; }
Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const; Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const override;
int IsPure() const; int IsPure() const override;
DECLARE_SERIAL(SwitchStmt); DECLARE_SERIAL(SwitchStmt);
@ -252,10 +252,10 @@ class AddStmt : public ExprStmt {
public: public:
AddStmt(Expr* e); AddStmt(Expr* e);
int IsPure() const; int IsPure() const override;
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
@ -268,10 +268,10 @@ class DelStmt : public ExprStmt {
public: public:
DelStmt(Expr* e); DelStmt(Expr* e);
int IsPure() const; int IsPure() const override;
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
@ -284,9 +284,9 @@ class EventStmt : public ExprStmt {
public: public:
EventStmt(EventExpr* e); EventStmt(EventExpr* e);
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
@ -303,11 +303,11 @@ public:
WhileStmt(Expr* loop_condition, Stmt* body); WhileStmt(Expr* loop_condition, Stmt* body);
~WhileStmt(); ~WhileStmt();
int IsPure() const; int IsPure() const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
@ -315,7 +315,7 @@ protected:
WhileStmt() WhileStmt()
{ loop_condition = 0; body = 0; } { loop_condition = 0; body = 0; }
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
DECLARE_SERIAL(WhileStmt); DECLARE_SERIAL(WhileStmt);
@ -334,17 +334,17 @@ public:
const Expr* LoopExpr() const { return e; } const Expr* LoopExpr() const { return e; }
const Stmt* LoopBody() const { return body; } const Stmt* LoopBody() const { return body; }
int IsPure() const; int IsPure() const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
ForStmt() { loop_vars = 0; body = 0; } ForStmt() { loop_vars = 0; body = 0; }
Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const; Val* DoExec(Frame* f, Val* v, stmt_flow_type& flow) const override;
DECLARE_SERIAL(ForStmt); DECLARE_SERIAL(ForStmt);
@ -356,12 +356,12 @@ class NextStmt : public Stmt {
public: public:
NextStmt() : Stmt(STMT_NEXT) { } NextStmt() : Stmt(STMT_NEXT) { }
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
int IsPure() const; int IsPure() const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
DECLARE_SERIAL(NextStmt); DECLARE_SERIAL(NextStmt);
@ -371,12 +371,12 @@ class BreakStmt : public Stmt {
public: public:
BreakStmt() : Stmt(STMT_BREAK) { } BreakStmt() : Stmt(STMT_BREAK) { }
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
int IsPure() const; int IsPure() const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
DECLARE_SERIAL(BreakStmt); DECLARE_SERIAL(BreakStmt);
@ -386,12 +386,12 @@ class FallthroughStmt : public Stmt {
public: public:
FallthroughStmt() : Stmt(STMT_FALLTHROUGH) { } FallthroughStmt() : Stmt(STMT_FALLTHROUGH) { }
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
int IsPure() const; int IsPure() const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
DECLARE_SERIAL(FallthroughStmt); DECLARE_SERIAL(FallthroughStmt);
@ -401,9 +401,9 @@ class ReturnStmt : public ExprStmt {
public: public:
ReturnStmt(Expr* e); ReturnStmt(Expr* e);
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
protected: protected:
friend class Stmt; friend class Stmt;
@ -417,17 +417,17 @@ public:
StmtList(); StmtList();
~StmtList(); ~StmtList();
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
const stmt_list& Stmts() const { return stmts; } const stmt_list& Stmts() const { return stmts; }
stmt_list& Stmts() { return stmts; } stmt_list& Stmts() { return stmts; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
int IsPure() const; int IsPure() const override;
DECLARE_SERIAL(StmtList); DECLARE_SERIAL(StmtList);
@ -439,9 +439,9 @@ public:
EventBodyList() : StmtList() EventBodyList() : StmtList()
{ topmost = false; tag = STMT_EVENT_BODY_LIST; } { topmost = false; tag = STMT_EVENT_BODY_LIST; }
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
// "Topmost" means that this is the main body of a function or event. // "Topmost" means that this is the main body of a function or event.
// void SetTopmost(bool is_topmost) { topmost = is_topmost; } // void SetTopmost(bool is_topmost) { topmost = is_topmost; }
@ -465,13 +465,13 @@ public:
~InitStmt(); ~InitStmt();
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
const id_list* Inits() const { return inits; } const id_list* Inits() const { return inits; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
friend class Stmt; friend class Stmt;
@ -486,12 +486,12 @@ class NullStmt : public Stmt {
public: public:
NullStmt() : Stmt(STMT_NULL) { } NullStmt() : Stmt(STMT_NULL) { }
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
int IsPure() const; int IsPure() const override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
DECLARE_SERIAL(NullStmt); DECLARE_SERIAL(NullStmt);
@ -503,17 +503,17 @@ public:
WhenStmt(Expr* cond, Stmt* s1, Stmt* s2, Expr* timeout, bool is_return); WhenStmt(Expr* cond, Stmt* s1, Stmt* s2, Expr* timeout, bool is_return);
~WhenStmt(); ~WhenStmt();
Val* Exec(Frame* f, stmt_flow_type& flow) const; Val* Exec(Frame* f, stmt_flow_type& flow) const override;
int IsPure() const; int IsPure() const override;
const Expr* Cond() const { return cond; } const Expr* Cond() const { return cond; }
const Stmt* Body() const { return s1; } const Stmt* Body() const { return s1; }
const Expr* TimeoutExpr() const { return timeout; } const Expr* TimeoutExpr() const { return timeout; }
const Stmt* TimeoutBody() const { return s2; } const Stmt* TimeoutBody() const { return s2; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
TraversalCode Traverse(TraversalCallback* cb) const; TraversalCode Traverse(TraversalCallback* cb) const override;
protected: protected:
WhenStmt() { cond = 0; s1 = s2 = 0; timeout = 0; is_return = 0; } WhenStmt() { cond = 0; s1 = s2 = 0; timeout = 0; is_return = 0; }

View file

@ -248,7 +248,7 @@ public:
BroType* Ref() { ::Ref(this); return this; } BroType* Ref() { ::Ref(this); return this; }
virtual void Describe(ODesc* d) const; virtual void Describe(ODesc* d) const override;
virtual void DescribeReST(ODesc* d, bool roles_only = false) const; virtual void DescribeReST(ODesc* d, bool roles_only = false) const;
virtual unsigned MemoryAllocation() const; virtual unsigned MemoryAllocation() const;
@ -312,9 +312,9 @@ public:
void Append(BroType* t); void Append(BroType* t);
void AppendEvenIfNotPure(BroType* t); void AppendEvenIfNotPure(BroType* t);
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
unsigned int MemoryAllocation() const unsigned int MemoryAllocation() const override
{ {
return BroType::MemoryAllocation() return BroType::MemoryAllocation()
+ padded_sizeof(*this) - padded_sizeof(BroType) + padded_sizeof(*this) - padded_sizeof(BroType)
@ -330,15 +330,15 @@ protected:
class IndexType : public BroType { class IndexType : public BroType {
public: public:
int MatchesIndex(ListExpr*& index) const; int MatchesIndex(ListExpr*& index) const override;
TypeList* Indices() const { return indices; } TypeList* Indices() const { return indices; }
const type_list* IndexTypes() const { return indices->Types(); } const type_list* IndexTypes() const { return indices->Types(); }
BroType* YieldType(); BroType* YieldType() override;
const BroType* YieldType() const; const BroType* YieldType() const;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void DescribeReST(ODesc* d, bool roles_only = false) const; void DescribeReST(ODesc* d, bool roles_only = false) const override;
// Returns true if this table is solely indexed by subnet. // Returns true if this table is solely indexed by subnet.
bool IsSubNetIndex() const; bool IsSubNetIndex() const;
@ -397,7 +397,7 @@ public:
~FuncType(); ~FuncType();
RecordType* Args() const { return args; } RecordType* Args() const { return args; }
BroType* YieldType(); BroType* YieldType() override;
const BroType* YieldType() const; const BroType* YieldType() const;
void SetYieldType(BroType* arg_yield) { yield = arg_yield; } void SetYieldType(BroType* arg_yield) { yield = arg_yield; }
function_flavor Flavor() const { return flavor; } function_flavor Flavor() const { return flavor; }
@ -407,13 +407,13 @@ public:
void ClearYieldType(function_flavor arg_flav) void ClearYieldType(function_flavor arg_flav)
{ Unref(yield); yield = 0; flavor = arg_flav; } { Unref(yield); yield = 0; flavor = arg_flav; }
int MatchesIndex(ListExpr*& index) const; int MatchesIndex(ListExpr*& index) const override;
int CheckArgs(const type_list* args, bool is_init = false) const; int CheckArgs(const type_list* args, bool is_init = false) const;
TypeList* ArgTypes() const { return arg_types; } TypeList* ArgTypes() const { return arg_types; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void DescribeReST(ODesc* d, bool roles_only = false) const; void DescribeReST(ODesc* d, bool roles_only = false) const override;
protected: protected:
FuncType() { args = 0; arg_types = 0; yield = 0; flavor = FUNC_FLAVOR_FUNCTION; } FuncType() { args = 0; arg_types = 0; yield = 0; flavor = FUNC_FLAVOR_FUNCTION; }
@ -463,8 +463,8 @@ public:
~RecordType(); ~RecordType();
int HasField(const char* field) const; int HasField(const char* field) const override;
BroType* FieldType(const char* field) const; BroType* FieldType(const char* field) const override;
BroType* FieldType(int field) const; BroType* FieldType(int field) const;
Val* FieldDefault(int field) const; // Ref's the returned value; 0 if none. Val* FieldDefault(int field) const; // Ref's the returned value; 0 if none.
@ -487,8 +487,8 @@ public:
// Takes ownership of list. // Takes ownership of list.
const char* AddFields(type_decl_list* types, attr_list* attr); const char* AddFields(type_decl_list* types, attr_list* attr);
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void DescribeReST(ODesc* d, bool roles_only = false) const; void DescribeReST(ODesc* d, bool roles_only = false) const override;
void DescribeFields(ODesc* d) const; void DescribeFields(ODesc* d) const;
void DescribeFieldsReST(ODesc* d, bool func_args) const; void DescribeFieldsReST(ODesc* d, bool func_args) const;
@ -504,7 +504,7 @@ protected:
class SubNetType : public BroType { class SubNetType : public BroType {
public: public:
SubNetType(); SubNetType();
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
protected: protected:
DECLARE_SERIAL(SubNetType) DECLARE_SERIAL(SubNetType)
}; };
@ -514,9 +514,9 @@ public:
FileType(BroType* yield_type); FileType(BroType* yield_type);
~FileType(); ~FileType();
BroType* YieldType(); BroType* YieldType() override;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
protected: protected:
FileType() { yield = 0; } FileType() { yield = 0; }
@ -533,8 +533,8 @@ public:
const string& Name() const { return name; } const string& Name() const { return name; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void DescribeReST(ODesc* d, bool roles_only = false) const; void DescribeReST(ODesc* d, bool roles_only = false) const override;
protected: protected:
OpaqueType() { } OpaqueType() { }
@ -569,7 +569,7 @@ public:
// will be fully qualified with their module name. // will be fully qualified with their module name.
enum_name_list Names() const; enum_name_list Names() const;
void DescribeReST(ODesc* d, bool roles_only = false) const; void DescribeReST(ODesc* d, bool roles_only = false) const override;
protected: protected:
EnumType() { counter = 0; } EnumType() { counter = 0; }
@ -599,17 +599,17 @@ class VectorType : public BroType {
public: public:
VectorType(BroType* t); VectorType(BroType* t);
virtual ~VectorType(); virtual ~VectorType();
BroType* YieldType(); BroType* YieldType() override;
const BroType* YieldType() const; const BroType* YieldType() const;
int MatchesIndex(ListExpr*& index) const; int MatchesIndex(ListExpr*& index) const override;
// Returns true if this table type is "unspecified", which is what one // Returns true if this table type is "unspecified", which is what one
// gets using an empty "vector()" constructor. // gets using an empty "vector()" constructor.
bool IsUnspecifiedVector() const; bool IsUnspecifiedVector() const;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void DescribeReST(ODesc* d, bool roles_only = false) const; void DescribeReST(ODesc* d, bool roles_only = false) const override;
protected: protected:
VectorType() { yield_type = 0; } VectorType() { yield_type = 0; }

View file

@ -325,7 +325,7 @@ public:
return (MutableVal*) this; return (MutableVal*) this;
} }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
virtual void DescribeReST(ODesc* d) const; virtual void DescribeReST(ODesc* d) const;
bool Serialize(SerialInfo* info) const; bool Serialize(SerialInfo* info) const;
@ -443,7 +443,7 @@ public:
#endif #endif
} }
virtual uint64 LastModified() const { return last_modified; } virtual uint64 LastModified() const override { return last_modified; }
// Mark value as changed. // Mark value as changed.
void Modified() void Modified()
@ -487,7 +487,7 @@ public:
protected: protected:
IntervalVal() {} IntervalVal() {}
void ValDescribe(ODesc* d) const; void ValDescribe(ODesc* d) const override;
DECLARE_SERIAL(IntervalVal); DECLARE_SERIAL(IntervalVal);
}; };
@ -509,7 +509,7 @@ public:
PortVal(uint32 p, TransportProto port_type); PortVal(uint32 p, TransportProto port_type);
PortVal(uint32 p); // used for already-massaged port value. PortVal(uint32 p); // used for already-massaged port value.
Val* SizeVal() const { return new Val(val.uint_val, TYPE_INT); } Val* SizeVal() const override { return new Val(val.uint_val, TYPE_INT); }
// Returns the port number in host order (not including the mask). // Returns the port number in host order (not including the mask).
uint32 Port() const; uint32 Port() const;
@ -535,7 +535,7 @@ protected:
friend class Val; friend class Val;
PortVal() {} PortVal() {}
void ValDescribe(ODesc* d) const; void ValDescribe(ODesc* d) const override;
DECLARE_SERIAL(PortVal); DECLARE_SERIAL(PortVal);
}; };
@ -545,14 +545,14 @@ public:
AddrVal(const char* text); AddrVal(const char* text);
~AddrVal(); ~AddrVal();
Val* SizeVal() const; Val* SizeVal() const override;
// Constructor for address already in network order. // Constructor for address already in network order.
AddrVal(uint32 addr); // IPv4. AddrVal(uint32 addr); // IPv4.
AddrVal(const uint32 addr[4]); // IPv6. AddrVal(const uint32 addr[4]); // IPv6.
AddrVal(const IPAddr& addr); AddrVal(const IPAddr& addr);
unsigned int MemoryAllocation() const; unsigned int MemoryAllocation() const override;
protected: protected:
friend class Val; friend class Val;
@ -573,7 +573,7 @@ public:
SubNetVal(const IPPrefix& prefix); SubNetVal(const IPPrefix& prefix);
~SubNetVal(); ~SubNetVal();
Val* SizeVal() const; Val* SizeVal() const override;
const IPAddr& Prefix() const; const IPAddr& Prefix() const;
int Width() const; int Width() const;
@ -581,13 +581,13 @@ public:
bool Contains(const IPAddr& addr) const; bool Contains(const IPAddr& addr) const;
unsigned int MemoryAllocation() const; unsigned int MemoryAllocation() const override;
protected: protected:
friend class Val; friend class Val;
SubNetVal() {} SubNetVal() {}
void ValDescribe(ODesc* d) const; void ValDescribe(ODesc* d) const override;
DECLARE_SERIAL(SubNetVal); DECLARE_SERIAL(SubNetVal);
}; };
@ -599,7 +599,7 @@ public:
StringVal(const string& s); StringVal(const string& s);
StringVal(int length, const char* s); StringVal(int length, const char* s);
Val* SizeVal() const Val* SizeVal() const override
{ return new Val(val.string_val->Len(), TYPE_COUNT); } { return new Val(val.string_val->Len(), TYPE_COUNT); }
int Len() { return AsString()->Len(); } int Len() { return AsString()->Len(); }
@ -613,13 +613,13 @@ public:
StringVal* ToUpper(); StringVal* ToUpper();
unsigned int MemoryAllocation() const; unsigned int MemoryAllocation() const override;
protected: protected:
friend class Val; friend class Val;
StringVal() {} StringVal() {}
void ValDescribe(ODesc* d) const; void ValDescribe(ODesc* d) const override;
DECLARE_SERIAL(StringVal); DECLARE_SERIAL(StringVal);
}; };
@ -629,17 +629,17 @@ public:
PatternVal(RE_Matcher* re); PatternVal(RE_Matcher* re);
~PatternVal(); ~PatternVal();
int AddTo(Val* v, int is_first_init) const; int AddTo(Val* v, int is_first_init) const override;
void SetMatcher(RE_Matcher* re); void SetMatcher(RE_Matcher* re);
unsigned int MemoryAllocation() const; unsigned int MemoryAllocation() const override;
protected: protected:
friend class Val; friend class Val;
PatternVal() {} PatternVal() {}
void ValDescribe(ODesc* d) const; void ValDescribe(ODesc* d) const override;
DECLARE_SERIAL(PatternVal); DECLARE_SERIAL(PatternVal);
}; };
@ -653,7 +653,7 @@ public:
TypeTag BaseTag() const { return tag; } TypeTag BaseTag() const { return tag; }
Val* SizeVal() const { return new Val(vals.length(), TYPE_COUNT); } Val* SizeVal() const override { return new Val(vals.length(), TYPE_COUNT); }
int Length() const { return vals.length(); } int Length() const { return vals.length(); }
Val* Index(const int n) { return vals[n]; } Val* Index(const int n) { return vals[n]; }
@ -677,9 +677,9 @@ public:
const val_list* Vals() const { return &vals; } const val_list* Vals() const { return &vals; }
val_list* Vals() { return &vals; } val_list* Vals() { return &vals; }
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
unsigned int MemoryAllocation() const; unsigned int MemoryAllocation() const override;
protected: protected:
friend class Val; friend class Val;
@ -760,14 +760,14 @@ public:
int Assign(Val* index, Val* new_val, Opcode op = OP_ASSIGN); int Assign(Val* index, Val* new_val, Opcode op = OP_ASSIGN);
int Assign(Val* index, HashKey* k, Val* new_val, Opcode op = OP_ASSIGN); int Assign(Val* index, HashKey* k, Val* new_val, Opcode op = OP_ASSIGN);
Val* SizeVal() const { return new Val(Size(), TYPE_COUNT); } Val* SizeVal() const override { return new Val(Size(), TYPE_COUNT); }
// Add the entire contents of the table to the given value, // Add the entire contents of the table to the given value,
// which must also be a TableVal. // which must also be a TableVal.
// Returns true if the addition typechecked, false if not. // Returns true if the addition typechecked, false if not.
// If is_first_init is true, then this is the *first* initialization // If is_first_init is true, then this is the *first* initialization
// (and so should be strictly adding new elements). // (and so should be strictly adding new elements).
int AddTo(Val* v, int is_first_init) const; int AddTo(Val* v, int is_first_init) const override;
// Same but allows suppression of state operations. // Same but allows suppression of state operations.
int AddTo(Val* v, int is_first_init, bool propagate_ops) const; int AddTo(Val* v, int is_first_init, bool propagate_ops) const;
@ -778,7 +778,7 @@ public:
// Remove the entire contents of the table from the given value. // Remove the entire contents of the table from the given value.
// which must also be a TableVal. // which must also be a TableVal.
// Returns true if the addition typechecked, false if not. // Returns true if the addition typechecked, false if not.
int RemoveFrom(Val* v) const; int RemoveFrom(Val* v) const override;
// Expands any lists in the index into multiple initializations. // Expands any lists in the index into multiple initializations.
// Returns true if the initializations typecheck, false if not. // Returns true if the initializations typecheck, false if not.
@ -813,12 +813,12 @@ public:
int Size() const { return AsTable()->Length(); } int Size() const { return AsTable()->Length(); }
int RecursiveSize() const; int RecursiveSize() const;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
void InitTimer(double delay); void InitTimer(double delay);
void DoExpire(double t); void DoExpire(double t);
unsigned int MemoryAllocation() const; unsigned int MemoryAllocation() const override;
void ClearTimer(Timer* t) void ClearTimer(Timer* t)
{ {
@ -840,8 +840,8 @@ protected:
int ExpandCompoundAndInit(val_list* vl, int k, Val* new_val); int ExpandCompoundAndInit(val_list* vl, int k, Val* new_val);
int CheckAndAssign(Val* index, Val* new_val, Opcode op = OP_ASSIGN); int CheckAndAssign(Val* index, Val* new_val, Opcode op = OP_ASSIGN);
bool AddProperties(Properties arg_state); bool AddProperties(Properties arg_state) override;
bool RemoveProperties(Properties arg_state); bool RemoveProperties(Properties arg_state) override;
// Calculates default value for index. Returns 0 if none. // Calculates default value for index. Returns 0 if none.
Val* Default(Val* index); Val* Default(Val* index);
@ -871,7 +871,7 @@ public:
RecordVal(RecordType* t); RecordVal(RecordType* t);
~RecordVal(); ~RecordVal();
Val* SizeVal() const Val* SizeVal() const override
{ return new Val(record_type->NumFields(), TYPE_COUNT); } { return new Val(record_type->NumFields(), TYPE_COUNT); }
void Assign(int field, Val* new_val, Opcode op = OP_ASSIGN); void Assign(int field, Val* new_val, Opcode op = OP_ASSIGN);
@ -889,7 +889,7 @@ public:
*/ */
Val* Lookup(const char* field, bool with_default = false) const; Val* Lookup(const char* field, bool with_default = false) const;
void Describe(ODesc* d) const; void Describe(ODesc* d) const override;
// This is an experiment to associate a BroObj within the // This is an experiment to associate a BroObj within the
// event engine to a record value in bro script. // event engine to a record value in bro script.
@ -910,15 +910,15 @@ public:
RecordVal* CoerceTo(const RecordType* other, Val* aggr, bool allow_orphaning = false) const; RecordVal* CoerceTo(const RecordType* other, Val* aggr, bool allow_orphaning = false) const;
RecordVal* CoerceTo(RecordType* other, bool allow_orphaning = false); RecordVal* CoerceTo(RecordType* other, bool allow_orphaning = false);
unsigned int MemoryAllocation() const; unsigned int MemoryAllocation() const override;
void DescribeReST(ODesc* d) const; void DescribeReST(ODesc* d) const override;
protected: protected:
friend class Val; friend class Val;
RecordVal() {} RecordVal() {}
bool AddProperties(Properties arg_state); bool AddProperties(Properties arg_state) override;
bool RemoveProperties(Properties arg_state); bool RemoveProperties(Properties arg_state) override;
DECLARE_SERIAL(RecordVal); DECLARE_SERIAL(RecordVal);
@ -934,13 +934,13 @@ public:
type = t; type = t;
} }
Val* SizeVal() const { return new Val(val.int_val, TYPE_INT); } Val* SizeVal() const override { return new Val(val.int_val, TYPE_INT); }
protected: protected:
friend class Val; friend class Val;
EnumVal() {} EnumVal() {}
void ValDescribe(ODesc* d) const; void ValDescribe(ODesc* d) const override;
DECLARE_SERIAL(EnumVal); DECLARE_SERIAL(EnumVal);
}; };
@ -951,7 +951,7 @@ public:
VectorVal(VectorType* t); VectorVal(VectorType* t);
~VectorVal(); ~VectorVal();
Val* SizeVal() const Val* SizeVal() const override
{ return new Val(uint32(val.vector_val->size()), TYPE_COUNT); } { return new Val(uint32(val.vector_val->size()), TYPE_COUNT); }
// Returns false if the type of the argument was wrong. // Returns false if the type of the argument was wrong.
@ -996,9 +996,9 @@ protected:
friend class Val; friend class Val;
VectorVal() { } VectorVal() { }
bool AddProperties(Properties arg_state); bool AddProperties(Properties arg_state) override;
bool RemoveProperties(Properties arg_state); bool RemoveProperties(Properties arg_state) override;
void ValDescribe(ODesc* d) const; void ValDescribe(ODesc* d) const override;
DECLARE_SERIAL(VectorVal); DECLARE_SERIAL(VectorVal);

View file

@ -91,15 +91,15 @@ private:
DECLARE_SERIAL(TCP_Reassembler); DECLARE_SERIAL(TCP_Reassembler);
void Undelivered(uint64 up_to_seq); void Undelivered(uint64 up_to_seq) override;
void Gap(uint64 seq, uint64 len); void Gap(uint64 seq, uint64 len);
void RecordToSeq(uint64 start_seq, uint64 stop_seq, BroFile* f); void RecordToSeq(uint64 start_seq, uint64 stop_seq, BroFile* f);
void RecordBlock(DataBlock* b, BroFile* f); void RecordBlock(DataBlock* b, BroFile* f);
void RecordGap(uint64 start_seq, uint64 upper_seq, BroFile* f); void RecordGap(uint64 start_seq, uint64 upper_seq, BroFile* f);
void BlockInserted(DataBlock* b); void BlockInserted(DataBlock* b) override;
void Overlap(const u_char* b1, const u_char* b2, uint64 n); void Overlap(const u_char* b1, const u_char* b2, uint64 n) override;
TCP_Endpoint* endp; TCP_Endpoint* endp;

View file

@ -52,9 +52,9 @@ protected:
DECLARE_SERIAL(FileReassembler); DECLARE_SERIAL(FileReassembler);
void Undelivered(uint64 up_to_seq); void Undelivered(uint64 up_to_seq) override;
void BlockInserted(DataBlock* b); void BlockInserted(DataBlock* b) override;
void Overlap(const u_char* b1, const u_char* b2, uint64 n); void Overlap(const u_char* b1, const u_char* b2, uint64 n) override;
File* the_file; File* the_file;
bool flushing; bool flushing;

View file

@ -158,11 +158,11 @@ public:
static size_t K(size_t cells, size_t capacity); static size_t K(size_t cells, size_t capacity);
// Overridden from BloomFilter. // Overridden from BloomFilter.
virtual bool Empty() const; virtual bool Empty() const override;
virtual void Clear(); virtual void Clear() override;
virtual bool Merge(const BloomFilter* other); virtual bool Merge(const BloomFilter* other) override;
virtual BasicBloomFilter* Clone() const; virtual BasicBloomFilter* Clone() const override;
virtual string InternalState() const; virtual string InternalState() const override;
protected: protected:
DECLARE_SERIAL(BasicBloomFilter); DECLARE_SERIAL(BasicBloomFilter);
@ -173,8 +173,8 @@ protected:
BasicBloomFilter(); BasicBloomFilter();
// Overridden from BloomFilter. // Overridden from BloomFilter.
virtual void Add(const HashKey* key); virtual void Add(const HashKey* key) override;
virtual size_t Count(const HashKey* key) const; virtual size_t Count(const HashKey* key) const override;
private: private:
BitVector* bits; BitVector* bits;
@ -203,11 +203,11 @@ public:
~CountingBloomFilter(); ~CountingBloomFilter();
// Overridden from BloomFilter. // Overridden from BloomFilter.
virtual bool Empty() const; virtual bool Empty() const override;
virtual void Clear(); virtual void Clear() override;
virtual bool Merge(const BloomFilter* other); virtual bool Merge(const BloomFilter* other) override;
virtual CountingBloomFilter* Clone() const; virtual CountingBloomFilter* Clone() const override;
virtual string InternalState() const; virtual string InternalState() const override;
protected: protected:
DECLARE_SERIAL(CountingBloomFilter); DECLARE_SERIAL(CountingBloomFilter);
@ -218,8 +218,8 @@ protected:
CountingBloomFilter(); CountingBloomFilter();
// Overridden from BloomFilter. // Overridden from BloomFilter.
virtual void Add(const HashKey* key); virtual void Add(const HashKey* key) override;
virtual size_t Count(const HashKey* key) const; virtual size_t Count(const HashKey* key) const override;
private: private:
CounterVector* cells; CounterVector* cells;

View file

@ -191,9 +191,9 @@ public:
DefaultHasher(size_t k, size_t seed); DefaultHasher(size_t k, size_t seed);
// Overridden from Hasher. // Overridden from Hasher.
virtual digest_vector Hash(const void* x, size_t n) const /* final */; virtual digest_vector Hash(const void* x, size_t n) const final;
virtual DefaultHasher* Clone() const /* final */; virtual DefaultHasher* Clone() const final;
virtual bool Equals(const Hasher* other) const /* final */; virtual bool Equals(const Hasher* other) const final;
DECLARE_SERIAL(DefaultHasher); DECLARE_SERIAL(DefaultHasher);
@ -219,9 +219,9 @@ public:
DoubleHasher(size_t k, size_t seed); DoubleHasher(size_t k, size_t seed);
// Overridden from Hasher. // Overridden from Hasher.
virtual digest_vector Hash(const void* x, size_t n) const /* final */; virtual digest_vector Hash(const void* x, size_t n) const final;
virtual DoubleHasher* Clone() const /* final */; virtual DoubleHasher* Clone() const final;
virtual bool Equals(const Hasher* other) const /* final */; virtual bool Equals(const Hasher* other) const final;
DECLARE_SERIAL(DoubleHasher); DECLARE_SERIAL(DoubleHasher);