cbs/CbsServer/McnClientSrc/CMcnTopicArray.cpp
changeset 0 ff3b6d0fd310
child 19 7d48bed6ce0c
equal deleted inserted replaced
-1:000000000000 0:ff3b6d0fd310
       
     1 /*
       
     2 * Copyright (c) 2003 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:  Implementation of the class CMcnTopicArray.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include "CMcnTopicArray.h"
       
    23 
       
    24 // CONSTANTS
       
    25 
       
    26 const TInt KInitialSpaceForTopicEntries = 3;
       
    27 
       
    28 // ================= MEMBER FUNCTIONS =======================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CMcnTopicArray::CMcnTopicArray
       
    32 // C++ default constructor can NOT contain any code, that
       
    33 // might leave.
       
    34 // -----------------------------------------------------------------------------
       
    35 //
       
    36 CMcnTopicArray::CMcnTopicArray()
       
    37     {
       
    38     }
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // CMcnTopicArray::ConstructL
       
    42 // Symbian 2nd phase constructor can leave.
       
    43 // -----------------------------------------------------------------------------
       
    44 //
       
    45 void CMcnTopicArray::ConstructL()
       
    46     {
       
    47     iTopicList = new ( ELeave ) CArrayFixFlat< TUint >
       
    48         ( KInitialSpaceForTopicEntries );
       
    49     }
       
    50     
       
    51 // -----------------------------------------------------------------------------
       
    52 // CMcnTopicArray::NewL
       
    53 // Two-phased constructor.
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 EXPORT_C CMcnTopicArray* CMcnTopicArray::NewL()
       
    57     {
       
    58     CMcnTopicArray* self = new ( ELeave ) CMcnTopicArray();
       
    59     CleanupStack::PushL( self );
       
    60     self->ConstructL();
       
    61     CleanupStack::Pop();
       
    62     return self;
       
    63     }
       
    64 
       
    65     
       
    66 // Destructor
       
    67 CMcnTopicArray::~CMcnTopicArray()
       
    68     {
       
    69     delete iTopicList;
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CMcnTopicArray::AddCbTopicL
       
    74 // Adds a single CB topic to the topic list.
       
    75 // (other items were commented in a header).
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 EXPORT_C void CMcnTopicArray::AddCbTopicL( 
       
    79     TUint16 aTopicNumber )
       
    80     {
       
    81     iTopicList->AppendL( aTopicNumber );
       
    82     }
       
    83 
       
    84 // -----------------------------------------------------------------------------
       
    85 // CMcnTopicArray::EnumerateEntries
       
    86 // Returns the number of topic entries in parameter aEntries.
       
    87 // (other items were commented in a header).
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 void CMcnTopicArray::EnumerateEntries( 
       
    91     TUint& aEntries ) const
       
    92     {
       
    93     aEntries = iTopicList->Count();
       
    94     }
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CMcnTopicArray::GetTopicNumber
       
    98 // Returns the topicnumber in aTopicNumber corresponding to the index
       
    99 // given in aIndex.
       
   100 // (other items were commented in a header).
       
   101 // -----------------------------------------------------------------------------
       
   102 //
       
   103 EXPORT_C void CMcnTopicArray::GetTopicNumber( 
       
   104     const TUint& aIndex, 
       
   105     TUint& aTopicNumber ) const
       
   106     {
       
   107     aTopicNumber = iTopicList->At( aIndex );
       
   108     }
       
   109 
       
   110 //  End of File