don't inline methods containing private symbols #915

This commit is contained in:
Alex Fabijanic 2017-10-06 19:20:56 -05:00
parent 23d7d2c6cb
commit e0a5ebc06e
3 changed files with 59 additions and 59 deletions

View File

@ -397,67 +397,12 @@ private:
// inlines
//
inline void IPAddress::destruct()
{
pImpl()->~IPAddressImpl();
}
inline IPAddress::Ptr IPAddress::pImpl() const
{
return reinterpret_cast<Ptr>(const_cast<char *>(_memory.buffer));
}
inline void IPAddress::newIPv4()
{
new (storage()) Poco::Net::Impl::IPv4AddressImpl;
}
inline void IPAddress::newIPv4(const void* hostAddr)
{
new (storage()) Poco::Net::Impl::IPv4AddressImpl(hostAddr);
}
inline void IPAddress::newIPv4(unsigned prefix)
{
new (storage()) Poco::Net::Impl::IPv4AddressImpl(prefix);
}
#if defined(POCO_HAVE_IPv6)
inline void IPAddress::newIPv6()
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl;
}
inline void IPAddress::newIPv6(const void* hostAddr)
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr);
}
inline void IPAddress::newIPv6(const void* hostAddr, Poco::UInt32 scope)
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr, scope);
}
inline void IPAddress::newIPv6(unsigned prefix)
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl(prefix);
}
#endif // POCO_HAVE_IPv6
inline char* IPAddress::storage()
{
return _memory.buffer;

View File

@ -89,10 +89,10 @@ int ICMPSocketImpl::receiveFrom(void*, int, SocketAddress& address, int flags)
}
while (expected && !_icmpPacket.validReplyID(buffer.begin(), maxPacketSize));
}
catch (ICMPException&)
{
throw;
}
catch (ICMPException&)
{
throw;
}
catch (Exception&)
{
std::string err = _icmpPacket.errorDescription(buffer.begin(), maxPacketSize);

View File

@ -219,6 +219,60 @@ IPAddress::~IPAddress()
}
void IPAddress::destruct()
{
pImpl()->~IPAddressImpl();
}
void IPAddress::newIPv4()
{
new (storage()) Poco::Net::Impl::IPv4AddressImpl;
}
void IPAddress::newIPv4(const void* hostAddr)
{
new (storage()) Poco::Net::Impl::IPv4AddressImpl(hostAddr);
}
void IPAddress::newIPv4(unsigned prefix)
{
new (storage()) Poco::Net::Impl::IPv4AddressImpl(prefix);
}
#if defined(POCO_HAVE_IPv6)
void IPAddress::newIPv6()
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl;
}
void IPAddress::newIPv6(const void* hostAddr)
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr);
}
void IPAddress::newIPv6(const void* hostAddr, Poco::UInt32 scope)
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr, scope);
}
void IPAddress::newIPv6(unsigned prefix)
{
new (storage()) Poco::Net::Impl::IPv6AddressImpl(prefix);
}
#endif // POCO_HAVE_IPv6
IPAddress& IPAddress::operator = (const IPAddress& addr)
{
if (&addr != this)
@ -598,3 +652,4 @@ std::ostream& operator << (std::ostream& ostr, const Poco::Net::IPAddress& addr)
ostr << addr.toString();
return ostr;
}