Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Configuration.icpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012-2021 Euclid Science Ground Segment
3 *
4 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
5 * Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option)
6 * any later version.
7 *
8 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
9 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
10 * details.
11 *
12 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
13 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14 */
15
16/**
17 * @file Configuration/_impl/Configuration.icpp
18 * @date 11/05/15
19 * @author nikoapos
20 */
21
22#include "Configuration/ConfigManager.h"
23
24namespace Euclid {
25namespace Configuration {
26
27template <typename T>
28void Configuration::declareDependency() {
29 auto& manager = ConfigManager::getInstance(m_manager_id);
30 manager.registerConfiguration<T>();
31 m_dependencies.emplace(typeid(T));
32}
33
34template <typename T>
35T& Configuration::getDependency() {
36 auto& manager = ConfigManager::getInstance(m_manager_id);
37 return manager.getConfiguration<T>();
38}
39
40template <typename T>
41const T& Configuration::getDependency() const {
42 auto& manager = ConfigManager::getInstance(m_manager_id);
43 return manager.getConfiguration<T>();
44}
45
46} // namespace Configuration
47} // namespace Euclid