taskswitcher/server/src/tsmodelitemkey.cpp
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 #include "tsmodelitemkey.h"
       
    18 // -----------------------------------------------------------------------------
       
    19 TInt TTsModelItemKey::size()
       
    20 {
       
    21     return sizeof(TInt) * 2;
       
    22 }
       
    23 // -----------------------------------------------------------------------------
       
    24 TTsModelItemKey::TTsModelItemKey()
       
    25 :
       
    26     mKey(0),
       
    27     mRoot(0)
       
    28 {}
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 TTsModelItemKey::TTsModelItemKey(TTsKey key, TInt root)
       
    32 :
       
    33     mKey(key),
       
    34     mRoot(root)
       
    35 {}
       
    36 
       
    37 // -----------------------------------------------------------------------------
       
    38 TTsModelItemKey::TTsModelItemKey(const TTsModelItemKey &key)
       
    39 :
       
    40     mKey(key.mKey),
       
    41     mRoot(key.mRoot)
       
    42 {}
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 TTsModelItemKey& TTsModelItemKey::operator =(const TTsModelItemKey& key)
       
    46 {
       
    47     mKey = key.mKey;
       
    48     mRoot = key.mRoot;
       
    49     return (*this);
       
    50 }
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 TBool TTsModelItemKey::operator == (const TTsModelItemKey key) const
       
    54 {
       
    55     return ( mKey == key.mKey && mRoot == key.mRoot);
       
    56 }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 TInt TTsModelItemKey::key() const
       
    60 {
       
    61     return mKey;
       
    62 }
       
    63 
       
    64 // -----------------------------------------------------------------------------
       
    65 void TTsModelItemKey::ExternalizeL(RWriteStream& stream) const
       
    66 {
       
    67     stream.WriteInt32L(mKey);
       
    68     stream.WriteInt32L(mRoot);
       
    69 }
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 void TTsModelItemKey::InternalizeL(RReadStream& stream)
       
    73 {
       
    74     mKey = stream.ReadInt32L();
       
    75     mRoot = stream.ReadInt32L();
       
    76 }