#ifndef __MainLoop_h_ #define __MainLoop_h_ #include class MainLoop { private: void installSignalHandlers(); void startHardShutdown(); protected: virtual time_t getDefaultStartTime(); virtual time_t getDefaultEndTime(); virtual void start(); virtual void requestGracefulShutdown(); public: // This will install the signal handlers. You should consider creating this // object before initializing any code that would require a graceful // shutdown. MainLoop(); // Call this when you've finished the program's immediate initialization. // This will start waiting for events like time to start, time to end, // or a signal handler. This will never exit! The program will shut down // first. void startWaiting(); }; #endif