realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/CSIPRegistrationElement.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name          : CSIPRegistrationElement.cpp
       
    15 // Part of       : ProfileAgent
       
    16 // Version       : SIP/4.0
       
    17 //
       
    18 
       
    19 
       
    20 
       
    21 #include "sipregistrationelement.h"
       
    22 #include "sipcontactelement.h"
       
    23 
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CSIPRegistrationElement::NewL
       
    27 // -----------------------------------------------------------------------------
       
    28 //
       
    29 CSIPRegistrationElement* CSIPRegistrationElement::NewL()
       
    30 	{
       
    31 	CSIPRegistrationElement* self = new( ELeave ) CSIPRegistrationElement;
       
    32 	CleanupStack::PushL( self );
       
    33 	self->ConstructL();
       
    34 	CleanupStack::Pop();
       
    35 	return self;
       
    36 	}
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CSIPRegistrationElement::~CSIPRegistrationElement
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CSIPRegistrationElement::~CSIPRegistrationElement()
       
    43 	{
       
    44 	iContactElements.ResetAndDestroy();
       
    45 	iState.Close();
       
    46 	delete iAOR;
       
    47 	}
       
    48 
       
    49 // -----------------------------------------------------------------------------
       
    50 // CSIPRegistrationElement::ConstructL
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 void CSIPRegistrationElement::ConstructL()
       
    54 	{
       
    55 	iAOR = CUri8::NewL();
       
    56 	}
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CSIPRegistrationElement::CSIPRegistrationElement
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CSIPRegistrationElement::CSIPRegistrationElement()
       
    63 	{
       
    64 	}
       
    65 
       
    66 // -----------------------------------------------------------------------------
       
    67 // CSIPRegistrationElement::ContactElements
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 RPointerArray< CSIPContactElement >& CSIPRegistrationElement::ContactElements()
       
    71 	{
       
    72 	return iContactElements;
       
    73 	}
       
    74 
       
    75 // -----------------------------------------------------------------------------
       
    76 // CSIPRegistrationElement::SetAORL
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 void CSIPRegistrationElement::SetAORL( CUri8* aUri )
       
    80 	{
       
    81 	__ASSERT_ALWAYS( aUri, User::Leave( KErrCorrupt ) );
       
    82 	delete iAOR;
       
    83 	iAOR = aUri;
       
    84 	}
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // CSIPRegistrationElement::AOR
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 const CUri8& CSIPRegistrationElement::AOR() const
       
    91 	{
       
    92 	return *iAOR;
       
    93 	}
       
    94 	
       
    95 // -----------------------------------------------------------------------------
       
    96 // CSIPRegistrationElement::SetState
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 void CSIPRegistrationElement::SetState( RString aState )
       
   100 	{
       
   101 	iState.Close();
       
   102 	iState = aState.Copy();
       
   103 	}
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // CSIPRegistrationElement::State
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 RString CSIPRegistrationElement::State() const
       
   110 	{
       
   111 	return iState;
       
   112 	}