SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceIDsPlugin.h
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
32/*
33 * SourceIDsPlugin.h
34 *
35 * Created on: Apr 27, 2018
36 * Author: mkuemmel@usm.lmu.de
37 */
38
39#ifndef __SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDSPLUGIN_H_
40#define __SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDSPLUGIN_H_
41
44
45namespace SourceXtractor {
46class SourceIDsPlugin : public Plugin {
47public:
48
52 virtual ~SourceIDsPlugin() = default;
53
55 plugin_api.getTaskFactoryRegistry().registerTaskFactory<SourceIDTaskFactory, SourceID>();
56
57 //TODO: "unsigned int" seems not to work as column
58 plugin_api.getOutputRegistry().registerColumnConverter<SourceID, int>(
59 "source_id",
60 [](const SourceID& prop){
61 return prop.getId();
62 },
63 "",
64 "Running object number"
65 );
66 plugin_api.getOutputRegistry().registerColumnConverter<SourceID, int>(
67 "detection_id",
68 [](const SourceID& prop){
69 return prop.getDetectionId();
70 },
71 "",
72 "Running detection number"
73 );
74 plugin_api.getOutputRegistry().enableOutput<SourceID>("SourceIDs");
75 }
76
77 virtual std::string getIdString() const {
78 return "source_IDs_plugin";
79 }
80private:
81};
82} /* namespace SourceXtractor */
83#endif /* __SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDSPLUGIN_H_ */
This interface is given to the plugin to let it access object instances from the framework.
Definition PluginAPI.h:40
Plugins must implement this interface.
Definition Plugin.h:38
virtual ~SourceIDsPlugin()=default
Destructor.
virtual std::string getIdString() const
virtual void registerPlugin(PluginAPI &plugin_api)