rosidl - BoundedVector "UpperBound" (c++)

asked 2020-11-10 04:50:35 -0500

luneart gravatar image

Hello, I want to access the (max) size of bounded vector generated by custom messages, at compile time. At runtime I guess the std vector's max_size() member works, but the point to have this value at compile time is to allocate the memory statically for other data structures (like Eigen's matrices for example).

The template argument UpperBound is not directly accessible, but I saw that the generated c version has that msg/detail/custom_msg__struct.h file which contains an unnamed enum with its member project__msg__CustomMsg__data__MAX_SIZE but I can't seem to access it.

So: is it possible? is it forbidden (and why would it be)? if ok, how?

Thank you.

edit retag flag offensive close merge delete