API for shared_ptr: can we converge to a unique method?
Consider a method accepting a shared_ptr as parameter. We can have several possibilities:
- f(ShPtr p)
- f(ShPtr& p)
- f(const ShPtr& p)
In wolf we find several ways of doing so. I presume many of them do not have a particular reason for doing it.
For example, this:
CaptureDiffDrive(const TimeStamp& _ts,
const SensorBasePtr& _sensor_ptr,
const Eigen::VectorXs& _data,
const Eigen::MatrixXs& _data_cov,
FrameBasePtr _origin_frame_ptr,
StateBlockPtr _p_ptr = nullptr,
StateBlockPtr _o_ptr = nullptr,
StateBlockPtr _intr_ptr = nullptr);
seems to indicate that the const ShPtr&
is an input, while ShPtr
is a simple output.
Here is a good read to get some right ideas for discussion.