1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

AK: Get rid of make_singleton function

Just default the InitFunction template argument.
This commit is contained in:
Tom 2020-08-21 11:39:30 -06:00 committed by Andreas Kling
parent 8a75e0b892
commit 5a98e329d1
31 changed files with 42 additions and 46 deletions

View file

@ -46,7 +46,7 @@
namespace Kernel {
static auto s_table = AK::make_singleton<Lockable<HashTable<IPv4Socket*>>>();
static AK::Singleton<Lockable<HashTable<IPv4Socket*>>> s_table;
Lockable<HashTable<IPv4Socket*>>& IPv4Socket::all_sockets()
{

View file

@ -38,7 +38,7 @@
namespace Kernel {
static auto s_list = AK::make_singleton<Lockable<InlineLinkedList<LocalSocket>>>();
static AK::Singleton<Lockable<InlineLinkedList<LocalSocket>>> s_list;
Lockable<InlineLinkedList<LocalSocket>>& LocalSocket::all_sockets()
{

View file

@ -29,7 +29,7 @@
namespace Kernel {
static auto s_loopback = AK::make_singleton<LoopbackAdapter>();
static AK::Singleton<LoopbackAdapter> s_loopback;
LoopbackAdapter& LoopbackAdapter::the()
{

View file

@ -38,7 +38,7 @@
namespace Kernel {
static auto s_table = AK::make_singleton<Lockable<HashTable<NetworkAdapter*>>>();
static AK::Singleton<Lockable<HashTable<NetworkAdapter*>>> s_table;
static Lockable<HashTable<NetworkAdapter*>>& all_adapters()
{

View file

@ -34,7 +34,7 @@
namespace Kernel {
static auto s_arp_table = AK::make_singleton<Lockable<HashMap<IPv4Address, MACAddress>>>();
static AK::Singleton<Lockable<HashMap<IPv4Address, MACAddress>>> s_arp_table;
Lockable<HashMap<IPv4Address, MACAddress>>& arp_table()
{

View file

@ -63,14 +63,14 @@ void TCPSocket::set_state(State new_state)
}
}
static auto s_socket_closing = AK::make_singleton<Lockable<HashMap<IPv4SocketTuple, RefPtr<TCPSocket>>>>();
static AK::Singleton<Lockable<HashMap<IPv4SocketTuple, RefPtr<TCPSocket>>>> s_socket_closing;
Lockable<HashMap<IPv4SocketTuple, RefPtr<TCPSocket>>>& TCPSocket::closing_sockets()
{
return *s_socket_closing;
}
static auto s_socket_tuples = AK::make_singleton<Lockable<HashMap<IPv4SocketTuple, TCPSocket*>>>();
static AK::Singleton<Lockable<HashMap<IPv4SocketTuple, TCPSocket*>>> s_socket_tuples;
Lockable<HashMap<IPv4SocketTuple, TCPSocket*>>& TCPSocket::sockets_by_tuple()
{

View file

@ -42,7 +42,7 @@ void UDPSocket::for_each(Function<void(const UDPSocket&)> callback)
callback(*it.value);
}
static auto s_map = AK::make_singleton<Lockable<HashMap<u16, UDPSocket*>>>();
static AK::Singleton<Lockable<HashMap<u16, UDPSocket*>>> s_map;
Lockable<HashMap<u16, UDPSocket*>>& UDPSocket::sockets_by_port()
{