mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 08:31:43 +02:00
replaced plain pointers with smart pointers in various interfaces
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPServer.cpp
|
||||
//
|
||||
// $Id: //poco/svn/Net/src/HTTPServer.cpp#2 $
|
||||
// $Id: //poco/Main/Net/src/HTTPServer.cpp#7 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTPServer
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
|
||||
#include "Poco/Net/HTTPServer.h"
|
||||
#include "Poco/Net/HTTPServerParams.h"
|
||||
#include "Poco/Net/HTTPServerConnectionFactory.h"
|
||||
|
||||
|
||||
@@ -43,13 +42,13 @@ namespace Poco {
|
||||
namespace Net {
|
||||
|
||||
|
||||
HTTPServer::HTTPServer(HTTPRequestHandlerFactory* pFactory, const ServerSocket& socket, HTTPServerParams* pParams):
|
||||
HTTPServer::HTTPServer(HTTPRequestHandlerFactory::Ptr pFactory, const ServerSocket& socket, HTTPServerParams::Ptr pParams):
|
||||
TCPServer(new HTTPServerConnectionFactory(pParams, pFactory), socket, pParams)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
HTTPServer::HTTPServer(HTTPRequestHandlerFactory* pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, HTTPServerParams* pParams):
|
||||
HTTPServer::HTTPServer(HTTPRequestHandlerFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, HTTPServerParams::Ptr pParams):
|
||||
TCPServer(new HTTPServerConnectionFactory(pParams, pFactory), threadPool, socket, pParams)
|
||||
{
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPServerConnection.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPServerConnection.cpp#11 $
|
||||
// $Id: //poco/Main/Net/src/HTTPServerConnection.cpp#12 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTPServer
|
||||
@@ -40,7 +40,6 @@
|
||||
#include "Poco/Net/HTTPServerResponseImpl.h"
|
||||
#include "Poco/Net/HTTPRequestHandler.h"
|
||||
#include "Poco/Net/HTTPRequestHandlerFactory.h"
|
||||
#include "Poco/Net/HTTPServerParams.h"
|
||||
#include "Poco/Net/NetException.h"
|
||||
#include "Poco/NumberFormatter.h"
|
||||
#include "Poco/Timestamp.h"
|
||||
@@ -51,21 +50,17 @@ namespace Poco {
|
||||
namespace Net {
|
||||
|
||||
|
||||
HTTPServerConnection::HTTPServerConnection(const StreamSocket& socket, HTTPServerParams* pParams, HTTPRequestHandlerFactory* pFactory):
|
||||
HTTPServerConnection::HTTPServerConnection(const StreamSocket& socket, HTTPServerParams::Ptr pParams, HTTPRequestHandlerFactory::Ptr pFactory):
|
||||
TCPServerConnection(socket),
|
||||
_pParams(pParams),
|
||||
_pFactory(pFactory)
|
||||
{
|
||||
poco_check_ptr (pFactory);
|
||||
poco_check_ptr (pParams);
|
||||
|
||||
_pParams->duplicate();
|
||||
}
|
||||
|
||||
|
||||
HTTPServerConnection::~HTTPServerConnection()
|
||||
{
|
||||
_pParams->release();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPServerConnectionFactory.cpp
|
||||
//
|
||||
// $Id: //poco/svn/Net/src/HTTPServerConnectionFactory.cpp#2 $
|
||||
// $Id: //poco/Main/Net/src/HTTPServerConnectionFactory.cpp#7 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTPServer
|
||||
@@ -36,7 +36,6 @@
|
||||
|
||||
#include "Poco/Net/HTTPServerConnectionFactory.h"
|
||||
#include "Poco/Net/HTTPServerConnection.h"
|
||||
#include "Poco/Net/HTTPServerParams.h"
|
||||
#include "Poco/Net/HTTPRequestHandlerFactory.h"
|
||||
|
||||
|
||||
@@ -44,21 +43,16 @@ namespace Poco {
|
||||
namespace Net {
|
||||
|
||||
|
||||
HTTPServerConnectionFactory::HTTPServerConnectionFactory(HTTPServerParams* pParams, HTTPRequestHandlerFactory* pFactory):
|
||||
HTTPServerConnectionFactory::HTTPServerConnectionFactory(HTTPServerParams::Ptr pParams, HTTPRequestHandlerFactory::Ptr pFactory):
|
||||
_pParams(pParams),
|
||||
_pFactory(pFactory)
|
||||
{
|
||||
poco_check_ptr (pParams);
|
||||
poco_check_ptr (pFactory);
|
||||
|
||||
_pParams->duplicate();
|
||||
}
|
||||
|
||||
|
||||
HTTPServerConnectionFactory::~HTTPServerConnectionFactory()
|
||||
{
|
||||
_pParams->release();
|
||||
delete _pFactory;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// NetworkInterface.cpp
|
||||
//
|
||||
// $Id: //poco/1.3/Net/src/NetworkInterface.cpp#9 $
|
||||
// $Id: //poco/Main/Net/src/NetworkInterface.cpp#23 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: Sockets
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// TCPServer.cpp
|
||||
//
|
||||
// $Id: //poco/svn/Net/src/TCPServer.cpp#3 $
|
||||
// $Id: //poco/Main/Net/src/TCPServer.cpp#12 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: TCPServer
|
||||
@@ -50,7 +50,7 @@ namespace Poco {
|
||||
namespace Net {
|
||||
|
||||
|
||||
TCPServer::TCPServer(TCPServerConnectionFactory* pFactory, const ServerSocket& socket, TCPServerParams* pParams):
|
||||
TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, const ServerSocket& socket, TCPServerParams::Ptr pParams):
|
||||
_socket(socket),
|
||||
_pDispatcher(new TCPServerDispatcher(pFactory, Poco::ThreadPool::defaultPool(), pParams)),
|
||||
_thread(threadName(socket)),
|
||||
@@ -59,7 +59,7 @@ TCPServer::TCPServer(TCPServerConnectionFactory* pFactory, const ServerSocket& s
|
||||
}
|
||||
|
||||
|
||||
TCPServer::TCPServer(TCPServerConnectionFactory* pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams* pParams):
|
||||
TCPServer::TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams::Ptr pParams):
|
||||
_socket(socket),
|
||||
_pDispatcher(new TCPServerDispatcher(pFactory, threadPool, pParams)),
|
||||
_thread(threadName(socket)),
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// TCPServerDispatcher.cpp
|
||||
//
|
||||
// $Id: //poco/svn/Net/src/TCPServerDispatcher.cpp#2 $
|
||||
// $Id: //poco/Main/Net/src/TCPServerDispatcher.cpp#10 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: TCPServer
|
||||
@@ -36,7 +36,6 @@
|
||||
|
||||
#include "Poco/Net/TCPServerDispatcher.h"
|
||||
#include "Poco/Net/TCPServerConnectionFactory.h"
|
||||
#include "Poco/Net/TCPServerParams.h"
|
||||
#include "Poco/Notification.h"
|
||||
#include "Poco/AutoPtr.h"
|
||||
#include <memory>
|
||||
@@ -73,7 +72,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
TCPServerDispatcher::TCPServerDispatcher(TCPServerConnectionFactory* pFactory, Poco::ThreadPool& threadPool, TCPServerParams* pParams):
|
||||
TCPServerDispatcher::TCPServerDispatcher(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, TCPServerParams::Ptr pParams):
|
||||
_rc(1),
|
||||
_pParams(pParams),
|
||||
_currentThreads(0),
|
||||
@@ -97,8 +96,6 @@ TCPServerDispatcher::TCPServerDispatcher(TCPServerConnectionFactory* pFactory, P
|
||||
|
||||
TCPServerDispatcher::~TCPServerDispatcher()
|
||||
{
|
||||
_pParams->release();
|
||||
delete _pConnectionFactory;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user