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

CoreBilling.h

00001 // tacppd resources system information
00002 // (c) Copyright in 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_BILLING_H__
00032 #define __CORE_BILLING_H__
00033 
00034 #include "global.h"
00035 
00036 namespace tacpp {
00037 
00043 class user_data {
00046   pthread_mutex_t mutex_;
00049   void lock();
00052   void unlock();
00055   db_user ddata_;
00058   int numptr_;
00059  public:
00062   user_data(db_user);
00065   ~user_data();
00068   db_user get();
00071   int getNumPtr();
00074   void incNumPtr();
00077   void decNumPtr();
00078 };
00079 
00085 class Billing_data {
00088   DLoad *dl_;
00091   pthread_mutex_t Mutex_;
00094   void lock();
00097   void unlock();
00100   int number_;
00103   string descr_;
00106   string module_;
00109   bool shutdown_;
00110  public:
00113   int getNumber();
00116   void setDescr(string);
00119   string getDescr();
00122   void setModule(string);
00125   string getModule();
00128   void setShutdown(bool);
00131   bool getShutdown();
00134   Billing_data(int);
00137   ~Billing_data();
00140   string load();
00143   string buildcfstr();
00144 };
00145 
00151 class CoreBilling : public Core_data {
00154   list<Billing_data*> bd;
00157   pthread_mutex_t Mutex;
00160   void lock();
00163   void unlock();
00166   list<user_data*> ud_;
00167  public:
00170   CoreBilling(const string,const string);
00173   ~CoreBilling();
00176   void add(int);
00179   void del(int);
00182   string load(int);
00185   string getmodulename(int);
00188   void modify_shut(int,bool);
00191   void modify_mod(int,const char*);
00194   void modify_des(int,const char*);
00197   string buildcfstr(int);
00200   string applycf(char * const*mask,const string cmdname,const list<string>paramList,Command * cmd=NULL)throw (CmdErr);
00203   db_user getUd(string);
00206   void addUd(db_user);
00209   void delUd(string);
00210 };
00211 
00212 };
00213 
00214 #endif // __CORE_BILLING_H__

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