Debian Codegraph @

src/internal/module-impl.h

raw symbols SCIP
1 /*
2 * %injeqt copyright begin%
3 * Copyright 2014 Rafał Malinowski ([email protected])
4 * %injeqt copyright end%
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #pragma once
22
23 #include <injeqt/injeqt.h>
24 #include <injeqt/type.h>
25
26 #include "provider-configuration.h"
27
28 #include <memory>
29
30 /**
31 * @file
32 * @brief Contains classes and functions for implementation of modules.
33 */
34
35 namespace injeqt { namespace internal {
36
37 /**
38 * @brief Implementation of module class.
39 * @see module class
40 *
41 * Main job of this class is to create providers and keep list of pointers to them. All providers
42 * are created using add_ready_object(type, QObject *), add_type(type) and add_factory(type, type) methods.
43 *
44 * List can be retreived using providers() method. Injector that takes the module gets all providers from
45 * that list and move it to itself.
46 */
47 class INJEQT_API module_impl final
48 {
49
50 public:
51 const std::vector<std::shared_ptr<provider_configuration>> & provider_configurations();
52
53 /**
54 * @brief Add provider to list
55 * @param p provider to add
56 * @pre p must be valid
57 */
58 void add_provider_configuration(std::shared_ptr<provider_configuration> p);
59
60 private:
61 std::vector<std::shared_ptr<provider_configuration>> _provider_configurations;
62
63 };
64
65 }}