1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_comm_ReceiverFactoryImpl_hpp
10 #define anna_comm_ReceiverFactoryImpl_hpp
12 #include <anna/core/util/Recycler.hpp>
14 #include <anna/comm/ReceiverFactory.hpp>
23 Implementacion por defecto de una factoria de receptores.
25 \param T Clase del receptor instanciado por esta factoria. Debe implementar el constructor
26 vacio y un metodo que devuelve el nombre de la clase con la firma:
29 static const char* className () throw ();
32 template <typename T> class ReceiverFactoryImpl : public ReceiverFactory {
37 ReceiverFactoryImpl() : ReceiverFactory(T::className()) {;}
40 Recycler<T> a_receivers;
42 Receiver* do_create() throw() { return a_receivers.create(); }
43 void do_release(Receiver* receiver) throw() { a_receivers.release(static_cast <T*>(receiver)); }