How large are Subscriber/Publisher/ServiceServer instances?
I'm writing a wrapper class that advertises several topics and services, and I'm unsure if I should store ros::Subscriber
/ros::Publisher
/ros::ServiceServer
members by value of by reference/on a vector. Is there a rule of thumb/general practice regarding these kind of situations?
Generally speaking for any non-trivial object you should store a reference or a pointer to it but the actual answer would be predicated on your application. You really haven't provided enough details to make a call one way or the other. I would encourage you to look at the source files to confirm that you won't have any issues.
Unless you construct it in the vector itself so you're not copying around.
In general though if you have some stuff you want in a vector for this case, a pointer makes sense. A reference only if the object is still being kept in scope.