25 #include <SimoxUtility/meta/boost_hana.h>
26 #include <SimoxUtility/meta/enum/adapt_enum.h>
28 #include <ArmarXCore/interface/observers/ObserverInterface.h>
95 [[maybe_unused]]
static constexpr std::uint64_t IceIntTMax =
98 std::is_same_v<T, IceUtil::Time> ||
99 meta::TypeTemplateTraits::IsInstanceOfV<std::chrono::duration, T> ||
100 meta::TypeTemplateTraits::IsInstanceOfV<std::chrono::time_point, T>
106 else if constexpr(std::is_unsigned_v<T>&& !std::is_same_v<bool, T>)
109 if (_float_fallback_for_big_too_large_ints)
111 if (
value < IceIntTMax)
129 else if constexpr(simox::meta::has_hana_accessor_v<T>)
132 namespace hana = boost::hana;
133 static constexpr
auto accessors = hana::accessors<T>();
134 hana::for_each(accessors, [&](
auto & e)
137 const auto varname = hana::to<char const*>(hana::first(e));
138 const auto elemName = datafieldName +
'_' + varname;
143 else if constexpr(simox::meta::is_enum_adapted_v<T>)
148 else if constexpr(std::is_same_v<char, T>)
160 template<
class T,
class...Ts>
165 channelName, datafieldName,
166 IceUtil::Time::microSeconds(std::chrono::duration_cast<std::chrono::microseconds>(duration).count()),
169 template<
class T,
class...Ts>
170 void setDebugObserverDatafield(
const std::string& channelName,
const std::string& datafieldName,
const std::chrono::time_point<Ts...> timepoint,
const T&
value)
const
182 channelName, datafieldName,
183 IceUtil::Time::microSeconds(std::chrono::duration_cast<std::chrono::microseconds>(duration).count()),
199 channelName, datafieldName,
200 IceUtil::Time::microSeconds(std::chrono::duration_cast<std::chrono::microseconds>(duration).count()),
230 std::string _channelName;
232 bool _batchMode{
false};
233 mutable std::map<std::string, StringVariantBaseMap> _batch;
234 bool _float_fallback_for_big_too_large_ints =
true;