SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceIDTask.h
Go to the documentation of this file.
1
17/*
18 * SourceIDTask.h
19 *
20 * Created on: May 30, 2018
21 * Author: mschefer
22 */
23
24#ifndef _SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDTASK_H_
25#define _SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDTASK_H_
26
30
31#include <atomic>
32#include <cstdint>
33
34namespace SourceXtractor {
35
36class SourceIDTask : public SourceTask {
37
38public:
39 virtual ~SourceIDTask() = default;
40
42
44 auto detection_id = source.getProperty<SourceId>().getDetectionId();
45 source.setProperty<SourceID>(getNewId(), detection_id);
46 }
47
48private:
49 static unsigned int getNewId() {
51 return s_id++;
52 }
53
54};
55
56} /* namespace SourceXtractor */
57
58#endif /* _SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDTASK_H_ */
virtual ~SourceIDTask()=default
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
static unsigned int getNewId()
The SourceInterface is an abstract "source" that has properties attached to it.
A Task that acts on a Source to compute one or more properties.
Definition SourceTask.h:36