General purpose C++ library for PFI