CppDelegate::MultiDelegate Class Reference

#include <Delegate.h>

List of all members.

Public Types

typedef void(*) Function (void)
typedef FastDelegate0 FastDelegate

Public Member Functions

 MultiDelegate ()
 MultiDelegate (Function function)
 MultiDelegate (const FastDelegate &_me)
template<class X, class Y>
 MultiDelegate (X *object, void(Y::*function)())
template<class X, class Y>
 MultiDelegate (const X *object, void(Y::*function)() const)
void Invoke () const
bool Add (FastDelegate &addable)
bool Add (Function function)
template<class X, class Y>
bool Add (X *object, void(Y::*function)())
template<class X, class Y>
bool Add (const X *object, void(Y::*function)() const)
bool RemoveAll (FastDelegate &removable)
bool RemoveAll (Function function)
template<class X, class Y>
bool RemoveAll (X *object, void(Y::*function)())
template<class X, class Y>
bool RemoveAll (const X *object, void(Y::*function)() const)
bool Remove (FastDelegate &removable)
bool Remove (Function function)
template<class X, class Y>
bool Remove (X *object, void(Y::*function)())
template<class X, class Y>
bool Remove (const X *object, void(Y::*function)() const)
void Clear ()
bool IsEmpty () const
void operator() () const
bool operator! () const
bool operator+= (Function function)
bool operator+= (FastDelegate &addable)
bool operator-= (Function function)
bool operator-= (FastDelegate &removable)
 ~MultiDelegate ()

Private Attributes

MultiDelegatenext
FastDelegate me

Friends

template<class Delegate, class FastDelegate>
bool Internal::AddFastDelegate (Delegate &delegate, FastDelegate &addable)
template<class Delegate, typename Function>
bool Internal::AddFunction (Delegate &delegate, Function function)
template<class Delegate, class Object, typename MemberFunction>
bool Internal::AddMemberFunction (Delegate &delegate, Object *object, MemberFunction function)
template<class Delegate, class FastDelegate>
bool Internal::RemoveAll (Delegate &delegate, FastDelegate &removable)
template<class Delegate, class FastDelegate>
bool Internal::Remove (Delegate &delegate, FastDelegate &removable)
template<class Delegate>
void Internal::Clear (Delegate &delegate)


Detailed Description

Definition at line 1897 of file Delegate.h.


Member Typedef Documentation

typedef void(*) CppDelegate::MultiDelegate::Function(void)

Definition at line 1901 of file Delegate.h.

typedef FastDelegate0 CppDelegate::MultiDelegate::FastDelegate

Definition at line 1902 of file Delegate.h.


Constructor & Destructor Documentation

CppDelegate::MultiDelegate::MultiDelegate (  )  [inline]

Definition at line 1918 of file Delegate.h.

01918 : next(NULL), me() {}

CppDelegate::MultiDelegate::MultiDelegate ( Function  function  )  [inline]

Definition at line 1919 of file Delegate.h.

01919 : next(NULL), me(function) {}

CppDelegate::MultiDelegate::MultiDelegate ( const FastDelegate _me  )  [inline]

Definition at line 1920 of file Delegate.h.

01920 : next(NULL), me(_me) {}

template<class X, class Y>
CppDelegate::MultiDelegate::MultiDelegate ( X *  object,
void(Y::*)()  function 
) [inline]

Definition at line 1921 of file Delegate.h.

01921 : next(NULL), me(object, function) {}

template<class X, class Y>
CppDelegate::MultiDelegate::MultiDelegate ( const X *  object,
void(Y::*)() const  function 
) [inline]

Definition at line 1922 of file Delegate.h.

01922 : next(NULL), me(object, function) {}

CppDelegate::MultiDelegate::~MultiDelegate (  )  [inline]

Definition at line 2022 of file Delegate.h.

02022 { Clear(); }


Member Function Documentation

void CppDelegate::MultiDelegate::Invoke (  )  const [inline]

Definition at line 1924 of file Delegate.h.

01925                 {
01926                         if (!me.IsEmpty() )
01927                         {
01928                                 me();
01929                                 if (next != NULL) next->Invoke();
01930                         }
01931                         
01932                 } // OPERATOR ()

bool CppDelegate::MultiDelegate::Add ( FastDelegate addable  )  [inline]

Definition at line 1934 of file Delegate.h.

01935                 {
01936                         return Internal::AddFastDelegate<MultiDelegate, FastDelegate>(*this, addable);
01937                         
01938                 } // Add 1

bool CppDelegate::MultiDelegate::Add ( Function  function  )  [inline]

Definition at line 1940 of file Delegate.h.

01941                 {
01942                         return Internal::AddFunction<MultiDelegate, Function>(*this, function);
01943                         
01944                 } // Add 2

template<class X, class Y>
bool CppDelegate::MultiDelegate::Add ( X *  object,
void(Y::*)()  function 
) [inline]

Definition at line 1946 of file Delegate.h.

01947                 {
01948                         return Internal::AddMemberFunction<MultiDelegate, X, void (Y::*)()>(*this, object, function);
01949                         
01950                 } // Add 3

template<class X, class Y>
bool CppDelegate::MultiDelegate::Add ( const X *  object,
void(Y::*)() const  function 
) [inline]

Definition at line 1952 of file Delegate.h.

01953                 {
01954                         return Internal::AddMemberFunction<MultiDelegate, const X, void (Y::*)() const>(*this, object, function);
01955                         
01956                 } // Add 4

bool CppDelegate::MultiDelegate::RemoveAll ( FastDelegate removable  )  [inline]

Definition at line 1958 of file Delegate.h.

01959                 {
01960                         return Internal::RemoveAll<MultiDelegate, FastDelegate>(*this, removable);
01961                         
01962                 } // RemoveAll 1

bool CppDelegate::MultiDelegate::RemoveAll ( Function  function  )  [inline]

Definition at line 1964 of file Delegate.h.

01965                 {
01966                         FastDelegate removable(function);
01967                         
01968                         return RemoveAll(removable);
01969                         
01970                 } // RemoveAll 2

template<class X, class Y>
bool CppDelegate::MultiDelegate::RemoveAll ( X *  object,
void(Y::*)()  function 
) [inline]

Definition at line 1972 of file Delegate.h.

01973                 {
01974                         FastDelegate removable(object, function);
01975                         
01976                         return RemoveAll(removable);
01977                         
01978                 } // RemoveAll 3

template<class X, class Y>
bool CppDelegate::MultiDelegate::RemoveAll ( const X *  object,
void(Y::*)() const  function 
) [inline]

Definition at line 1980 of file Delegate.h.

01981                 {
01982                         return RemoveAll<X, Y>(object, (void (Y::*)(void))function);
01983                         
01984                 } // RemoveAll 4

bool CppDelegate::MultiDelegate::Remove ( FastDelegate removable  )  [inline]

Definition at line 1986 of file Delegate.h.

01987                 {
01988                         return Internal::Remove<MultiDelegate, FastDelegate>(*this, removable);
01989                         
01990                 } // Remove 1

bool CppDelegate::MultiDelegate::Remove ( Function  function  )  [inline]

Definition at line 1992 of file Delegate.h.

01993                 {
01994                         FastDelegate removable(function);
01995                         
01996                         return Remove(removable);
01997                         
01998                 } // Remove 2

template<class X, class Y>
bool CppDelegate::MultiDelegate::Remove ( X *  object,
void(Y::*)()  function 
) [inline]

Definition at line 2000 of file Delegate.h.

02001                 {
02002                         FastDelegate removable(object, function);
02003                         
02004                         return Remove(removable);
02005                         
02006                 } // Remove 3

template<class X, class Y>
bool CppDelegate::MultiDelegate::Remove ( const X *  object,
void(Y::*)() const  function 
) [inline]

Definition at line 2008 of file Delegate.h.

02009                 {
02010                         return Remove(object, (void (Y::*)(void))function);
02011                         
02012                 } // Remove 4

void CppDelegate::MultiDelegate::Clear (  )  [inline]

Definition at line 2014 of file Delegate.h.

02014 { Internal::Clear<MultiDelegate>(*this);        }

bool CppDelegate::MultiDelegate::IsEmpty (  )  const [inline]

Definition at line 2015 of file Delegate.h.

02015 { return !me; }

void CppDelegate::MultiDelegate::operator() (  )  const [inline]

Definition at line 2016 of file Delegate.h.

02016 { Invoke(); }

bool CppDelegate::MultiDelegate::operator! (  )  const [inline]

Definition at line 2017 of file Delegate.h.

02017 { return IsEmpty(); }

bool CppDelegate::MultiDelegate::operator+= ( Function  function  )  [inline]

Definition at line 2018 of file Delegate.h.

02018 { return Add(function); }

bool CppDelegate::MultiDelegate::operator+= ( FastDelegate addable  )  [inline]

Definition at line 2019 of file Delegate.h.

02019 { return Add(addable); }

bool CppDelegate::MultiDelegate::operator-= ( Function  function  )  [inline]

Definition at line 2020 of file Delegate.h.

02020 { return Remove(function); }

bool CppDelegate::MultiDelegate::operator-= ( FastDelegate removable  )  [inline]

Definition at line 2021 of file Delegate.h.

02021 { return Remove(removable); }


Friends And Related Function Documentation

template<class Delegate, class FastDelegate>
bool Internal::AddFastDelegate ( Delegate &  delegate,
FastDelegate addable 
) [friend]

template<class Delegate, typename Function>
bool Internal::AddFunction ( Delegate &  delegate,
Function  function 
) [friend]

template<class Delegate, class Object, typename MemberFunction>
bool Internal::AddMemberFunction ( Delegate &  delegate,
Object *  object,
MemberFunction  function 
) [friend]

template<class Delegate, class FastDelegate>
bool Internal::RemoveAll ( Delegate &  delegate,
FastDelegate removable 
) [friend]

template<class Delegate, class FastDelegate>
bool Internal::Remove ( Delegate &  delegate,
FastDelegate removable 
) [friend]

template<class Delegate>
void Internal::Clear ( Delegate &  delegate  )  [friend]


Member Data Documentation

MultiDelegate* CppDelegate::MultiDelegate::next [private]

Definition at line 1906 of file Delegate.h.

FastDelegate CppDelegate::MultiDelegate::me [private]

Definition at line 1907 of file Delegate.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 15 23:41:51 2007 for AVR C++ Lib (common) by  doxygen 1.5.2
SourceForge.net Logo MTÜ TTÜ Robotiklubi