SourceXtractorPlusPlus
0.15
Please provide a description of the project.
SEImplementation
SEImplementation
Property
SourceId.h
Go to the documentation of this file.
1
17
/*
18
* SourceId.h
19
*
20
* Created on: Apr 26, 2017
21
* Author: mschefer
22
*/
23
24
#ifndef _SEIMPLEMENTATION_PROPERTY_SOURCEID_H_
25
#define _SEIMPLEMENTATION_PROPERTY_SOURCEID_H_
26
27
#include "
SEFramework/Property/Property.h
"
28
#include <atomic>
29
30
namespace
SourceXtractor
{
31
32
class
SourceId
:
public
Property
{
33
34
public
:
35
36
SourceId
(
unsigned
int
detection_id)
37
:
m_source_id
(
getNewId
()),
m_detection_id
(detection_id) {
38
}
39
40
SourceId
()
41
:
m_source_id
(
getNewId
()),
m_detection_id
(
m_source_id
) {
42
}
43
44
virtual
~SourceId
() =
default
;
45
46
unsigned
int
getSourceId
()
const
{
47
return
m_source_id
;
48
}
49
50
unsigned
int
getDetectionId
()
const
{
51
return
m_detection_id
;
52
}
53
54
private
:
55
unsigned
int
m_source_id
,
m_detection_id
;
56
57
static
unsigned
int
getNewId
() {
58
static
std::atomic<uint32_t>
s_id(1);
59
return
s_id++;
60
}
61
62
63
64
};
/* End of SourceId class */
65
66
}
67
68
69
#endif
/* _SEIMPLEMENTATION_PROPERTY_SOURCEID_H_ */
SourceXtractor::SourceId::SourceId
SourceId(unsigned int detection_id)
Definition:
SourceId.h:36
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition:
Property.h:33
SourceXtractor::SourceId::~SourceId
virtual ~SourceId()=default
SourceXtractor::SourceId::getDetectionId
unsigned int getDetectionId() const
Definition:
SourceId.h:50
SourceXtractor::SourceId
Definition:
SourceId.h:32
SourceXtractor
Definition:
Aperture.h:30
Property.h
SourceXtractor::SourceId::getNewId
static unsigned int getNewId()
Definition:
SourceId.h:57
std::atomic
STL class.
SourceXtractor::SourceId::SourceId
SourceId()
Definition:
SourceId.h:40
SourceXtractor::SourceId::getSourceId
unsigned int getSourceId() const
Definition:
SourceId.h:46
SourceXtractor::SourceId::m_detection_id
unsigned int m_detection_id
Definition:
SourceId.h:55
SourceXtractor::SourceId::m_source_id
unsigned int m_source_id
Definition:
SourceId.h:55
Generated by
1.8.20