38 #define TF_FNGAPS_CC_VERSION \ 42 #include <tfxx/misc.h> 48 const libtime::TAbsoluteTime& latest,
52 TFXX_debug(debug,
"gaps()",
"received values: " <<
53 TFXX_value(earliest.timestring()));
54 TFXX_debug(debug,
"gaps()",
"received values: " <<
55 TFXX_value(latest.timestring()));
70 libtime::TAbsoluteTime lastexisting=earliest;
71 for (TContiguouslist::const_iterator I=cl.begin(); I!=cl.end(); ++I)
74 TFXX_debug(debug,
"gaps()",
"current gap ID: " << TFXX_value(*I));
76 bool firstofstream=
false;
81 TFXX_debug(debug,
"gaps()",
"first of all streams");
85 if (stream[istream].ID!=currentid)
87 TFXX_debug(debug,
"gaps()",
"first of all in this stream");
97 stream.push_back(newgaps);
98 istream=stream.size()-1;
99 lastexisting=earliest-currentid.
dt;
100 TFXX_debug(debug,
"gaps()",
"initialized new stream");
103 TFXX_debug(debug,
"gaps()",
104 TFXX_value(lastexisting.timestring()));
109 newgap.
first=lastexisting+currentid.
dt;
110 newgap.
last=I->first-currentid.
dt;
111 TFXX_debug(debug,
"gaps()",
"new gap (not yet adjusted): " 112 << TFXX_value(newgap));
114 if (!(firstofstream && newgap.
isbreak()))
116 stream[istream].gap.push_back(newgap);
117 TFXX_debug(debug,
"gaps()",
"pushed back gap of finite size " 118 << TFXX_value(newgap));
122 bool lastofstream=
false;
123 TContiguouslist::const_iterator J=I;
132 if (nextid!=currentid) { lastofstream=
true; }
136 newgap.
first=I->last+currentid.
dt;
140 stream[istream].gap.push_back(newgap);
141 TFXX_debug(debug,
"gaps()",
"pushed back gap of finite size " 142 << TFXX_value(newgap));
145 lastexisting=I->last;;
147 TFXX_debug(debug,
"gaps()",
"finished...");
Tvecofgaps gaps(const libtime::TAbsoluteTime &earliest, const libtime::TAbsoluteTime &latest, const TContiguouslist &cl, const bool &debug)
struct to hold gaps of one stream
libtime::TAbsoluteTime first
libtime::TAbsoluteTime last
std::list< Contiguous > TContiguouslist
A list to store information on all sequences of contiguous data.
libtime::TRelativeTime dt
std::vector< Gapsofstream > Tvecofgaps
vector to hold all gaps
function prototypes used in gap analysis (prototypes)