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

Signal supporting five parameters. This is the primary class which provides the template for all partial specialized classes. More...

#include <pdf_observer.h>

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

Public Member Functions

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

Detailed Description

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

Signal supporting five parameters. This is the primary class which provides the template for all partial specialized classes.

Definition at line 227 of file pdf_observer.h.


Constructor & Destructor Documentation

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

Definition at line 231 of file pdf_observer.h.

00231 {}

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

Definition at line 232 of file pdf_observer.h.

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


Member Function Documentation

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

Add receiver to receive pre-defined signals.

Definition at line 237 of file pdf_observer.h.

Referenced by pdf::PluginDocImpl::PluginDocImpl(), and pdf::PluginViewImpl::PluginViewImpl().

00238         {
00239             IFunctorPtr func_ptr = new Functor<T, R, A1, A2, A3, A4, A5>(p, func);
00240             receivers.push_back(func_ptr);
00241         }

Here is the caller graph for this function:

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

Notify all receivers.

Definition at line 253 of file pdf_observer.h.

Referenced by pdf::PDFSearcher::notify().

00254         {
00255             ReceiversIter begin, end, it;
00256             begin = receivers.begin();
00257             end   = receivers.end();
00258             IFunctorPtr ptr = 0;
00259             for(it= begin; it != end; ++it)
00260             {
00261                 ptr = *it;
00262                 (*ptr)(arg1, arg2, arg3, arg4, arg5);
00263             }
00264         }

Here is the caller graph for this function:

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

Definition at line 266 of file pdf_observer.h.

00266 {return receivers.size();}

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

Remove receiver from the receivers list.

Definition at line 245 of file pdf_observer.h.

Referenced by pdf::PluginViewImpl::~PluginViewImpl().

00246         {
00247             Functor<T, R, A1, A2, A3, A4, A5> func_obj(p, func);
00248             return ReceiversOperations<IFunctorPtr>::
00249                    remove_receiver(&func_obj, receivers);
00250         }

Here is the caller graph for this function:


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