some utility classes written by cpp.