SourceXtractorPlusPlus
0.10
Please provide a description of the project.
SEImplementation
src
lib
Plugin
SourceFlags
SourceFlagsTaskFactory.cpp
Go to the documentation of this file.
1
17
/*
18
* Copyright (C) 2012-2020 Euclid Science Ground Segment
19
*
20
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
21
* Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option)
22
* any later version.
23
*
24
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
25
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
26
* details.
27
*
28
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
29
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30
*/
31
39
#include "
SEImplementation/Configuration/MeasurementImageConfig.h
"
40
#include "
SEImplementation/Plugin/SourceFlags/SourceFlagsTaskFactory.h
"
41
#include "
SEImplementation/Plugin/SourceFlags/SourceFlagsSourceTask.h
"
42
43
namespace
SourceXtractor
{
44
45
void
SourceFlagsTaskFactory::reportConfigDependencies
(
Euclid::Configuration::ConfigManager
& manager)
const
{
46
manager.
registerConfiguration
<
MeasurementImageConfig
>();
47
}
48
49
void
SourceFlagsTaskFactory::configure
(
Euclid::Configuration::ConfigManager
&manager) {
50
const
auto
& image_infos = manager.
getConfiguration
<
MeasurementImageConfig
>().getImageInfos();
51
52
for
(
unsigned
i = 0; i < image_infos.size(); ++i) {
53
m_instances_per_group
[
"global"
].emplace_back(image_infos[i].m_id);
54
}
55
}
56
57
std::shared_ptr<Task>
SourceFlagsTaskFactory::createTask
(
const
PropertyId
&property_id)
const
{
58
if
(property_id == PropertyId::create<SourceFlags>()) {
59
return
std::make_shared<SourceFlagsSourceTask>(
m_instances_per_group
);
60
}
else
{
61
return
nullptr
;
62
}
63
}
64
65
}
// end SourceXtractor
std::shared_ptr
STL class.
MeasurementImageConfig.h
SourceXtractor::MeasurementImageConfig
Definition:
MeasurementImageConfig.h:37
Euclid::Configuration::ConfigManager::registerConfiguration
void registerConfiguration()
SourceFlagsTaskFactory.h
SourceXtractor
Definition:
Aperture.h:30
Euclid::Configuration::ConfigManager::getConfiguration
T & getConfiguration()
Euclid::Configuration::ConfigManager
SourceFlagsSourceTask.h
SourceXtractor::PropertyId
Identifier used to set and retrieve properties.
Definition:
PropertyId.h:40
SourceXtractor::SourceFlagsTaskFactory::m_instances_per_group
std::map< std::string, std::vector< unsigned int > > m_instances_per_group
Definition:
SourceFlagsTaskFactory.h:58
SourceXtractor::SourceFlagsTaskFactory::createTask
virtual std::shared_ptr< Task > createTask(const PropertyId &property_id) const override
Returns a Task producing a Property corresponding to the given PropertyId.
Definition:
SourceFlagsTaskFactory.cpp:57
SourceXtractor::SourceFlagsTaskFactory::configure
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
Definition:
SourceFlagsTaskFactory.cpp:49
SourceXtractor::SourceFlagsTaskFactory::reportConfigDependencies
void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
Definition:
SourceFlagsTaskFactory.cpp:45
Generated by
1.8.15