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

Signal supporting one parameter. More...

#include <pdf_observer.h>

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

Public Member Functions

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

Detailed Description

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

Signal supporting one parameter.

Definition at line 326 of file pdf_observer.h.


Constructor & Destructor Documentation

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

Definition at line 330 of file pdf_observer.h.

00330 {}

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

Definition at line 331 of file pdf_observer.h.

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


Member Function Documentation

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

Add receiver to receive pre-defined signals.

Definition at line 336 of file pdf_observer.h.

00337         {
00338             IFunctorPtr func_ptr = new Functor<T, R, A1>(p, func);
00339             receivers.push_back(func_ptr);
00340         }

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

Notify all receivers.

Definition at line 352 of file pdf_observer.h.

00353         {
00354             ReceiversIter begin, end, it;
00355             begin = receivers.begin();
00356             end   = receivers.end();
00357             IFunctorPtr ptr = 0;
00358             for(it= begin; it != end; ++it)
00359             {
00360                 ptr = *it;
00361                 (*ptr)(arg1);
00362             }
00363         }

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

Definition at line 365 of file pdf_observer.h.

00365 {return receivers.size();}

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

Remove receiver from the receivers list.

Definition at line 344 of file pdf_observer.h.

00345         {
00346             Functor<T, R, A1> func_obj(p, func);
00347             return ReceiversOperations<IFunctorPtr>::
00348                    remove_receiver(&func_obj, receivers);
00349         }


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