locationtriggering/ltclientlib/src/lbtterminalptrholder.cpp
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Pointer holder for client's data
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "lbtterminalptrholder.h" 
       
    20 
       
    21 // ---------------------------------------------------------------------------
       
    22 // CLbtSubSessnPtrHolder::NewL()
       
    23 //
       
    24 // (other items were commented in a header).
       
    25 // ---------------------------------------------------------------------------
       
    26 // 
       
    27 EXPORT_C CLbtSubSessnPtrHolder* CLbtSubSessnPtrHolder::NewL(TInt aNumberOfPtrs,
       
    28                                                             TInt aNumberOfPtrCs)
       
    29 	{
       
    30 	CLbtSubSessnPtrHolder* self = new (ELeave) CLbtSubSessnPtrHolder;
       
    31 	CleanupStack::PushL(self);
       
    32 	self->ConstructL(aNumberOfPtrs, aNumberOfPtrCs);
       
    33 	CleanupStack::Pop(self);
       
    34 	return self;
       
    35 	}
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // CLbtSubSessnPtrHolder::ConstructL()
       
    39 // Symbian 2nd phase constructor can leave.
       
    40 // ---------------------------------------------------------------------------
       
    41 // 
       
    42 EXPORT_C void CLbtSubSessnPtrHolder::ConstructL(TInt aNumberOfPtrs,
       
    43                                                 TInt aNumberOfPtrCs)
       
    44 	{
       
    45 	TPtr8 ptr(NULL, 100);
       
    46 	TInt i;
       
    47 	for (i = 0; i < aNumberOfPtrs; i++)
       
    48 		{
       
    49 		User::LeaveIfError(iPtrArray.Append(ptr));
       
    50 		}
       
    51 
       
    52 	TPtrC8 ptrC(NULL, 100);
       
    53 	for (i = 0; i < aNumberOfPtrCs; i++)
       
    54 		{
       
    55 		User::LeaveIfError(iPtrCArray.Append(ptrC));
       
    56 		}
       
    57 	}
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // CLbtSubSessnPtrHolder::~CLbtSubSessnPtrHolder()
       
    61 // Destructor
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 EXPORT_C CLbtSubSessnPtrHolder::~CLbtSubSessnPtrHolder()
       
    65 	{
       
    66 	iPtrCArray.Close();
       
    67 	iPtrArray.Close();
       
    68 	}
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CLbtTriggerConditionArea::Ptr()
       
    72 //
       
    73 // (other items were commented in a header).
       
    74 // ---------------------------------------------------------------------------
       
    75 //
       
    76 EXPORT_C TPtr8& CLbtSubSessnPtrHolder::Ptr(TInt aIndex)
       
    77 	{
       
    78 	return iPtrArray[aIndex];
       
    79 	}
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // CLbtTriggerConditionArea::PtrC()
       
    83 //
       
    84 // (other items were commented in a header).
       
    85 // ---------------------------------------------------------------------------
       
    86 //
       
    87 EXPORT_C TPtrC8& CLbtSubSessnPtrHolder::PtrC(TInt aIndex)
       
    88 	{
       
    89 	return iPtrCArray[aIndex];
       
    90 	}
       
    91 
       
    92