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

Signal supporting none parameter. More...

#include <pdf_observer.h>

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

Public Member Functions

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

Detailed Description

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

Signal supporting none parameter.

Definition at line 276 of file pdf_observer.h.


Constructor & Destructor Documentation

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

Definition at line 281 of file pdf_observer.h.

00281 {}

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

Definition at line 282 of file pdf_observer.h.

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


Member Function Documentation

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

Add receiver to receive pre-defined signals.

Definition at line 287 of file pdf_observer.h.

00288         {
00289             IFunctorPtr func_ptr = new Functor<T, R>(p, func);
00290             receivers.push_back(func_ptr);
00291         }

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

Notify all receivers.

Definition at line 303 of file pdf_observer.h.

00304         {
00305             ReceiversIter begin, end, it;
00306             begin = receivers.begin();
00307             end   = receivers.end();
00308             IFunctorPtr ptr = 0;
00309             for(it= begin; it != end; ++it)
00310             {
00311                 ptr = *it;
00312                 (*ptr)();
00313             }
00314         }

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

Definition at line 316 of file pdf_observer.h.

00316 {return receivers.size();}

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

Remove receiver from the receivers list.

Definition at line 295 of file pdf_observer.h.

00296         {
00297             Functor<T, R> func_obj(p, func);
00298             return ReceiversOperations<IFunctorPtr>::
00299                    remove_receiver(&func_obj, receivers);
00300         }


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