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

Signal supporting three parameters. More...

#include <pdf_observer.h>

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

Public Member Functions

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

Detailed Description

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

Signal supporting three parameters.

Definition at line 428 of file pdf_observer.h.


Constructor & Destructor Documentation

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

Definition at line 432 of file pdf_observer.h.

00432 {}

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

Definition at line 433 of file pdf_observer.h.

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


Member Function Documentation

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

Add receiver to receive pre-defined signals.

Definition at line 438 of file pdf_observer.h.

00439         {
00440             IFunctorPtr func_ptr = new Functor<T, R, A1, A2, A3>(p, func);
00441             receivers.push_back(func_ptr);
00442         }

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

Notify all receivers.

Definition at line 454 of file pdf_observer.h.

00455         {
00456             ReceiversIter begin, end, it;
00457             begin = receivers.begin();
00458             end   = receivers.end();
00459             IFunctorPtr ptr = 0;
00460             for(it= begin; it != end; ++it)
00461             {
00462                 ptr = *it;
00463                 (*ptr)(arg1, arg2, arg3);
00464             }
00465         }

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

Definition at line 467 of file pdf_observer.h.

00467 {return receivers.size();}

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

Remove receiver from the receivers list.

Definition at line 446 of file pdf_observer.h.

00447         {
00448             Functor<T, R, A1, A2, A3> func_obj(p, func);
00449             return ReceiversOperations<IFunctorPtr>::
00450                    remove_receiver(&func_obj, receivers);
00451         }


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