pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE > Class Template Reference

Signal supporting two parameters. More...

#include <pdf_observer.h>

Collaboration diagram for pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >:
Collaboration graph
[legend]

Public Member Functions

 Signal ()
 ~Signal ()
template<class T >
void add_slot (T *p, R(T::*func)(A1, A2))
 Add receiver to receive pre-defined signals.
template<class T >
bool remove_slot (T *p, R(T::*func)(A1, A2))
 Remove receiver from the receivers list.
void broadcast (A1 arg1, A2 arg2)
 Notify all receivers.
unsigned int count ()

Detailed Description

template<class R, class A1, class A2>
class pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >

Signal supporting two parameters.

Definition at line 376 of file pdf_observer.h.


Constructor & Destructor Documentation

template<class R , class A1 , class A2 >
pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >::Signal (  )  [inline]

Definition at line 380 of file pdf_observer.h.

00380 {}

template<class R , class A1 , class A2 >
pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >::~Signal (  )  [inline]

Definition at line 381 of file pdf_observer.h.

00381 {ReceiversOperations<IFunctorPtr>::clear(receivers);}


Member Function Documentation

template<class R , class A1 , class A2 >
template<class T >
void pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >::add_slot ( T *  p,
R(T::*)(A1, A2)  func 
) [inline]

Add receiver to receive pre-defined signals.

Definition at line 386 of file pdf_observer.h.

00387         {
00388             IFunctorPtr func_ptr = new Functor<T, R, A1, A2>(p, func);
00389             receivers.push_back(func_ptr);
00390         }

template<class R , class A1 , class A2 >
void pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >::broadcast ( A1  arg1,
A2  arg2 
) [inline]

Notify all receivers.

Definition at line 403 of file pdf_observer.h.

00404         {
00405             ReceiversIter begin, end, it;
00406             begin = receivers.begin();
00407             end   = receivers.end();
00408             IFunctorPtr ptr = 0;
00409             for(it= begin; it != end; ++it)
00410             {
00411                 ptr = *it;
00412                 (*ptr)(arg1, arg2);
00413             }
00414         }

template<class R , class A1 , class A2 >
unsigned int pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >::count (  )  [inline]

Definition at line 416 of file pdf_observer.h.

00416 {return receivers.size();}

template<class R , class A1 , class A2 >
template<class T >
bool pdf::Signal< R, A1, A2, UNUSABLE, UNUSABLE, UNUSABLE >::remove_slot ( T *  p,
R(T::*)(A1, A2)  func 
) [inline]

Remove receiver from the receivers list.

Definition at line 395 of file pdf_observer.h.

00396         {
00397             Functor<T, R, A1, A2> func_obj(p, func);
00398             return ReceiversOperations<IFunctorPtr>::
00399                    remove_receiver(&func_obj, receivers);
00400         }


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208