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 00095 class BoolSet 00096 { 00097 char bits; 00098 00099 public: 00100 00103 BoolSet(); 00104 00107 BoolSet(char bitmask); 00108 00113 void Set(int number); 00114 00121 bool Get(int number); 00122 00127 void Unset(int number); 00128 00133 void Invert(int number); 00134 00137 bool operator==(BoolSet other); 00138 00141 BoolSet operator|(BoolSet other); 00142 00145 BoolSet operator&(BoolSet other); 00146 00149 bool operator=(BoolSet other); 00150 }; 00151 00152 00153 #endif 00154