KodlabPenn / kodlab_mjbots_sdk

Repo for kodlab SDK for use with mjbots ecosystem
Other
8 stars 7 forks source link

Inline LcmSubscriber implementation #65

Closed ethanmusser closed 2 years ago

ethanmusser commented 2 years ago

Currently, the LcmSubscriber implementation is in the lcm_subscriber.h header file where the class is defined. If this file is included in multiple translation units, a linker error occurs due to multiple definitions of the member functions. This will be fixed once the TODO in lcm_subscriber.h requesting that the implementation be moved to a cpp file is addressed. However, this cannot happen until #51 is resolved. This is a temporary fix to prevent linker errors in the meantime.

ethanmusser commented 2 years ago

@ShaneRozenLevy That is a good point. The class itself and most of it's definitions can move to a cpp, but there is one member that is a function template. I guess we're stuck with keeping at least this method template inlined in the header since it would be impossible to explicitly instantiate the method template for all LCM message types.