Changeset 8184 in orxonox.OLD for branches/network/src/util/signal_handler.h
- Timestamp:
- Jun 7, 2006, 1:16:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/signal_handler.h
r7440 r8184 17 17 }; 18 18 19 typedef bool (*SignalCallback)( void * someData ); 19 20 20 21 #ifndef __WIN32__ … … 27 28 }; 28 29 30 struct SignalCallbackRec 31 { 32 SignalCallback cb; 33 void * someData; 34 }; 35 29 36 30 37 typedef std::list<SignalRec> SignalRecList; 38 typedef std::list<SignalCallbackRec> SignalCallbackList; 31 39 32 40 class SignalHandler … … 35 43 SignalHandler(); 36 44 public: 37 inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); 38 return SignalHandler::singletonRef; } 45 inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; } 46 47 void registerCallback( SignalCallback cb, void * someData ); 39 48 40 49 void doCatch( std::string appName, GdbRunType type = GDB_RUN_WRITE_TO_FILE ); … … 46 55 void catchSignal( int sig ); 47 56 SignalRecList sigRecList; 57 58 SignalCallbackList callbackList; 48 59 49 60 static SignalHandler * singletonRef; … … 58 69 { 59 70 public: 60 inline static SignalHandler* getInstance() {};71 inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; }; 61 72 void doCatch( std::string appName, GdbRunType type = GDB_RUN_WRITE_TO_FILE ) {}; 62 73 void dontCatch() {}; 74 void registerCallback( SignalCallback cb, void * someData ) {}; 63 75 }; 64 76 #endif
Note: See TracChangeset
for help on using the changeset viewer.