convertEventHistory.h
Go to the documentation of this file.
1 
40 #pragma once
41 
42 #include <stdexcept>
43 
48 #ifdef ROS1
49 #include <etsi_its_denm_msgs/EventPoint.h>
50 #include <etsi_its_denm_msgs/EventHistory.h>
51 namespace denm_msgs = etsi_its_denm_msgs;
52 #else
53 #include <etsi_its_denm_msgs/msg/event_point.hpp>
54 #include <etsi_its_denm_msgs/msg/event_history.hpp>
55 namespace denm_msgs = etsi_its_denm_msgs::msg;
56 #endif
57 
58 
59 namespace etsi_its_denm_conversion {
60 
61 void toRos_EventHistory(const denm_EventHistory_t& in, denm_msgs::EventHistory& out) {
62  for (int i = 0; i < in.list.count; ++i) {
63  denm_msgs::EventPoint el;
64  toRos_EventPoint(*(in.list.array[i]), el);
65  out.array.push_back(el);
66  }
67 }
68 
69 void toStruct_EventHistory(const denm_msgs::EventHistory& in, denm_EventHistory_t& out) {
70  memset(&out, 0, sizeof(denm_EventHistory_t));
71  for (int i = 0; i < in.array.size(); ++i) {
72  denm_EventPoint_t* el = (denm_EventPoint_t*) calloc(1, sizeof(denm_EventPoint_t));
73  toStruct_EventPoint(in.array[i], *el);
74  if (asn_sequence_add(&out, el)) throw std::invalid_argument("Failed to add to A_SEQUENCE_OF");
75  }
76 }
77 
78 }
etsi_its_denm_conversion::toStruct_EventHistory
void toStruct_EventHistory(const denm_msgs::EventHistory &in, denm_EventHistory_t &out)
Definition: convertEventHistory.h:69
denm_EventPoint.h
denm_EventHistory.h
denm_EventHistory
etsi_its_denm_conversion::toRos_EventPoint
void toRos_EventPoint(const denm_EventPoint_t &in, denm_msgs::EventPoint &out)
Definition: convertEventPoint.h:61
etsi_its_denm_conversion::toStruct_EventPoint
void toStruct_EventPoint(const denm_msgs::EventPoint &in, denm_EventPoint_t &out)
Definition: convertEventPoint.h:70
convertEventPoint.h
etsi_its_denm_conversion
Definition: convertAccidentSubCauseCode.h:54
asn_SEQUENCE_OF.h
denm_EventPoint
etsi_its_denm_conversion::toRos_EventHistory
void toRos_EventHistory(const denm_EventHistory_t &in, denm_msgs::EventHistory &out)
Definition: convertEventHistory.h:61
asn_sequence_add
#define asn_sequence_add


etsi_its_denm_conversion
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:29:03