• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

MyGUI_EventPair.h

Go to the documentation of this file.
00001 
00007 /*
00008     This file is part of MyGUI.
00009     
00010     MyGUI is free software: you can redistribute it and/or modify
00011     it under the terms of the GNU Lesser General Public License as published by
00012     the Free Software Foundation, either version 3 of the License, or
00013     (at your option) any later version.
00014     
00015     MyGUI is distributed in the hope that it will be useful,
00016     but WITHOUT ANY WARRANTY; without even the implied warranty of
00017     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018     GNU Lesser General Public License for more details.
00019     
00020     You should have received a copy of the GNU Lesser General Public License
00021     along with MyGUI.  If not, see <http://www.gnu.org/licenses/>.
00022 */
00023 #ifndef __MYGUI_EVENT_PAIR_H__
00024 #define __MYGUI_EVENT_PAIR_H__
00025 
00026 #include "MyGUI_Prerequest.h"
00027 #include "MyGUI_Common.h"
00028 
00029 namespace MyGUI
00030 {
00031 
00032     template <typename EventObsolete, typename Event>
00033     class EventPair
00034     {
00035     public:
00036 
00037         template <typename T>
00038         MYGUI_OBSOLETE("use : signature : Event::IDelegate * _delegate")
00039         void operator = (T * _delegate)
00040         {
00041             m_eventObsolete = _delegate;
00042             m_event = nullptr;
00043         }
00044 
00045         void operator = (typename Event::IDelegate * _delegate)
00046         {
00047             m_eventObsolete = nullptr;
00048             m_event = _delegate;
00049         }
00050 
00051         template <typename TP1>
00052         void operator()( TP1 p1 )
00053         {
00054             m_eventObsolete(p1);
00055             m_event(p1);
00056         }
00057 
00058         template <typename TP1, typename TP2>
00059         void operator()( TP1 p1, TP2 p2 )
00060         {
00061             m_eventObsolete(p1, p2);
00062             m_event(p1, p2);
00063         }
00064 
00065         template <typename TP1, typename TP2, typename TP3>
00066         void operator()( TP1 p1, TP2 p2, TP3 p3 )
00067         {
00068             m_eventObsolete(p1, p2, p3);
00069             m_event(p1, p2, p3);
00070         }
00071 
00072         template <typename TP1, typename TP2, typename TP3, typename TP4>
00073         void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4 )
00074         {
00075             m_eventObsolete(p1, p2, p3, p4);
00076             m_event(p1, p2, p3, p4);
00077         }
00078 
00079         template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5>
00080         void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5 )
00081         {
00082             m_eventObsolete(p1, p2, p3, p4, p5);
00083             m_event(p1, p2, p3, p4, p5);
00084         }
00085 
00086         template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5, typename TP6>
00087         void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6 )
00088         {
00089             m_eventObsolete(p1, p2, p3, p4, p5, p6);
00090             m_event(p1, p2, p3, p4, p5, p6);
00091         }
00092 
00093         template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5, typename TP6, typename TP7>
00094         void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6, TP7 p7 )
00095         {
00096             m_eventObsolete(p1, p2, p3, p4, p5, p6, p7);
00097             m_event(p1, p2, p3, p4, p5, p6, p7);
00098         }
00099 
00100         template <typename TP1, typename TP2, typename TP3, typename TP4, typename TP5, typename TP6, typename TP7, typename TP8>
00101         void operator()( TP1 p1, TP2 p2, TP3 p3, TP4 p4, TP5 p5, TP6 p6, TP7 p7, TP8 p8 )
00102         {
00103             m_eventObsolete(p1, p2, p3, p4, p5, p6, p7, p8);
00104             m_event(p1, p2, p3, p4, p5, p6, p7, p8);
00105         }
00106 
00107         bool empty()
00108         {
00109             return m_eventObsolete.empty() && m_event.empty();
00110         }
00111 
00112     public:
00113         EventObsolete m_eventObsolete;
00114         Event m_event;
00115     };
00116 
00117 } // namespace MyGUI
00118 
00119 #endif // __MYGUI_EVENT_PAIR_H__

Generated on Sun Jan 30 2011 for MyGUI by  doxygen 1.7.1