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_handler_Manager_hpp
10 #define anna_comm_handler_Manager_hpp
12 #include <anna/core/Singleton.hpp>
13 #include <anna/core/util/Recycler.hpp>
15 #include <anna/comm/handler/Allocator.hpp>
16 #include <anna/comm/handler/BinderSocket.hpp>
17 #include <anna/comm/handler/ServerSocket.hpp>
18 #include <anna/comm/handler/LocalConnection.hpp>
19 #include <anna/comm/handler/RemoteConnection.hpp>
20 #include <anna/comm/handler/DatagramSocket.hpp>
21 #include <anna/comm/handler/ClientSocket.hpp>
32 class Manager : public Singleton <Manager> {
34 typedef handler::Allocator <handler::BinderSocket> BinderSocketAllocator;
35 typedef handler::Allocator <handler::ServerSocket> ServerSocketAllocator;
36 typedef handler::Allocator <handler::LocalConnection> LocalConnectionAllocator;
37 typedef handler::Allocator <handler::RemoteConnection> RemoteConnectionAllocator;
38 typedef handler::Allocator <handler::DatagramSocket> DatagramSocketAllocator;
39 typedef handler::Allocator <handler::ClientSocket> ClientSocketAllocator;
41 void initialize(Communicator*) throw();
43 comm::Handler* createHandler(comm::BinderSocket*) throw(RuntimeException);
44 comm::Handler* createHandler(comm::ServerSocket*) throw(RuntimeException);
45 comm::Handler* createHandler(comm::LocalConnection*) throw(RuntimeException);
46 comm::Handler* createHandler(comm::RemoteConnection*) throw(RuntimeException);
47 comm::Handler* createHandler(comm::DatagramSocket*) throw(RuntimeException);
48 comm::Handler* createHandler(comm::ClientSocket*) throw(RuntimeException);
50 void releaseHandler(Handler*) throw();
53 Recycler <handler::BinderSocket, BinderSocketAllocator> a_binderSockets;
54 Recycler <handler::ServerSocket, ServerSocketAllocator> a_serverSockets;
55 Recycler <handler::LocalConnection, LocalConnectionAllocator> a_localConnections;
56 Recycler <handler::RemoteConnection, RemoteConnectionAllocator> a_remoteConnections;
57 Recycler <handler::DatagramSocket, DatagramSocketAllocator> a_datagramSockets;
58 Recycler <handler::ClientSocket, ClientSocketAllocator> a_clientSockets;
61 Manager(const Manager&);
63 friend class Singleton <Manager>;