utilities/serviceipcserver/serviceipcserverfactory.cpp
changeset 16 3c88a81ff781
equal deleted inserted replaced
14:6aeb7a756187 16:3c88a81ff781
       
     1 /**
       
     2    This file is part of CWRT package **
       
     3 
       
     4    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). **
       
     5 
       
     6    This program is free software: you can redistribute it and/or modify
       
     7    it under the terms of the GNU (Lesser) General Public License as
       
     8    published by the Free Software Foundation, version 2.1 of the License.
       
     9    This program is distributed in the hope that it will be useful, but
       
    10    WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
       
    12    (Lesser) General Public License for more details. You should have
       
    13    received a copy of the GNU (Lesser) General Public License along
       
    14    with this program. If not, see <http://www.gnu.org/licenses/>.
       
    15 */
       
    16 
       
    17 
       
    18 #include "serviceipcserverfactory.h"
       
    19 #ifndef __SYMBIAN32__
       
    20 #include "serviceipcserverlocalsocket_p.h"
       
    21 #else 
       
    22 #include "serviceipcserversymbianserver_p.h"
       
    23 #endif // __SYMBIAN32__
       
    24 namespace WRT
       
    25 {
       
    26 
       
    27 /*!
       
    28  \class ServiceFwIPCServerFactory
       
    29  Factory class to construct IPC server backend
       
    30  */
       
    31 
       
    32 /*!
       
    33  Destructor
       
    34  */
       
    35 ServiceFwIPCServerFactory::~ServiceFwIPCServerFactory()
       
    36 {
       
    37 }
       
    38 
       
    39 /*!
       
    40  Constructor
       
    41  */
       
    42 ServiceFwIPCServerFactory::ServiceFwIPCServerFactory()
       
    43 {
       
    44 }
       
    45 
       
    46 /*!
       
    47  Construct a backend 
       
    48  @param aBackend backend to construct
       
    49  @param aParent parent to this QObject
       
    50  */
       
    51 ServiceFwIPCServerPrivate* ServiceFwIPCServerFactory::createBackend(QObject* aParent,
       
    52                                                                     TServiceIPCBackends aBackend)
       
    53 {
       
    54     ServiceFwIPCServerPrivate* backend(NULL);
       
    55 
       
    56 #ifndef __SYMBIAN32__
       
    57     // Local socket is default
       
    58     if( aBackend == ELocalSocket || aBackend == EDefaultIPC )
       
    59     {
       
    60         backend = new ServiceFwIPCServerLocalSocket( aParent );
       
    61     }
       
    62 #else
       
    63     // Symbian server is default
       
    64     if (aBackend == ESymbianServer || aBackend == EDefaultIPC) {
       
    65         TRAP_IGNORE( backend = CServiceSymbianServer::NewL(); );
       
    66     }
       
    67 #endif
       
    68     return backend;
       
    69 }
       
    70 }
       
    71 // END OF FILE