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