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

CoreData.h

00001 // tacppd config and core classes 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 __COREDATA_H__
00032 #define __COREDATA_H__
00033 
00034 #include "global.h"
00035 
00036 namespace tacpp {
00037 
00038 const string DEBUG_TYPE = "DEbug";
00039 class CoreDebug;
00040 const string ACCESS_TYPE = "ACCess";
00041 class CoreAccess;
00042 const string POOL_TYPE = "POOl";
00043 class CorePool;
00044 const string LISTENER_TYPE = "LISTener";
00045 class CoreListener;
00046 const string MANAGER_TYPE = "MANager";
00047 class CoreManager;
00048 const string DEVICE_TYPE = "DEVice";
00049 class CoreDevice;
00050 const string DB_TYPE = "DATabase";
00051 class CoreDb;
00052 const string BILLING_TYPE = "BILling";
00053 class CoreBilling;
00054 const string BUNDLE_TYPE = "BUNdle";
00055 class CoreBundle;
00056 const string PEER_TYPE = "PEer";
00057 class CorePeer;
00058 
00059 #define CORE_NAME_LEN       30
00060 #define CORE_DESCR_LEN      50
00061 
00067 class Core_data {
00070   pthread_mutex_t Mutex_;
00073   void lock();
00076   void unlock();
00077  public:
00080   void zero_all();
00083   CoreAccess    *coreAccess;
00086   CoreDevice    *coreDevice;
00089   CoreDebug     *coreDebug;
00092   CoreManager   *coreManager;
00095   CorePool      *corePool;
00098   CoreDb        *coreDb;
00101   CoreListener  *coreListener;
00104   CoreBundle    *coreBundle;
00107   CoreBilling   *coreBilling;
00110   CorePeer      *corePeer;
00113   Core_data(const string,const string,CoreAccess*);
00116   Core_data(const string,const string,CoreDevice*);
00119   Core_data(const string,const string,CoreDebug*);
00122   Core_data(const string,const string,CoreManager*);
00125   Core_data(const string,const string,CorePool*);
00128   Core_data(const string,const string,CoreDb*);
00131   Core_data(const string,const string,CoreListener*);
00134   Core_data(const string,const string,CoreBundle*);
00137   Core_data(const string,const string,CoreBilling*);
00140   Core_data(const string,const string,CorePeer*);
00143   virtual ~Core_data();
00146   string name;
00149   string descr;
00152   string buildcf();
00155   virtual string buildcfstr(int)=0;
00158   virtual string applycf(char * const*mask,const string cmdname,const list<string>paramList,Command * cmd=NULL)throw (CmdErr)=0;
00161   string buildcf(int,string);
00162 };
00163 
00168 class CoreData {
00171   list<Core_data*> core_;
00174   pthread_mutex_t Mutex_;
00177   void lock();
00180   void unlock();
00181  public:
00184   CoreData();
00187   ~CoreData();
00190   int size();
00193   Core_data *get(int);
00196   Core_data *get(const char*);
00197   Core_data *get(const string);
00200   string getn(int);
00203   string showcf(char*);
00206   char *writecf(char*,char*);
00209   string help();
00212   CoreAccess *getAccess();
00215   CoreDevice *getDevice();
00218   CoreDebug *getDebug();
00221   CoreManager *getManager();
00224   CorePool *getPool();
00227   CoreDb *getDb();
00230   CoreListener *getListener();
00233   CoreBundle *getBundle();
00236   CoreBilling *getBilling();
00239   CorePeer *getPeer();
00240 };
00241 
00242 };
00243 
00244 #endif //__COREDATA_H__

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