Added timeline constructor overloads
This commit is contained in:
parent
6d67f77f62
commit
1e5a21dbfb
|
@ -29,6 +29,11 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename collection_type>
|
||||||
|
BoundedTimeline(TimeRange range, collection_type collection) :
|
||||||
|
BoundedTimeline(range, collection.begin(), collection.end())
|
||||||
|
{}
|
||||||
|
|
||||||
BoundedTimeline(TimeRange range, std::initializer_list<Timed<T>> initializerList) :
|
BoundedTimeline(TimeRange range, std::initializer_list<Timed<T>> initializerList) :
|
||||||
BoundedTimeline(range, initializerList.begin(), initializerList.end())
|
BoundedTimeline(range, initializerList.begin(), initializerList.end())
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -24,6 +24,11 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename collection_type>
|
||||||
|
ContinuousTimeline(TimeRange range, T defaultValue, collection_type collection) :
|
||||||
|
ContinuousTimeline(range, defaultValue, collection.begin(), collection.end())
|
||||||
|
{}
|
||||||
|
|
||||||
ContinuousTimeline(TimeRange range, T defaultValue, std::initializer_list<Timed<T>> initializerList) :
|
ContinuousTimeline(TimeRange range, T defaultValue, std::initializer_list<Timed<T>> initializerList) :
|
||||||
ContinuousTimeline(range, defaultValue, initializerList.begin(), initializerList.end())
|
ContinuousTimeline(range, defaultValue, initializerList.begin(), initializerList.end())
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -98,6 +98,11 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename collection_type>
|
||||||
|
explicit Timeline(collection_type collection) :
|
||||||
|
Timeline(collection.begin(), collection.end())
|
||||||
|
{}
|
||||||
|
|
||||||
explicit Timeline(std::initializer_list<Timed<T>> initializerList) :
|
explicit Timeline(std::initializer_list<Timed<T>> initializerList) :
|
||||||
Timeline(initializerList.begin(), initializerList.end())
|
Timeline(initializerList.begin(), initializerList.end())
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -22,6 +22,10 @@ TEST(BoundedTimeline, constructors_initializeState) {
|
||||||
BoundedTimeline<int>(range, args.begin(), args.end()),
|
BoundedTimeline<int>(range, args.begin(), args.end()),
|
||||||
ElementsAreArray(expected)
|
ElementsAreArray(expected)
|
||||||
);
|
);
|
||||||
|
EXPECT_THAT(
|
||||||
|
BoundedTimeline<int>(range, vector<Timed<int>>(args)),
|
||||||
|
ElementsAreArray(expected)
|
||||||
|
);
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
BoundedTimeline<int>(range, args),
|
BoundedTimeline<int>(range, args),
|
||||||
ElementsAreArray(expected)
|
ElementsAreArray(expected)
|
||||||
|
|
|
@ -24,6 +24,10 @@ TEST(ContinuousTimeline, constructors_initializeState) {
|
||||||
ContinuousTimeline<int>(range, defaultValue, args.begin(), args.end()),
|
ContinuousTimeline<int>(range, defaultValue, args.begin(), args.end()),
|
||||||
ElementsAreArray(expected)
|
ElementsAreArray(expected)
|
||||||
);
|
);
|
||||||
|
EXPECT_THAT(
|
||||||
|
ContinuousTimeline<int>(range, defaultValue, vector<Timed<int>>(args)),
|
||||||
|
ElementsAreArray(expected)
|
||||||
|
);
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
ContinuousTimeline<int>(range, defaultValue, args),
|
ContinuousTimeline<int>(range, defaultValue, args),
|
||||||
ElementsAreArray(expected)
|
ElementsAreArray(expected)
|
||||||
|
|
|
@ -24,6 +24,10 @@ TEST(Timeline, constructors_initializeState) {
|
||||||
Timeline<int>(args.begin(), args.end()),
|
Timeline<int>(args.begin(), args.end()),
|
||||||
ElementsAreArray(expected)
|
ElementsAreArray(expected)
|
||||||
);
|
);
|
||||||
|
EXPECT_THAT(
|
||||||
|
Timeline<int>(vector<Timed<int>>(args)),
|
||||||
|
ElementsAreArray(expected)
|
||||||
|
);
|
||||||
EXPECT_THAT(
|
EXPECT_THAT(
|
||||||
Timeline<int>(args),
|
Timeline<int>(args),
|
||||||
ElementsAreArray(expected)
|
ElementsAreArray(expected)
|
||||||
|
|
Loading…
Reference in New Issue