Alexandria
2.31.4
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Configuration
Configuration
_impl
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
21
22
#include "
Configuration/ConfigManager.h
"
23
24
namespace
Euclid
{
25
namespace
Configuration
{
26
27
template
<
typename
T>
28
void
Configuration::declareDependency
() {
29
auto
& manager =
ConfigManager::getInstance
(
m_manager_id
);
30
manager.registerConfiguration<T>();
31
m_dependencies
.emplace(
typeid
(T));
32
}
33
34
template
<
typename
T>
35
T&
Configuration::getDependency
() {
36
auto
& manager =
ConfigManager::getInstance
(
m_manager_id
);
37
return
manager.getConfiguration<T>();
38
}
39
40
template
<
typename
T>
41
const
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
ConfigManager.h
Euclid::Configuration::ConfigManager::getInstance
static ConfigManager & getInstance(long id)
Returns a reference to the ConfigManager with the given ID.
Definition
ConfigManager.cpp:38
Euclid::Configuration::Configuration::declareDependency
void declareDependency()
Declares a Configuration as dependency.
Definition
Configuration.icpp:28
Euclid::Configuration::Configuration::m_dependencies
std::set< std::type_index > m_dependencies
Definition
Configuration.h:174
Euclid::Configuration::Configuration::getDependency
T & getDependency()
Returns a dependency.
Definition
Configuration.icpp:35
Euclid::Configuration::Configuration::m_manager_id
long m_manager_id
Definition
Configuration.h:173
Euclid::Configuration
Definition
ConfigManager.icpp:26
Euclid
Definition
InstOrRefHolder.icpp:27
Generated by
1.14.0