locationtriggering/ltclientlib/src/lbtgeogsmcell.cpp
changeset 0 667063e416a2
child 20 2b4ea9893b66
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Definition of geo gsm cell class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "lbtgeogsmcell.h"
       
    20 
       
    21 
       
    22 // ================= LOCAL FUNCTIONS ========================
       
    23  
       
    24 // ================= MEMBER FUNCTIONS =======================
       
    25 // ---------------------------------------------------------------------------
       
    26 // CLbtGeoGsmCell::NewLC()
       
    27 //
       
    28 // (other items were commented in a header).
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 EXPORT_C CLbtGeoGsmCell* CLbtGeoGsmCell::NewLC()
       
    32     {
       
    33     CLbtGeoGsmCell* self = CLbtGeoGsmCell::NewL();
       
    34     CleanupStack::Pop( self );
       
    35     return self;
       
    36     }
       
    37     
       
    38 // ---------------------------------------------------------------------------
       
    39 // CLbtGeoGsmCell::NewL()
       
    40 //
       
    41 // (other items were commented in a header).
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 EXPORT_C CLbtGeoGsmCell* CLbtGeoGsmCell::NewL()
       
    45     {
       
    46     CLbtGeoGsmCell* self = new( ELeave ) CLbtGeoGsmCell;
       
    47     CleanupStack::PushL( self );
       
    48     self->ConstructL();
       
    49     CleanupStack::Pop( self );
       
    50     return self;
       
    51     }    
       
    52     
       
    53 // ---------------------------------------------------------------------------
       
    54 // CLbtGeoGsmCell::NewL()
       
    55 //
       
    56 // (other items were commented in a header).
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 EXPORT_C CLbtGeoGsmCell* CLbtGeoGsmCell::NewL(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
       
    60                                         RMobilePhone::TMobilePhoneNetworkCountryCode aCountryCode,
       
    61                                         RMobilePhone::TMobilePhoneNetworkIdentity aNetworkId,
       
    62                                         TUint aLocationAreaCode,
       
    63                                         TUint aCellId)
       
    64     {
       
    65     CLbtGeoGsmCell* self = CLbtGeoGsmCell::NewLC(aNetworkType,aCountryCode,aNetworkId,aLocationAreaCode,
       
    66                                                  aCellId);
       
    67     CleanupStack::Pop( self );
       
    68     return self;
       
    69     }  
       
    70     
       
    71 // ---------------------------------------------------------------------------
       
    72 // CLbtGeoGsmCell::NewLC()
       
    73 //
       
    74 // (other items were commented in a header).
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 EXPORT_C CLbtGeoGsmCell* CLbtGeoGsmCell::NewLC(RMobilePhone::TMobilePhoneNetworkMode aNetworkType,
       
    78                                          RMobilePhone::TMobilePhoneNetworkCountryCode aCountryCode,
       
    79                                          RMobilePhone::TMobilePhoneNetworkIdentity aNetworkId,
       
    80                                          TUint aLocationAreaCode,
       
    81                                          TUint aCellId)
       
    82     {
       
    83     CLbtGeoGsmCell* self = new( ELeave ) CLbtGeoGsmCell();
       
    84     CleanupStack::PushL( self );
       
    85     self->ConstructL( aNetworkType,aCountryCode,aNetworkId,aLocationAreaCode,aCellId);
       
    86     return self;
       
    87     }     
       
    88     
       
    89 // ---------------------------------------------------------------------------
       
    90 // CLbtGeoGsmCell::CLbtGeoGsmCell()
       
    91 //
       
    92 // Default constructor
       
    93 // ---------------------------------------------------------------------------
       
    94 //
       
    95 CLbtGeoGsmCell::CLbtGeoGsmCell()
       
    96     {
       
    97                                  
       
    98     }   
       
    99     
       
   100 // ---------------------------------------------------------------------------
       
   101 // CLbtGeoGsmCell::~CLbtGeoGsmCell()
       
   102 //
       
   103 // Destructor.
       
   104 // ---------------------------------------------------------------------------
       
   105 //
       
   106 EXPORT_C CLbtGeoGsmCell::~CLbtGeoGsmCell()
       
   107     {
       
   108     iBsicArray.Close();
       
   109     }  
       
   110 
       
   111      
       
   112     
       
   113     
       
   114 // ---------------------------------------------------------------------------
       
   115 // CLbtGeoGsmCell::SetBsic()
       
   116 //
       
   117 // (other items were commented in a header).
       
   118 // ---------------------------------------------------------------------------
       
   119 //    
       
   120 EXPORT_C void CLbtGeoGsmCell::SetBsic( RArray<TInt>& aBsicArray )
       
   121     {
       
   122     for( TInt i=0;i<aBsicArray.Count();i++ )
       
   123         {
       
   124         iBsicArray.Append( aBsicArray[i] );
       
   125         }
       
   126     }
       
   127     
       
   128 // ---------------------------------------------------------------------------
       
   129 // CLbtGeoGsmCell::Bsic()
       
   130 //
       
   131 // (other items were commented in a header).
       
   132 // ---------------------------------------------------------------------------
       
   133 //    
       
   134 EXPORT_C RArray<TInt>&  CLbtGeoGsmCell::Bsic()
       
   135     {
       
   136     return iBsicArray;
       
   137     }    
       
   138 
       
   139 // ---------------------------------------------------------------------------
       
   140 // CLbtGeoGsmCell::CGISpecifiedDuringCreation()
       
   141 //
       
   142 // (other items were commented in a header).
       
   143 // ---------------------------------------------------------------------------
       
   144 //
       
   145 EXPORT_C TBool CLbtGeoGsmCell::CGISpecifiedDuringCreation() const
       
   146     {
       
   147     return EFalse;
       
   148     }
       
   149     
       
   150 // ---------------------------------------------------------------------------
       
   151 // CLbtGeoGsmCell::DoExternalizeL()
       
   152 //
       
   153 // (other items were commented in a header).
       
   154 // ---------------------------------------------------------------------------
       
   155 //    
       
   156 void CLbtGeoGsmCell::DoExternalizeL(RWriteStream& aStream) const 
       
   157     {
       
   158     CLbtGeoCell::DoExternalizeL( aStream );
       
   159     TInt count = iBsicArray.Count();
       
   160     aStream.WriteInt32L( count ); 
       
   161     for( TInt i=0;i<count;i++ )
       
   162         {
       
   163 	    aStream.WriteInt32L( iBsicArray[i] );
       
   164 	    }
       
   165     }
       
   166     
       
   167 // ---------------------------------------------------------------------------
       
   168 // CLbtGeoGsmCell::DoInternalizeL()
       
   169 //
       
   170 // (other items were commented in a header).
       
   171 // ---------------------------------------------------------------------------
       
   172 //    
       
   173 void CLbtGeoGsmCell::DoInternalizeL(RReadStream& aStream)
       
   174     {
       
   175     CLbtGeoCell::DoInternalizeL( aStream );
       
   176     TInt count = aStream.ReadInt32L();
       
   177     for( TInt i=0;i<count;i++ )
       
   178         {
       
   179         iBsicArray.Append( aStream.ReadInt32L() );
       
   180         }
       
   181     }
       
   182     
       
   183