TS++ library: time series library

◆ are_consistent()

template<typename T >
bool ts::TimeSeriesCollection< T >::are_consistent ( const ::sff::WID2compare  comparer) const

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.

Parameters
comparerdefines the header fields to be compared
Returns
true, if comparer returns true for comparison of all pairs of time series headers in the collection

Definition at line 99 of file tscollection.h.

100  {
101  bool retval=true;
102  if (this->size() > 1)
103  {
104  typename Tbase::const_iterator i_series=this->begin();
105  Theader refheader=i_series->header;
106  ++i_series;
107  while ((i_series != this->end()) && retval)
108  {
109  retval=comparer(refheader, i_series->header);
110  ++i_series;
111  }
112  }
113  return(retval);
114  } // bool TimeSeriesCollection<T>::are_consistent(const ::sff::WID2compare comparer) const