OSSIA
Open Scenario System for Interactive Application
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>
6 namespace ossia
7 {
8 inline 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
constexpr OSSIA_INLINE 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