SourceXtractorPlusPlus
0.19
SourceXtractor++, the next generation SExtractor
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEImplementation
src
lib
Plugin
AssocMode
AssocModeTaskFactory.cpp
Go to the documentation of this file.
1
18
#include "
SEImplementation/Plugin/AssocMode/AssocModeTaskFactory.h
"
19
#include "
SEFramework/Property/PropertyId.h
"
20
#include "
SEFramework/Task/Task.h
"
21
#include "
SEImplementation/Plugin/AssocMode/AssocMode.h
"
22
#include "
SEImplementation/Plugin/AssocMode/AssocModeConfig.h
"
23
#include "
SEImplementation/Plugin/AssocMode/AssocModeTask.h
"
24
#include "
SEImplementation/Plugin/AssocMode/AssocModeDummyTask.h
"
25
#include <
NdArray/NdArray.h
>
26
#include <iostream>
27
#include <sstream>
28
29
namespace
SourceXtractor {
30
31
AssocModeTaskFactory::AssocModeTaskFactory
() : m_assoc_mode(
AssocModeConfig
::
AssocMode
::
UNKNOWN
), m_assoc_radius(0.) {}
32
33
void
AssocModeTaskFactory::reportConfigDependencies
(
Euclid::Configuration::ConfigManager
& manager)
const
{
34
manager.
registerConfiguration
<
AssocModeConfig
>();
35
}
36
37
void
AssocModeTaskFactory::configure
(
Euclid::Configuration::ConfigManager
& manager) {
38
auto
config = manager.
getConfiguration
<
AssocModeConfig
>();
39
40
m_catalogs
= config.getCatalogs();
41
m_assoc_radius
= config.getAssocRadius();
42
m_assoc_mode
= config.getAssocMode();
43
m_add_property_instances
= !config.getColumnsIdx().empty();
44
}
45
46
std::shared_ptr<Task>
AssocModeTaskFactory::createTask
(
const
PropertyId
& property_id)
const
{
47
if
(property_id.
getTypeId
() ==
typeid
(
AssocMode
)) {
48
if
(
m_catalogs
.empty()) {
49
return
std::make_shared<AssocModeDummyTask>();
50
}
else
{
51
return
std::make_shared<AssocModeTask>(
m_catalogs
,
m_assoc_mode
,
m_assoc_radius
);
52
}
53
}
else
{
54
return
nullptr
;
55
}
56
}
57
58
void
AssocModeTaskFactory::registerPropertyInstances
(
OutputRegistry
& registry) {
59
using
Euclid::NdArray::NdArray
;
60
61
if
(!
m_add_property_instances
) {
62
return
;
63
}
64
registry.
registerColumnConverter
<
AssocMode
,
NdArray<SeFloat>
>(
65
"assoc_values"
, [](
const
AssocMode
& prop) {
return
prop.getAssocValues(); },
""
,
"Assoc catalog values"
);
66
}
67
68
}
// namespace SourceXtractor
std::shared_ptr
SourceXtractor::AssocModeTaskFactory::configure
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
Definition:
AssocModeTaskFactory.cpp:37
NdArray
Euclid::NdArray::NdArray< T > NdArray
Definition:
GrowthCurvePlugin.cpp:26
ModuleType::UNKNOWN
SourceXtractor::OutputRegistry
Definition:
OutputRegistry.h:36
SourceXtractor::AssocModeConfig
Definition:
AssocModeConfig.h:31
AssocModeDummyTask.h
AssocModeTask.h
SourceXtractor::AssocModeTaskFactory::reportConfigDependencies
void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
Definition:
AssocModeTaskFactory.cpp:33
NdArray.h
SourceXtractor::AssocModeTaskFactory::m_catalogs
std::vector< std::vector< AssocModeConfig::CatalogEntry > > m_catalogs
Definition:
AssocModeTaskFactory.h:48
SourceXtractor::AssocModeTaskFactory::createTask
std::shared_ptr< Task > createTask(const PropertyId &property_id) const override
Returns a Task producing a Property corresponding to the given PropertyId.
Definition:
AssocModeTaskFactory.cpp:46
SourceXtractor::AssocModeTaskFactory::m_assoc_radius
double m_assoc_radius
Definition:
AssocModeTaskFactory.h:47
SourceXtractor::AssocModeTaskFactory::m_add_property_instances
bool m_add_property_instances
Definition:
AssocModeTaskFactory.h:49
Euclid::Configuration::ConfigManager::registerConfiguration
void registerConfiguration()
SourceXtractor::AssocModeTaskFactory::AssocModeTaskFactory
AssocModeTaskFactory()
Definition:
AssocModeTaskFactory.cpp:31
AssocModeTaskFactory.h
Euclid::Configuration::ConfigManager
PropertyId.h
SourceXtractor::AssocMode
Definition:
AssocMode.h:33
Euclid::Configuration::ConfigManager::getConfiguration
T & getConfiguration()
SourceXtractor::PropertyId
Identifier used to set and retrieve properties.
Definition:
PropertyId.h:40
SourceXtractor::PropertyId::getTypeId
std::type_index getTypeId() const
Definition:
PropertyId.h:66
SourceXtractor::NdArray
Euclid::NdArray::NdArray< T > NdArray
Definition:
VignetPlugin.h:37
Task.h
AssocMode.h
AssocModeConfig.h
SourceXtractor::AssocModeTaskFactory::registerPropertyInstances
void registerPropertyInstances(OutputRegistry ®istry) override
Definition:
AssocModeTaskFactory.cpp:58
SourceXtractor::AssocModeTaskFactory::m_assoc_mode
AssocModeConfig::AssocMode m_assoc_mode
Definition:
AssocModeTaskFactory.h:46
SourceXtractor::OutputRegistry::registerColumnConverter
void registerColumnConverter(std::string column_name, ColumnConverter< PropertyType, OutType > converter, std::string column_unit="", std::string column_description="")
Definition:
OutputRegistry.h:46
Generated by
1.8.5