/** * @file registrar.hpp * * @brief Settings plugin registration handler. * * @author Ossama Othman @ * * @copyright @par * Copyright 2013 Intel Corporation All Rights Reserved. * @par * 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; * version 2.1 of the License. * @par * 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. * @par * 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., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA */ #ifndef IVI_SETTINGS_REGISTRAR_HPP #define IVI_SETTINGS_REGISTRAR_HPP #include #include #include namespace ivi { namespace settings { class manager; class plugin; /** * @class registrar * * @brief Handles registration of settings plugins. * * Plugins will register themselves with the settings daemon * through an instance of this class. * * This class exists to avoid exposing the @c manager object * directly to plugins, as well as to address cyclic * dependencies. */ class SETTINGS_API registrar { public: /** * Constructor. * * @param[in] m Reference to the settings manager. */ registrar(manager & m); /** * Register settings plugin. * * @param[in] p Pointer to the settings plugin. * @return @c true on success. */ bool register_setting(std::unique_ptr p); private: /** * @name Prevent copying */ //@{ registrar(registrar const &) = delete; registrar & operator=(registrar const &) = delete; //@} private: /// The settings manager. manager & manager_; }; } } #endif /* IVI_SETTINGS_REGISTRAR_HPP */ // Local Variables: // mode:c++ // c-basic-offset:2 // indent-tabs-mode: nil // End: