SourceXtractorPlusPlus
1.0.3
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
std::atomic
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::SourceInterface::setProperty
void setProperty(Args... args)
Definition
SourceInterface.h:72
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition
SourceInterface.h:57
SourceXtractor::SourceTask
A Task that acts on a Source to compute one or more properties.
Definition
SourceTask.h:36
SourceXtractor
Definition
Aperture.h:30
Generated by
1.14.0