moss-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Moss-devel] CVS: moss/family/include SignalHandler.h,1.3,1.4


From: Alexander Feder <address@hidden>
Subject: [Moss-devel] CVS: moss/family/include SignalHandler.h,1.3,1.4
Date: Sat, 02 Nov 2002 18:15:56 -0500

Update of /cvsroot/moss/moss/family/include
In directory subversions:/tmp/cvs-serv7445

Modified Files:
        SignalHandler.h 
Log Message:
finished singletonization


Index: SignalHandler.h
===================================================================
RCS file: /cvsroot/moss/moss/family/include/SignalHandler.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** SignalHandler.h     2 Nov 2002 00:47:27 -0000       1.3
--- SignalHandler.h     2 Nov 2002 23:15:53 -0000       1.4
***************
*** 30,33 ****
--- 30,38 ----
  
      * changed to "all inline" - no cxx file anymore
+     
+   2002-11-03 
+   
+     * singletonized it
+   
  
   ***************************************************************************/
***************
*** 55,58 ****
--- 60,67 ----
  #include <string>
  
+ #ifdef DEBUG
+ #include <iostream>
+ #endif
+ 
  ////////////////////////////////////////////
  //
***************
*** 60,63 ****
--- 69,75 ----
  //
  
+ void Signal(int nSignal);
+ void SignalUnhandled(int nSignal);
+ 
  
  namespace family
***************
*** 91,95 ****
  
      public:
-       static CSignalManager *s_poManager;
  
      protected:
--- 103,106 ----
***************
*** 104,109 ****
        static CSignalManager& GetInstance ()
          {
!         static CSignalManager oSignalManager;  
!         return oSignalManager;
          }
       
--- 115,120 ----
        static CSignalManager& GetInstance ()
          {
!         static CSignalManager oManager;
!         return oManager;
          }
       
***************
*** 155,159 ****
        virtual void Unhandled(int nSignal)
          {
! #ifdef _DEBUG
          CMapSignal2Name::iterator it = m_mnsSignal2Name.find(nSignal);
          std::cerr << "unhandled signal: "
--- 166,170 ----
        virtual void Unhandled(int nSignal)
          {
! #ifdef DEBUG
          CMapSignal2Name::iterator it = m_mnsSignal2Name.find(nSignal);
          std::cerr << "unhandled signal: "
***************
*** 161,170 ****
            << ( ( it == m_mnsSignal2Name.end() ) ? "unknown" : 
it->second.c_str() )
            << std::endl;
! #endif // _DEBUG
          } // void Unhandled(int nSignal)
  
        virtual void Handled(int nSignal)
          {
! #ifdef _DEBUG
          CMapSignal2Name::iterator it = m_mnsSignal2Name.find(nSignal);
          std::cout << "signal: "
--- 172,181 ----
            << ( ( it == m_mnsSignal2Name.end() ) ? "unknown" : 
it->second.c_str() )
            << std::endl;
! #endif // DEBUG
          } // void Unhandled(int nSignal)
  
        virtual void Handled(int nSignal)
          {
! #ifdef DEBUG
          CMapSignal2Name::iterator it = m_mnsSignal2Name.find(nSignal);
          std::cout << "signal: "
***************
*** 172,176 ****
            << ( ( it == m_mnsSignal2Name.end() ) ? "unknown" : 
it->second.c_str() )
            << std::endl;
! #endif // _DEBUG
  
          switch (nSignal)
--- 183,187 ----
            << ( ( it == m_mnsSignal2Name.end() ) ? "unknown" : 
it->second.c_str() )
            << std::endl;
! #endif // DEBUG
  
          switch (nSignal)
***************
*** 304,330 ****
        // shows the number and the name of the signal
        // should show the time too?
!       static void SignalUnhandled(int nSignal)
!         {
!         if (s_poManager != 0)
!           {
!           s_poManager->Unhandled(nSignal);
!           }
!         } // void SignalUnhandled(int nSignal)
! 
!       static void Signal(int nSignal)
!         {
!         if (s_poManager != 0)
!           {
!           s_poManager->Handled(nSignal);
!           }
!         else // if (CSignalManager::s_poManager != 0)
!           {
!           TRACE("Signal handler not established\n")
!           } // else if (CSignalManager::s_poManager != 0)
!         } // void SignalUnhandled(int nSignal)
  
      }; // class CSignalManager
  
    } // namespace family
  
  #endif // __SIGNAL_HANDLER_H
--- 315,339 ----
        // shows the number and the name of the signal
        // should show the time too?
!       
  
      }; // class CSignalManager
  
    } // namespace family
+ 
+ void Signal(int nSignal)
+     {
+     #ifdef DEBUG
+     std::cout << "Signal" << endl;
+     #endif
+     family::CSignalManager::GetInstance().Handled(nSignal);
+     } // void SignalUnhandled(int nSignal)
+ 
+ void SignalUnhandled(int nSignal)
+     {
+     #ifdef DEBUG
+     std::cout << "Unhandled Signal" << endl;
+     #endif
+     family::CSignalManager::GetInstance().Unhandled(nSignal);
+     } // void SignalUnhandled(int nSignal)
  
  #endif // __SIGNAL_HANDLER_H





reply via email to

[Prev in Thread] Current Thread [Next in Thread]