]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/hashcomp.h
Fix this so it works, passes test case. Provide a method to query for a bit and to...
[user/henk/code/inspircd.git] / include / hashcomp.h
index 11a491d623aa8cb359d994e5fb6345b39f81182f..73d9f53f245ee175f9e8385f3bb34322207e9179 100644 (file)
@@ -358,6 +358,30 @@ namespace irc
                long GetToken();
        };
 
+       typedef std::pair<size_t, unsigned char> bitfield;
+
+       class dynamicbitmask : public classbase
+       {
+        private:
+               unsigned char* bits;
+               unsigned char* freebits;
+               size_t bits_size;
+        public:
+               dynamicbitmask();
+
+               ~dynamicbitmask();
+
+               bitfield Allocate();
+
+               bool Deallocate(bitfield &pos);
+
+               void Toggle(bitfield &pos, bool state);
+
+               bool Get(bitfield &pos);
+
+               size_t GetSize();
+       };
+
        /** The irc_char_traits class is used for RFC-style comparison of strings.
         * This class is used to implement irc::string, a case-insensitive, RFC-
         * comparing string class.