diff options
Diffstat (limited to 'src/base.cpp')
-rw-r--r-- | src/base.cpp | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/base.cpp b/src/base.cpp index 27fecf69c..d19e78a47 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -1,17 +1,47 @@ /* + * Anope IRC Services * - * (C) 2003-2017 Anope Team - * Contact us at team@anope.org + * Copyright (C) 2010-2017 Anope Team <team@anope.org> * - * Please read COPYING and README for further details. + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. */ #include "services.h" #include "anope.h" #include "service.h" +#include "base.h" + +std::set<ReferenceBase *> *ReferenceBase::references = NULL; + +ReferenceBase::ReferenceBase() +{ + if (references == NULL) + references = new std::set<ReferenceBase *>(); + references->insert(this); +} -std::map<Anope::string, std::map<Anope::string, Service *> > Service::Services; -std::map<Anope::string, std::map<Anope::string, Anope::string> > Service::Aliases; +ReferenceBase::~ReferenceBase() +{ + references->erase(this); +} + +void ReferenceBase::ResetAll() +{ + if (references) + for (ReferenceBase *b : *references) + b->Reset(); +} Base::Base() : references(NULL) { |