Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8184 in orxonox.OLD for branches/network/src/util/signal_handler.h


Ignore:
Timestamp:
Jun 7, 2006, 1:16:12 PM (18 years ago)
Author:
rennerc
Message:

do network cleanup in multiplayerworld destructor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/util/signal_handler.h

    r7440 r8184  
    1717};
    1818
     19typedef bool (*SignalCallback)( void * someData );
    1920
    2021#ifndef __WIN32__
     
    2728};
    2829
     30struct SignalCallbackRec
     31{
     32  SignalCallback cb;
     33  void * someData;
     34};
     35
    2936
    3037typedef std::list<SignalRec> SignalRecList;
     38typedef std::list<SignalCallbackRec> SignalCallbackList;
    3139
    3240class SignalHandler
     
    3543    SignalHandler();
    3644  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 );
    3948
    4049    void doCatch( std::string appName, GdbRunType type = GDB_RUN_WRITE_TO_FILE );
     
    4655    void catchSignal( int sig );
    4756    SignalRecList sigRecList;
     57   
     58    SignalCallbackList callbackList;
    4859
    4960    static SignalHandler * singletonRef;
     
    5869{
    5970 public:
    60   inline static SignalHandler* getInstance() {};
     71   inline static SignalHandler* getInstance() { if (!SignalHandler::singletonRef) SignalHandler::singletonRef = new SignalHandler(); return SignalHandler::singletonRef; };
    6172  void doCatch( std::string appName, GdbRunType type = GDB_RUN_WRITE_TO_FILE ) {};
    6273  void dontCatch() {};
     74  void registerCallback( SignalCallback cb, void * someData ) {};
    6375};
    6476#endif
Note: See TracChangeset for help on using the changeset viewer.