5 #include <unordered_map>
17 std::shared_ptr<RawBuffer>
serialize()
const override;
19 std::unordered_map<std::string, std::shared_ptr<ADatatype>>
group;
24 explicit MessageGroup(std::shared_ptr<RawMessageGroup> ptr);
28 std::shared_ptr<ADatatype>
operator[](
const std::string& name);
30 std::shared_ptr<T>
get(
const std::string& name) {
31 return std::dynamic_pointer_cast<T>(
group[name]);
33 void add(
const std::string& name,
const std::shared_ptr<ADatatype>& value);
35 void add(
const std::string& name,
const T& value) {
36 static_assert(std::is_base_of<ADatatype, T>::value,
"T must derive from ADatatype");
37 group[name] = std::make_shared<T>(value);
42 std::unordered_map<std::string, std::shared_ptr<ADatatype>>::iterator
begin();
43 std::unordered_map<std::string, std::shared_ptr<ADatatype>>::iterator
end();
49 bool isSynced(int64_t thresholdNs)
const;
66 MessageGroup&
setTimestamp(std::chrono::time_point<std::chrono::steady_clock, std::chrono::steady_clock::duration> timestamp);