Refactoring

* Rewriting Timeline<T> to be sparse, i.e., allow gaps
* Added specialized subclasses BoundedTimeline<T> and ContinuousTimeline<T>
* Timed<T> and TimeRange: has-a, not is-a
* Introducing Timed<void>
This commit is contained in:
Daniel Wolf
2016-05-02 20:31:59 +02:00
parent 9eef09145e
commit 2f31c5aa61
23 changed files with 784 additions and 243 deletions

View File

@@ -10,8 +10,8 @@
#include "ProgressBar.h"
#include "logging.h"
#include <gsl_util.h>
#include "Timeline.h"
#include "Exporter.h"
#include "ContinuousTimeline.h"
using std::exception;
using std::string;
@@ -113,7 +113,7 @@ int main(int argc, char *argv[]) {
const int columnWidth = 30;
std::cerr << std::left;
std::cerr << std::setw(columnWidth) << "Analyzing input file";
Timeline<Phone> phones{};
BoundedTimeline<Phone> phones(TimeRange::zero());
{
ProgressBar progressBar;
phones = detectPhones(
@@ -125,7 +125,7 @@ int main(int argc, char *argv[]) {
// Generate mouth shapes
std::cerr << std::setw(columnWidth) << "Generating mouth shapes";
Timeline<Shape> shapes = animate(phones);
ContinuousTimeline<Shape> shapes = animate(phones);
std::cerr << "Done" << std::endl;
std::cerr << std::endl;