ANNA Suite  2020b
Multipurpose development suite for Telco applications
ReceiverFactoryImpl.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
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 //
7 
8 
9 #ifndef anna_comm_ReceiverFactoryImpl_hpp
10 #define anna_comm_ReceiverFactoryImpl_hpp
11 
13 
15 
16 namespace anna {
17 
18 namespace comm {
19 
20 class Factory;
21 
32 template <typename T> class ReceiverFactoryImpl : public ReceiverFactory {
33 public:
37  ReceiverFactoryImpl() : ReceiverFactory(T::className()) {;}
38 
39 private:
40  Recycler<T> a_receivers;
41 
42  Receiver* do_create() { return a_receivers.create(); }
43  void do_release(Receiver* receiver) { a_receivers.release(static_cast <T*>(receiver)); }
44 };
45 
46 }
47 }
48 
49 #endif
50 
Definition: app.hpp:12