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_TransportFactoryImpl_hpp
10 #define anna_comm_TransportFactoryImpl_hpp
12 #include <anna/core/util/Recycler.hpp>
14 #include <anna/comm/TransportFactory.hpp>
23 Transport factory implementation
25 template <typename T> class TransportFactoryImpl : public TransportFactory {
30 TransportFactoryImpl() : TransportFactory(T::className()) {;}
33 Recycler <T> a_transports;
35 Transport* create() throw() {
36 Transport* result = static_cast <Transport*>(a_transports.create());
39 if((overQuotaSize = TransportFactory::getOverQuotaSize()) != 0)
40 result->setOverQuotaSize(overQuotaSize);
44 void release(Transport* transport) throw() { a_transports.release(static_cast <T*>(transport)); }