mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/csipserverstub.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     1 /*
       
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  SIP Server Stub
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "CSIPServerStub.h"
       
    20 #include <sipmessageelements.h>
       
    21 #include <sipresponseelements.h>
       
    22 #include <siprequestelements.h>
       
    23 #include <sipstrings.h>
       
    24 #include <SipStrConsts.h>
       
    25 
       
    26 
       
    27 void CSIPServerStub::OpenL ()
       
    28 	{
       
    29     CSIPServerStub* self = new (ELeave) CSIPServerStub();
       
    30     self->Reset();
       
    31     Dll::SetTls( self );
       
    32 	}
       
    33 
       
    34 void CSIPServerStub::Close ()
       
    35 	{
       
    36 	CSIPServerStub* self = Server();
       
    37     delete self;
       
    38     Dll::SetTls( NULL );
       
    39 	}
       
    40 
       
    41 	
       
    42 CSIPServerStub* CSIPServerStub::Server()
       
    43 	{
       
    44 	return static_cast<CSIPServerStub*>(Dll::Tls());
       
    45 	}
       
    46 
       
    47 
       
    48 void CSIPServerStub::ClientRequest( CSIPRequestElements* aRequest )
       
    49     {
       
    50     delete iClientRequest;
       
    51     iClientRequest = aRequest;
       
    52     }
       
    53 	
       
    54 void CSIPServerStub::ClientResponse( RStringF aMethod, CSIPResponseElements* aResponse )
       
    55     {
       
    56     iResponseToRequest = aMethod;
       
    57     delete iClientResponse;
       
    58     iClientResponse = aResponse;
       
    59     }
       
    60 
       
    61 
       
    62 void CSIPServerStub::Reset()
       
    63     {
       
    64     ClientRequest( NULL );
       
    65     ClientResponse( SIPStrings::StringF( SipStrConsts::EEmpty ), NULL );
       
    66     }
       
    67 	
       
    68 
       
    69 CSIPServerStub::~CSIPServerStub()
       
    70 	{
       
    71 	
       
    72 	delete iClientRequest;
       
    73 	delete iClientResponse;
       
    74 	
       
    75 	}
       
    76 
       
    77 
       
    78 	
       
    79 //end of file