explicit instantiation of compile-time flag-based functionalities #183

Signed-off-by: Stefano Fiorentino <stefano.fiore84@gmail.com>
This commit is contained in:
Stefano Fiorentino 2020-03-24 16:11:42 +01:00
parent 0fe8d7959b
commit c632869e82
2 changed files with 77 additions and 0 deletions

View File

@ -56,5 +56,24 @@ UVW_INLINE void TCPHandle::closeReset() {
invoke(&uv_tcp_close_reset, get(), &this->closeCallback); invoke(&uv_tcp_close_reset, get(), &this->closeCallback);
} }
// explicit instantiation definitions
template void TCPHandle::bind<IPv4>(std::string, unsigned int, Flags<Bind>);
template void TCPHandle::bind<IPv6>(std::string, unsigned int, Flags<Bind>);
template void TCPHandle::bind<IPv4>(Addr, Flags<Bind>);
template void TCPHandle::bind<IPv6>(Addr, Flags<Bind>);
template Addr TCPHandle::sock<IPv4>() const noexcept;
template Addr TCPHandle::sock<IPv6>() const noexcept;
template Addr TCPHandle::peer<IPv4>() const noexcept;
template Addr TCPHandle::peer<IPv6>() const noexcept;
template void TCPHandle::connect<IPv4>(std::string, unsigned int);
template void TCPHandle::connect<IPv6>(std::string, unsigned int);
template void TCPHandle::connect<IPv4>(Addr addr);
template void TCPHandle::connect<IPv6>(Addr addr);
} }

View File

@ -117,5 +117,63 @@ UVW_INLINE size_t UDPHandle::sendQueueCount() const noexcept {
return uv_udp_get_send_queue_count(get()); return uv_udp_get_send_queue_count(get());
} }
// explicit instantiation definitions
template void UDPHandle::connect<IPv4>(std::string, unsigned int);
template void UDPHandle::connect<IPv6>(std::string, unsigned int);
template void UDPHandle::connect<IPv4>(Addr);
template void UDPHandle::connect<IPv6>(Addr);
template Addr UDPHandle::peer<IPv4>() const noexcept;
template Addr UDPHandle::peer<IPv6>() const noexcept;
template void UDPHandle::bind<IPv4>(std::string, unsigned int, Flags<Bind>);
template void UDPHandle::bind<IPv6>(std::string, unsigned int, Flags<Bind>);
template void UDPHandle::bind<IPv4>(Addr, Flags<Bind>);
template void UDPHandle::bind<IPv6>(Addr, Flags<Bind>);
template Addr UDPHandle::sock<IPv4>() const noexcept;
template Addr UDPHandle::sock<IPv6>() const noexcept;
template bool UDPHandle::multicastMembership<IPv4>(std::string, std::string, Membership);
template bool UDPHandle::multicastMembership<IPv6>(std::string, std::string, Membership);
template bool UDPHandle::multicastInterface<IPv4>(std::string);
template bool UDPHandle::multicastInterface<IPv6>(std::string);
template void UDPHandle::send<IPv4>(std::string, unsigned int, std::unique_ptr<char[]>, unsigned int);
template void UDPHandle::send<IPv6>(std::string, unsigned int, std::unique_ptr<char[]>, unsigned int);
template void UDPHandle::send<IPv4>(Addr, std::unique_ptr<char[]>, unsigned int);
template void UDPHandle::send<IPv6>(Addr, std::unique_ptr<char[]>, unsigned int);
template void UDPHandle::send<IPv4>(std::string, unsigned int, char *, unsigned int);
template void UDPHandle::send<IPv6>(std::string, unsigned int, char *, unsigned int);
template void UDPHandle::send<IPv4>(Addr, char *, unsigned int);
template void UDPHandle::send<IPv6>(Addr, char *, unsigned int);
template int UDPHandle::trySend<IPv4>(const sockaddr &, std::unique_ptr<char[]>, unsigned int);
template int UDPHandle::trySend<IPv6>(const sockaddr &, std::unique_ptr<char[]>, unsigned int);
template int UDPHandle::trySend<IPv4>(std::string, unsigned int, std::unique_ptr<char[]>, unsigned int);
template int UDPHandle::trySend<IPv6>(std::string, unsigned int, std::unique_ptr<char[]>, unsigned int);
template int UDPHandle::trySend<IPv4>(Addr, std::unique_ptr<char[]>, unsigned int);
template int UDPHandle::trySend<IPv6>(Addr, std::unique_ptr<char[]>, unsigned int);
template int UDPHandle::trySend<IPv4>(const sockaddr &, char *, unsigned int);
template int UDPHandle::trySend<IPv6>(const sockaddr &, char *, unsigned int);
template int UDPHandle::trySend<IPv4>(std::string, unsigned int, char *, unsigned int);
template int UDPHandle::trySend<IPv6>(std::string, unsigned int, char *, unsigned int);
template int UDPHandle::trySend<IPv4>(Addr, char *, unsigned int);
template int UDPHandle::trySend<IPv6>(Addr, char *, unsigned int);
template void UDPHandle::recv<IPv4>();
template void UDPHandle::recv<IPv6>();
} }