chromium/media/base/ranges.h

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_BASE_RANGES_H_
#define MEDIA_BASE_RANGES_H_

#include <stddef.h>
#include <stdint.h>

#include <algorithm>
#include <ostream>
#include <vector>

#include "base/check_op.h"
#include "base/time/time.h"
#include "media/base/media_export.h"

namespace media {

// Ranges allows holding an ordered list of ranges of [start,end) intervals.
// The canonical example use-case is holding the list of ranges of buffered
// bytes or times in a <video> tag.
template <class T>  // Endpoint type; typically a base::TimeDelta or an int64_t.
class Ranges {};

//////////////////////////////////////////////////////////////////////
// EVERYTHING BELOW HERE IS IMPLEMENTATION DETAIL!!
//////////////////////////////////////////////////////////////////////

template<class T>
size_t Ranges<T>::Add(T start, T end) {}

template<>
MEDIA_EXPORT void
    Ranges<base::TimeDelta>::DCheckLT(const base::TimeDelta& lhs,
                                      const base::TimeDelta& rhs) const;

template<class T>
void Ranges<T>::DCheckLT(const T& lhs, const T& rhs) const {}

template<class T>
size_t Ranges<T>::size() const {}

template<class T>
T Ranges<T>::start(size_t i) const {}

template<class T>
T Ranges<T>::end(size_t i) const {}

template <class T>
const std::pair<T, T>& Ranges<T>::back() const {}

template <class T>
bool Ranges<T>::contains(size_t i, const T& entry) const {}

template <class T>
bool Ranges<T>::empty() const {}

template<class T>
void Ranges<T>::clear() {}

template<class T>
Ranges<T> Ranges<T>::IntersectionWith(const Ranges<T>& other) const {}

}  // namespace media

#endif  // MEDIA_BASE_RANGES_H_