A global module version of sample.cpp would be useful.
global modules just use some other macros and inherit from another class. In turn their hooks are called for all users and they get some module hooks. Also, most modules should be doable as a user module anyway.
Why do you need an example for a global module?
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).