Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
38eba2d7
Commit
38eba2d7
authored
Dec 29, 2018
by
thomas.forbriger
Browse files
libtsxx [WP][FEATURE]: add TimeSeriesCollection::are_consistent
parent
7e9efec9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/libtsxx/tscollection.h
View file @
38eba2d7
...
...
@@ -68,9 +68,40 @@ namespace ts {
typedef
ts
::
TimeSeries
<
typename
Tseries
::
Tcoc
,
Theader
>
Tconsttimeseries
;
typedef
std
::
list
<
Ttimeseries
>
Tbase
;
//!@}
/*! \brief Check consistency
*
* Check the consistency of the time series in the collections based on
* header data. For example this can be used to check whether all time
* series have the same number of samples.
*
* \param comparer defines the header fields to be compared
* \return true, if comparer returns true for comparison of all pairs
* of time series headers in the collection
*/
bool
are_consistent
(
const
::
sff
::
WID2compare
comparer
)
const
;
};
// class TimeSeriesCollection
/* ---------------------------------------------------------------------- */
template
<
typename
T
>
bool
TimeSeriesCollection
<
T
>::
are_consistent
(
const
::
sff
::
WID2compare
comparer
)
const
{
bool
retval
=
true
;
if
(
this
->
size
()
>
1
)
{
Tbase
::
const_iterator
i_series
=
this
->
begin
();
Theader
refheader
=
i_series
->
header
;
++
i_series
;
while
((
i_series
!=
this
->
end
())
&&
retval
)
{
retval
=
comparer
(
refheader
;
i_series
->
header
);
}
}
return
(
retval
);
}
// bool TimeSeriesCollection<T>::are_consistent(const ::sff::WID2compare comparer) const
}
// namespace ts
#endif // TS_TSCOLLECTION_H_VERSION (includeguard)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment