error is: "expected unqualified-id before 'public'
That mean, it expected this to be in a class, not any where else.
As I said the code is incomplete. You must find a way to make it complete.
adding the main function, putting this whole code in a class, making objects of the class.......the poster did his job to make some sought of "engine", now you must make the engine work.