qthighway/xqserviceipc/xqserviceipcserver/xqserviceipcserverfactory.cpp
branchRCL_3
changeset 10 cd2778e5acfe
parent 9 5d007b20cfd0
child 11 19a54be74e5e
equal deleted inserted replaced
9:5d007b20cfd0 10:cd2778e5acfe
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 *
       
     5 * This program is free software: you can redistribute it and/or modify
       
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 * 
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
       
    13 *
       
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
       
    17 *
       
    18 * Description:  Factory class to construct the server backend
       
    19 *
       
    20 */
       
    21 
       
    22 #include "xqservicelog.h"
       
    23 
       
    24 #include "xqserviceipcserverfactory.h"
       
    25 #ifdef __SYMBIAN32__
       
    26 #include "xqserviceipcserver_symbianserver.h"
       
    27 #include "xqserviceipcserver_apasymbianserver.h"
       
    28 #endif // __SYMBIAN32__
       
    29 namespace QtService
       
    30 {
       
    31 
       
    32 /*!
       
    33     \class ServiceFwIPCServerFactory
       
    34     \brief Factory class to construct IPC server backend
       
    35 */
       
    36 
       
    37 /*!
       
    38     Destructor.
       
    39 */
       
    40 ServiceFwIPCServerFactory::~ServiceFwIPCServerFactory()
       
    41 {
       
    42     XQSERVICE_DEBUG_PRINT("ServiceFwIPCServerFactory::~ServiceFwIPCServerFactory");
       
    43 }
       
    44 
       
    45 /*!
       
    46     Constructor.
       
    47 */
       
    48 ServiceFwIPCServerFactory::ServiceFwIPCServerFactory()
       
    49 {
       
    50     XQSERVICE_DEBUG_PRINT("ServiceFwIPCServerFactory::ServiceFwIPCServerFactory");
       
    51 }
       
    52 
       
    53 /*!
       
    54     Construct a backend.
       
    55     \param aBackend Backend to construct.
       
    56     \param aParent Parent to this QObject.
       
    57 */
       
    58 ServiceFwIPCServerPrivate* ServiceFwIPCServerFactory::createBackend(QObject* aParent,
       
    59                                                                     TServiceIPCBackends aBackend)
       
    60 {
       
    61     XQSERVICE_DEBUG_PRINT("ServiceFwIPCServerFactory::createBackend");
       
    62     XQSERVICE_DEBUG_PRINT("aBackend: %d", aBackend);
       
    63     ServiceFwIPCServerPrivate* backend(NULL);
       
    64 #ifdef __SYMBIAN32__
       
    65     // Symbian server is default
       
    66     if (aBackend == ESymbianServer || aBackend == EDefaultIPC) {
       
    67         TRAP_IGNORE( backend = CServiceSymbianServer::NewL(); );
       
    68 	}
       
    69     if (aBackend == ESymbianApaServer) {
       
    70         TRAP_IGNORE( backend = CApaSymbianServer::NewL(); );
       
    71 	}
       
    72 #endif
       
    73     return backend;
       
    74     }
       
    75 }
       
    76 // END OF FILE