[PD] writing pd object in cpp