Alexandria  2.19
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
23 
24 namespace Euclid {
25 namespace Configuration {
26 
27 template <typename T>
28 void Configuration::declareDependency() {
30  manager.registerConfiguration<T>();
31  m_dependencies.emplace(typeid(T));
32 }
33 
34 template <typename T>
35 T& Configuration::getDependency() {
37  return manager.getConfiguration<T>();
38 }
39 
40 template <typename T>
41 const T& Configuration::getDependency() const {
43  return manager.getConfiguration<T>();
44 }
45 
46 } // namespace Configuration
47 } // namespace Euclid
static ConfigManager & getInstance(long id)
Returns a reference to the ConfigManager with the given ID.
std::set< std::type_index > m_dependencies
T emplace(T...args)