From 3dc81ee1331d1b37ee85be9bf0d843e3b6827a2d Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 30 Sep 2009 21:55:21 +0000 Subject: Add explicit reference-counting base class git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11785 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/base.cpp | 51 ++++++--------------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) (limited to 'src/base.cpp') diff --git a/src/base.cpp b/src/base.cpp index 76e469482..930792854 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -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) -- cgit v1.2.3