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

base.h

Go to the documentation of this file.
00001 /*       +------------------------------------+
00002  *       | Inspire Internet Relay Chat Daemon |
00003  *       +------------------------------------+
00004  *
00005  *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
00006  *                       E-mail:
00007  *                <brain@chatspike.net>
00008  *                <Craig@chatspike.net>
00009  *     
00010  * Written by Craig Edwards, Craig McLure, and others.
00011  * This program is free but copyrighted software; see
00012  *            the file COPYING for details.
00013  *
00014  * ---------------------------------------------------
00015  */
00016 
00017 #ifndef __BASE_H__ 
00018 #define __BASE_H__ 
00019 
00020 #include "inspircd_config.h" 
00021 #include <time.h>
00022 #include <map>
00023 #include <string>
00024 
00025 typedef void* VoidPointer;
00026  
00029 class classbase
00030 {
00031  public:
00034         time_t age;
00035 
00039         classbase() { age = time(NULL); }
00040         ~classbase() { }
00041 };
00042 
00050 class Extensible : public classbase
00051 {
00054         std::map<std::string,char*> Extension_Items;
00055         
00056 public:
00057 
00069         bool Extend(std::string key, char* p);
00070 
00080         bool Shrink(std::string key);
00081         
00088         char* GetExt(std::string key);
00089 };
00090 
00091 const int bitfields[]           =       {1,2,4,8,16,32,64,128};
00092 const int inverted_bitfields[]  =       {~1,~2,~4,~8,~16,~32,~64,~128};
00093 
00098 class BoolSet
00099 {
00100         char bits;
00101 
00102  public:
00103 
00106         BoolSet();
00107 
00110         BoolSet(char bitmask);
00111 
00116         void Set(int number);
00117 
00124         bool Get(int number);
00125 
00130         void Unset(int number);
00131 
00136         void Invert(int number);
00137 
00140         bool operator==(BoolSet other);
00141 
00144         BoolSet operator|(BoolSet other);
00145         
00148         BoolSet operator&(BoolSet other);
00149 
00152         bool operator=(BoolSet other);
00153 };
00154 
00155 
00156 #endif
00157 

Generated on Mon May 30 05:15:18 2005 for InspIRCd by doxygen 1.3.3