+#include "handleSignal.h"
+
+#include <iostream>
+#include <signal.h>
+
+/// ***** Private Method Headers *****
+void sighandler( int sig );
+
+
+/// ***** Public Methods *****
+
+void installSignal()
+{
+ // register signal handler
+ struct sigaction sa;
+ sigemptyset( &sa.sa_mask );
+ sa.sa_handler = sighandler;
+ sa.sa_flags = 0;
+
+ if ( sigaction( SIGINT, &sa, NULL ) < 0 )
+ {
+ std::cerr << "could not install SIGINT handler" << std::endl;
+ }
+}
+
+/// ***** Private Methods *****
+
+// signal handler function
+void sighandler( int sig )
+{
+ switch(sig)
+ {
+ case SIGINT:
+ std::cerr << "SIGINT caught" << std::endl;
+ break;
+ default:
+ std::cout << "UNKNOWN caught";
+ }
+
+ // normally an abort is better ... but this is just SIGINT
+ exit(sig);
+}