Function etsi_its_cpm_ts_msgs::access::addPerceivedObjectToContainer

Function Documentation

inline void etsi_its_cpm_ts_msgs::access::addPerceivedObjectToContainer(WrappedCpmContainer &container, const PerceivedObject &perceived_object)

Adds a PerceivedObject to the PerceivedObjectContainer / WrappedCpmContainer.

This function checks if the provided container is a PerceivedObjectContainer. If it is, the function adds the given PerceivedObject to the container’s perceived_objects array and updates the number_of_perceived_objects value. If the container is not a PerceivedObjectContainer, the function throws an std::invalid_argument exception.

Parameters:
  • container – The WrappedCpmContainer to which the PerceivedObject will be added.

  • perceived_object – The PerceivedObject to add to the container.

Throws:

std::invalid_argument – if the container is not a PerceivedObjectContainer.