OSSIA
Open Scenario System for Interactive Application
Loading...
Searching...
No Matches
fx_node.hpp
1#pragma once
2#include <ossia/dataflow/data.hpp>
3#include <ossia/dataflow/graph_node.hpp>
4#include <ossia/dataflow/timed_value.hpp>
5#include <ossia/dataflow/value_vector.hpp>
6namespace ossia
7{
8inline const ossia::value& last(const ossia::value_vector<ossia::timed_value>& vec)
9{
10 auto max = vec[0].timestamp;
11 const ossia::timed_value* ptr{&vec[0]};
12 for(auto& e : vec)
13 {
14 if(e.timestamp < max)
15 {
16 max = e.timestamp;
17 ptr = &e;
18 }
19 }
20 return ptr->value;
21}
22}
The value class.
Definition value.hpp:173
Definition git_info.h:7
OSSIA_INLINE constexpr auto max(const T a, const U b) noexcept -> typename std::conditional<(sizeof(T) > sizeof(U)), T, U >::type
max function tailored for values
Definition math.hpp:96