4 #include <HeliosException.h>
8 #include <unordered_map>
28 static std::string
const NULL_STRIP_ID;
40 std::unordered_map<int, Leg*>
legs;
61 inline bool has(
int const serialId){
62 return legs.find(serialId) !=
legs.end();
77 legs.emplace(serialId, leg);
91 ss <<
"ScanningStrip::safeEmplace will not emplace leg "
92 << serialId <<
" because a leg with same identifier "
93 <<
"already belongs to the strip";
124 return has(serialId) ?
legs[serialId] :
nullptr;
134 for (
const auto & it :
legs)
135 if (!it.second->wasProcessed)
Base class for Helios exceptions.
Definition: HeliosException.h:12
Class representing a survey leg.
Definition: Leg.h:17
int getSerialId() const
Obtain the serial identifier of the leg.
Definition: Leg.h:124
A scanning strip is a set of legs which belong to the same strip. Thus, it is an abstract group of le...
Definition: ScanningStrip.h:24
bool has(Leg &leg)
Check whether given leg belongs to the strip or not.
Definition: ScanningStrip.h:70
void emplace(int const serialId, Leg *leg)
Insert/emplace given leg into the scanning strip.
Definition: ScanningStrip.h:76
void setStripId(std::string const stripId)
Set the new strip identifier.
Definition: ScanningStrip.h:115
void safeEmplace(Leg *leg)
Definition: ScanningStrip.h:101
void safeEmplace(int const serialId, Leg *leg)
Like ScanningStrip::emplace(int const, Leg *) but with security checks.
Definition: ScanningStrip.h:88
std::string stripId
String identifying the scanning strip.
Definition: ScanningStrip.h:35
bool isLastLegInStrip() const
Checks if all the legs in the strip were processed in order to know if the associated SyncFileWriter ...
Definition: ScanningStrip.h:132
std::unordered_map< int, Leg * > legs
Map with leg serial id as key and pointer to leg as value.
Definition: ScanningStrip.h:40
ScanningStrip(std::string const stripId=NULL_STRIP_ID)
Default constructor for scanning strip.
Definition: ScanningStrip.h:48
bool has(int const serialId)
Check whether given serial id belongs to the strip or not.
Definition: ScanningStrip.h:61
Leg * getLeg(int const serialId)
Obtain leg with given serial identifier.
Definition: ScanningStrip.h:123
std::string getStripId() const
Obtain the strip identifier.
Definition: ScanningStrip.h:110
void emplace(Leg *leg)
Definition: ScanningStrip.h:82