SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
SEImplementation
Plugin
SourceIDs
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
27
#include "
SEFramework/Task/SourceTask.h
"
28
#include "
SEImplementation/Property/SourceId.h
"
29
#include "
SEImplementation/Plugin/SourceIDs/SourceID.h
"
30
31
#include <atomic>
32
#include <cstdint>
33
34
namespace
SourceXtractor
{
35
36
class
SourceIDTask
:
public
SourceTask
{
37
38
public
:
39
virtual
~SourceIDTask
() =
default
;
40
41
SourceIDTask
() {}
42
43
void
computeProperties
(
SourceInterface
&
source
)
const override
{
44
auto
detection_id
=
source
.getProperty<
SourceId
>().getDetectionId();
45
source
.setProperty<
SourceID
>(
getNewId
(),
detection_id
);
46
}
47
48
private
:
49
static
unsigned
int
getNewId
() {
50
static
std::atomic<std::uint32_t>
s_id
(1);
51
return
s_id
++;
52
}
53
54
};
55
56
}
/* namespace SourceXtractor */
57
58
#endif
/* _SEIMPLEMENTATION_PLUGIN_SOURCEIDS_SOURCEIDTASK_H_ */
SourceID.h
SourceId.h
SourceTask.h
SourceXtractor::SourceIDTask
Definition
SourceIDTask.h:36
SourceXtractor::SourceIDTask::SourceIDTask
SourceIDTask()
Definition
SourceIDTask.h:41
SourceXtractor::SourceIDTask::~SourceIDTask
virtual ~SourceIDTask()=default
SourceXtractor::SourceIDTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition
SourceIDTask.h:43
SourceXtractor::SourceIDTask::getNewId
static unsigned int getNewId()
Definition
SourceIDTask.h:49
SourceXtractor::SourceID
Definition
SourceID.h:33
SourceXtractor::SourceId
Definition
SourceId.h:32
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
SourceXtractor::SourceTask
A Task that acts on a Source to compute one or more properties.
Definition
SourceTask.h:36
std::function
SourceXtractor
Definition
Aperture.h:30
Generated by
1.10.0