Macro to define component's shared & weak ptrs.