diff --git a/software/src/config.h b/software/src/config.h index b529f1b39..44bd14dae 100644 --- a/software/src/config.h +++ b/software/src/config.h @@ -555,17 +555,17 @@ struct Config { class Wrap { public: - Wrap(Config *_conf); + inline Wrap(Config *_conf) {conf = _conf;} - Config *operator->(); + inline Config *operator->() {return conf;} - explicit operator Config*(); + inline explicit operator Config*() {return conf;} // Allowing to call begin and end directly on // the wrapper makes it easier to use // range-based for loops. - std::vector::iterator begin(); - std::vector::iterator end(); + inline std::vector::iterator begin() {return conf->begin();} + inline std::vector::iterator end() {return conf->end(); } private: Config *conf; @@ -575,14 +575,14 @@ struct Config { class ConstWrap { public: - ConstWrap(const Config *_conf); + inline ConstWrap(const Config *_conf) {conf = _conf;} - const Config *operator->() const; + inline const Config *operator->() const {return conf;} - explicit operator const Config*() const; + inline explicit operator const Config*() const {return conf;} - std::vector::const_iterator begin() const; - std::vector::const_iterator end() const; + inline std::vector::const_iterator begin() const {return conf->begin();} + inline std::vector::const_iterator end() const {return conf->end(); } private: const Config *conf; diff --git a/software/src/config/wrap.cpp b/software/src/config/wrap.cpp deleted file mode 100644 index d522de318..000000000 --- a/software/src/config/wrap.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* esp32-firmware - * Copyright (C) 2020-2024 Erik Fleckstein - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "config/private.h" - -Config::Wrap::Wrap(Config *_conf) -{ - conf = _conf; -} - -Config * Config::Wrap::operator->() { - return conf; -} - -Config::Wrap::operator Config*(){return conf;} - -std::vector::iterator Config::Wrap::begin() {return conf->begin();} -std::vector::iterator Config::Wrap::end() {return conf->end();} - -Config::ConstWrap::ConstWrap(const Config *_conf) -{ - conf = _conf; -} - -const Config * Config::ConstWrap::operator->() const { - return conf; -} - -Config::ConstWrap::operator const Config*() const {return conf;} - -std::vector::const_iterator Config::ConstWrap::begin() const {return conf->begin();} -std::vector::const_iterator Config::ConstWrap::end() const {return conf->end();}