diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-12 23:40:23 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-12 23:40:23 +0000 |
| commit | acca8cb950de132fbc4be40e7dc7d294c6cb0a38 (patch) | |
| tree | a2c02828be116a0bf1b43823f05ffa1d496548a5 /src | |
| parent | 582177192cceb54e980f923102e56cce69e311aa (diff) | |
More operators; some missing header installs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/time_pair.cc | 30 | ||||
| -rw-r--r-- | src/time_pair.h | 4 | ||||
| -rw-r--r-- | src/wscript | 2 |
3 files changed, 36 insertions, 0 deletions
diff --git a/src/time_pair.cc b/src/time_pair.cc index b625aca..9bad713 100644 --- a/src/time_pair.cc +++ b/src/time_pair.cc @@ -81,6 +81,36 @@ TimePair::operator== (TimePair const & other) const return false; } +bool +TimePair::operator< (TimePair const & other) const +{ + if (_metric && other._metric) { + return _metric.get() < other._metric.get(); + } else if (_frame && other._frame) { + return _frame.get() < other._frame.get(); + } + + assert (false); +} + +bool +TimePair::operator<= (TimePair const & other) const +{ + return (*this == other || *this < other); +} + +bool +TimePair::operator> (TimePair const & other) const +{ + return (!(*this <= other)); +} + +bool +TimePair::operator>= (TimePair const & other) const +{ + return !(*this < other); +} + ostream & sub::operator<< (ostream& s, TimePair const & t) { diff --git a/src/time_pair.h b/src/time_pair.h index 6265480..f06edda 100644 --- a/src/time_pair.h +++ b/src/time_pair.h @@ -71,6 +71,10 @@ public: void scale (float f, float fps); bool operator== (TimePair const & other) const; + bool operator< (TimePair const & other) const; + bool operator<= (TimePair const & other) const; + bool operator> (TimePair const & other) const; + bool operator>= (TimePair const & other) const; private: boost::optional<FrameTime> _frame; diff --git a/src/wscript b/src/wscript index 13a6278..acb9bd6 100644 --- a/src/wscript +++ b/src/wscript @@ -52,6 +52,8 @@ def build(bld): metric_time.h raw_subtitle.h reader.h + reader_factory.h + smpte_dcp_reader.h stl_binary_tables.h stl_binary_writer.h stl_text_reader.h |
