00001 // 00002 // log.hh : Log Filter Include File 00003 // author : Fabio Silva 00004 // 00005 // Copyright (C) 2000-2002 by the University of Southern California 00006 // $Id: log.hh,v 1.6 2002/11/26 22:45:38 haldar Exp $ 00007 // 00008 // This program is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU General Public License, 00010 // version 2, as published by the Free Software Foundation. 00011 // 00012 // This program is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License along 00018 // with this program; if not, write to the Free Software Foundation, Inc., 00019 // 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 00020 // 00021 // 00022 00023 #ifndef _LOG_HH_ 00024 #define _LOG_HH_ 00025 00026 #ifdef HAVE_CONFIG_H 00027 #include "config.h" 00028 #endif // HAVE_CONFIG_H 00029 00030 #include "diffapp.hh" 00031 00032 #define LOG_FILTER_PRIORITY 16 00033 00034 class LogFilter; 00035 00036 class LogFilterReceive : public FilterCallback { 00037 public: 00038 LogFilterReceive(LogFilter *app) : app_(app) {}; 00039 void recv(Message *msg, handle h); 00040 00041 LogFilter *app_; 00042 }; 00043 00044 class LogFilter : public DiffApp { 00045 public: 00046 #ifdef NS_DIFFUSION 00047 LogFilter(); 00048 int command(int argc, const char*const* argv); 00049 #else 00050 LogFilter(int argc, char **argv); 00051 #endif // NS_DIFFUSION 00052 00053 void run(); 00054 void recv(Message *msg, handle h); 00055 00056 protected: 00057 // General Variables/Functions 00058 handle filter_handle_; 00059 00060 // Receive Callback for the filter 00061 LogFilterReceive *filter_callback_; 00062 00063 // Setup the filter 00064 handle setupFilter(); 00065 00066 // Message Processing 00067 void ProcessMessage(Message *msg); 00068 }; 00069 00070 #endif // !_LOG_HH_
1.3.3