Applying syntactic sugar

This commit is contained in:
Dennis Luxen 2013-08-11 22:49:33 +02:00
parent 504817058b
commit 83f0a2c094

View File

@ -16,33 +16,31 @@ You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/agpl.txt.
Created on: 26.11.2010
Author: dennis
*/
#ifndef SERVERFACTORY_H_
#define SERVERFACTORY_H_
#include <zlib.h>
#include "Server.h"
#include "../Util/IniFile.h"
#include "../Util/OpenMPWrapper.h"
#include "../Util/OSRMException.h"
#include "../Util/SimpleLogger.h"
#include "../Util/StringUtil.h"
struct ServerFactory {
#include <zlib.h>
#include <boost/noncopyable.hpp>
struct ServerFactory : boost::noncopyable {
static Server * CreateServer( IniFile & serverConfig ) {
int threads = omp_get_num_procs();
if( serverConfig.GetParameter("IP").empty() ) {
serverConfig.SetParameter("IP", "0.0.0.0");
}
if( serverConfig.GetParameter("Port").empty() ) {
serverConfig.SetParameter("Port", "5000");
}
if(
stringToInt(serverConfig.GetParameter("Threads")) >= 1 &&
stringToInt(serverConfig.GetParameter("Threads")) <= threads
@ -52,6 +50,7 @@ struct ServerFactory {
SimpleLogger().Write() <<
"http 1.1 compression handled by zlib version " << zlibVersion();
Server * server = new Server(
serverConfig.GetParameter("IP"),
serverConfig.GetParameter("Port"),