Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

AlarmStmt Class Reference

#include <Stmt.h>

Inheritance diagram for AlarmStmt:

Inheritance graph
[legend]
Collaboration diagram for AlarmStmt:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AlarmStmt (ListExpr *l)

Protected Member Functions

 AlarmStmt ()
ValDoExec (val_list *vals, stmt_flow_type &flow) const
 DECLARE_SERIAL (AlarmStmt)

Friends

class Stmt

Constructor & Destructor Documentation

AlarmStmt::AlarmStmt ListExpr l  )  [inline]
 

Definition at line 139 of file Stmt.h.

References STMT_ALARM.

00139 : ExprListStmt(STMT_ALARM, l)   { }

AlarmStmt::AlarmStmt  )  [inline, protected]
 

Definition at line 143 of file Stmt.h.

00143 {}


Member Function Documentation

AlarmStmt::DECLARE_SERIAL AlarmStmt   )  [protected]
 

Val * AlarmStmt::DoExec val_list *  vals,
stmt_flow_type flow
const [protected, virtual]
 

Implements ExprListStmt.

Definition at line 273 of file Stmt.cc.

References alarm_hook, args, bro_logger, ODesc::Description(), CallExpr::Eval(), Val::IsOne(), Logger::Log(), ExprListStmt::PrintVals(), BroObj::Unref, and Val.

00274         {
00275         ODesc d;
00276         PrintVals(&d, vals, 0);
00277 
00278         if ( alarm_hook )
00279                 {
00280                 ListExpr* args = new ListExpr();
00281                 args->Append(new ConstExpr(new StringVal(d.Description())));
00282 
00283                 CallExpr* ce =
00284                         new CallExpr(new ConstExpr(new Val(alarm_hook)), args);
00285 
00286                 Val* hook_eval = ce->Eval(0);
00287                 int do_log = hook_eval->IsOne();
00288 
00289                 Unref(ce);
00290                 Unref(hook_eval);
00291 
00292                 if ( ! do_log )
00293                         return 0;
00294                 }
00295 
00296         bro_logger->Log(d.Description());
00297         return 0;
00298         }


Friends And Related Function Documentation

friend class Stmt [friend]
 

Definition at line 142 of file Stmt.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 03:07:35 2005 for bro_docs by doxygen 1.3.5