summaryrefslogtreecommitdiff
path: root/src/base.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-30 21:55:21 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-30 21:55:21 +0000
commit3dc81ee1331d1b37ee85be9bf0d843e3b6827a2d (patch)
tree431e66fceef85d577d360865b3b878dc9132afc2 /src/base.cpp
parent7aa5e059a8f66d91bd8b69c58c657ceb70b4baff (diff)
Add explicit reference-counting base class
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11785 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/base.cpp')
-rw-r--r--src/base.cpp51
1 files changed, 6 insertions, 45 deletions
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)