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

CoreDebug.h

00001 // tacppd debugging
00002 // (c) Copyright 2000-2005 by tacppd team and contributors
00003 // see http://tacppd.org for more information
00004 //
00005 //  This program is free software; you can redistribute it and/or modify
00006 //  it under the terms of the GNU General Public License as published by
00007 //  the Free Software Foundation; either version 2 of the License, or
00008 //  (at your option) any later version.
00009 //
00010 //  This program is distributed in the hope that it will be useful,
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 //  GNU General Public License for more details.
00014 //
00015 //  You should have received a copy of the GNU General Public License
00016 //  along with this program; if not, write to the Free Software
00017 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 // all comments which start from /** - this is comments for KDoc
00020 //  for classes
00021 //    @short [short description of the class]
00022 //    @author [class author]
00023 //    @version [class version]
00024 //    @see [references to other classes or methods]
00025 //  for methods
00026 //    @see [references]
00027 //    @return [sentence describing the return value]
00028 //    @exception [list the exeptions that could be thrown]
00029 //    @param [name id] [description]    - can be multiple
00030 
00031 #ifndef __CORE_DEBUG_H__
00032 #define __CORE_DEBUG_H__
00033 
00034 #include "global.h"
00035 
00036 namespace tacpp {
00037 
00043 class Debug_entry {
00046   pthread_mutex_t Mutex_;
00049   void lock();
00052   void unlock();
00055   int num_;
00058   string name_;
00061   int output_;
00064   ipaddr syslogserv_;
00065  public:
00068   int getNum();
00071   string getName();
00074   int getOutput();
00077   ipaddr getSyslogserv();
00081   Debug_entry(int,const char*,int,ipaddr);
00084   ~Debug_entry();
00085 };
00086 
00092 class Debug_data {
00095   list<Debug_entry*> de_;
00098   int output_;
00101   ipaddr syslogserv_;
00104   pthread_mutex_t Mutex_;
00107   void lock();
00110   void unlock();
00111  public:
00114   int getOutput();
00117   ipaddr getSyslogserv();
00120   string buildcfstr();
00123   Debug_data(int,const char*);
00126   ~Debug_data();
00129   void add(int,const char*);
00132   void del(int);
00133 };
00134 
00140 class CoreDebug : public Core_data, public Debug {
00143   list<Debug_data*> dd_;
00146   pthread_mutex_t Mutex_;
00149   void lock();
00152   void unlock();
00153  public:
00156   CoreDebug(const string,const string);
00159   ~CoreDebug();
00162   void add(int,const char*,int);
00165   void del(int,const char*,int);
00168   void add(int,const char*);
00171   void del(int,const char*);
00174   string buildcfstr(int);
00177   string applycf(char * const*mask,const string cmdname,const list<string>paramList,Command * cmd=NULL)throw (CmdErr);
00178 };
00179 
00180 };
00181 
00182 #endif // __CORE_DEBUG_H__

Generated on Thu Jul 21 23:09:45 2005 for tacppd.kdevelop by doxygen 1.3.5