]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/base.cpp
Add explicit reference-counting base class
[user/henk/code/inspircd.git] / src / base.cpp
index 76e469482d56759798f86860b02653691d9a2d32..9307928540639b721cda966221dac65cdd06cb27 100644 (file)
@@ -26,65 +26,26 @@ classbase::classbase()
 {
 }
 
-void classbase::cull()
+bool classbase::cull()
 {
+       return true;
 }
 
 classbase::~classbase()
 {
 }
 
-void BoolSet::Set(int number)
-{
-       this->bits |= bitfields[number];
-}
-
-void BoolSet::Unset(int number)
-{
-       this->bits &= inverted_bitfields[number];
-}
-
-void BoolSet::Invert(int number)
-{
-       this->bits ^= bitfields[number];
-}
-
-bool BoolSet::Get(int number)
+refcountbase::refcountbase() : refcount(0)
 {
-       return ((this->bits | bitfields[number]) > 0);
 }
 
-bool BoolSet::operator==(BoolSet other)
+bool refcountbase::cull()
 {
-       return (this->bits == other.bits);
+       return (refcount == 0);
 }
 
-BoolSet BoolSet::operator|(BoolSet other)
+refcountbase::~refcountbase()
 {
-       BoolSet x(this->bits | other.bits);
-       return x;
-}
-
-BoolSet BoolSet::operator&(BoolSet other)
-{
-       BoolSet x(this->bits & other.bits);
-       return x;
-}
-
-BoolSet::BoolSet()
-{
-       this->bits = 0;
-}
-
-BoolSet::BoolSet(char bitmask)
-{
-       this->bits = bitmask;
-}
-
-bool BoolSet::operator=(BoolSet other)
-{
-       this->bits = other.bits;
-       return true;
 }
 
 ExtensionItem::ExtensionItem(const std::string& Key, Module* mod) : key(Key), owner(mod)