• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/DelegateDispatch.cpp

00001 /*
00002  *   This file is part of the Standard Portable Library (SPL).
00003  *
00004  *   SPL is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   SPL is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with SPL.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 #include <spl/DelegateDispatch.h>
00018 
00019 DelegateDispatch::DelegateDispatch()
00020 : m_delegates(2)
00021 {
00022 }
00023 
00024 DelegateDispatch::~DelegateDispatch()
00025 {
00026 }
00027 
00028 void DelegateDispatch::Call()
00029 {
00030         for (int x = 0; x < m_delegates.Count(); x++ )
00031         {
00032                 m_delegates.ElementAtRef(x)->Call();
00033         }
00034 }
00035 
00036 void DelegateDispatch::Clear()
00037 {
00038         for (int x = 0; x < m_delegates.Count(); x++ )
00039         {
00040                 m_delegates.ElementAtRef(x)->Clear();
00041         }
00042         m_delegates.Clear();
00043 }
00044 
00045 #if defined(DEBUG)
00046 void DelegateDispatch::CheckMem() const
00047 {
00048         m_delegates.CheckMem();
00049 }
00050 
00051 void DelegateDispatch::ValidateMem() const
00052 {
00053         m_delegates.ValidateMem();
00054 }
00055 #endif