Format cpp code, and support action event emitter