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
a84ad444
Commit
a84ad444
authored
Dec 29, 2018
by
thomas.forbriger
Browse files
Merge branch 'tscollect' into croposp
parents
91e80cf6
38eba2d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/libtsxx/tscollection.h
View file @
a84ad444
...
...
@@ -39,21 +39,26 @@
#define TS_TSCOLLECTION_H_VERSION \
"TS_TSCOLLECTION_H V1.0"
#include
<
list
>
#include
<
vector
>
#include
<tsxx/wid2timeseries.h>
namespace
ts
{
/*! \brief A class template for a list of time series with SFF header.
*
* A TimeSeriesCollection is a vector of ts::TimeSeries with some additional
* member functions.
*
* \param T value type of series container
*/
template
<
typename
T
>
class
TimeSeriesCollection
:
public
std
::
list
<
TimeSeries
<
aff
::
Series
<
T
>
,
::
sff
::
WID2
>
>
public
std
::
vector
<
TimeSeries
<
aff
::
Series
<
T
>
,
::
sff
::
WID2
>
>
{
public:
/*! \name Type definitions.
*
* Provided to define proper base types of class template
*/
//!@{
typedef
T
Tvalue
;
...
...
@@ -63,17 +68,40 @@ namespace ts {
typedef
ts
::
TimeSeries
<
typename
Tseries
::
Tcoc
,
Theader
>
Tconsttimeseries
;
typedef
std
::
list
<
Ttimeseries
>
Tbase
;
//!@}
/*! \
name Constructors.
/*! \
brief Check consistency
*
* Conversion constructors are declared explicit, to avoid confusion,
* in mutual assignments of different class derived from this
* template. They all are a valid Tseries by definition.
* 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
Supports
Markdown
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