zeroconf/cachemanager/src/ccacheentry.cpp
changeset 14 da856f45b798
equal deleted inserted replaced
12:78fbd574edf4 14:da856f45b798
       
     1 /*
       
     2 * Copyright (c) 2010 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 
       
    18 
       
    19 
       
    20 #include "ccacheentry.h"
       
    21 
       
    22 EXPORT_C CCacheEntry* CCacheEntry::NewL()
       
    23 	{
       
    24 	CCacheEntry* self = CCacheEntry::NewLC();
       
    25 	CleanupStack::Pop(self);
       
    26 	return self;
       
    27 	}
       
    28 
       
    29 EXPORT_C CCacheEntry* CCacheEntry::NewLC()
       
    30 	{
       
    31 	CCacheEntry* self = new (ELeave)CCacheEntry();
       
    32 	CleanupStack::PushL(self);
       
    33 	self->ConstructL();
       
    34 	return self;
       
    35 	}
       
    36 
       
    37 void CCacheEntry::ConstructL()
       
    38 	{	
       
    39 	
       
    40 	}
       
    41 
       
    42 CCacheEntry::CCacheEntry()
       
    43 	{
       
    44 	
       
    45 	}
       
    46 
       
    47 CCacheEntry::~CCacheEntry()
       
    48 	{
       
    49 	delete iAddressRecord;
       
    50 	delete iServiceRecord;
       
    51 	delete iPtrRecord;
       
    52 	delete iTxtRecord;
       
    53 	}
       
    54 
       
    55 EXPORT_C void CCacheEntry::SetAddressRecord(CRdTypeA* aAddRecord)
       
    56 	{
       
    57 	iAddressRecord = aAddRecord;
       
    58 	}
       
    59 	
       
    60 EXPORT_C void CCacheEntry::SetServiceRecord(CRdTypeSrv* aSrvRecord)
       
    61 	{
       
    62 	iServiceRecord = aSrvRecord;
       
    63 	}
       
    64 	
       
    65 EXPORT_C void CCacheEntry::SetPtrRecord(CRdTypePtr* aPtrRecord)
       
    66 	{
       
    67 	iPtrRecord = aPtrRecord;
       
    68 	}
       
    69 
       
    70 EXPORT_C void CCacheEntry::SetTxtRecord(CRdTypeTxt* aTxtRecord)
       
    71 	{
       
    72 	iTxtRecord = aTxtRecord;
       
    73 	}
       
    74 
       
    75 EXPORT_C CRdTypeA* CCacheEntry::AddressRecord()const
       
    76 	{
       
    77 	return iAddressRecord;
       
    78 	}
       
    79 
       
    80 EXPORT_C CRdTypeSrv* CCacheEntry::ServiceRecord()const
       
    81 	{
       
    82 	return iServiceRecord;
       
    83 	}
       
    84 
       
    85 EXPORT_C CRdTypePtr* CCacheEntry::PtrRecord()const
       
    86 	{
       
    87 	return iPtrRecord;
       
    88 	}
       
    89 
       
    90 EXPORT_C CRdTypeTxt* CCacheEntry::TxtRecord()const
       
    91 	{
       
    92 	return iTxtRecord;
       
    93 	}
       
    94 
       
    95 EXPORT_C TBool CCacheEntry::IsAuthoritative()const
       
    96 	{
       
    97 	return iAuthoritative;
       
    98 	}
       
    99 
       
   100 EXPORT_C void CCacheEntry::SetAuthoritative(TBool aAuthoritative)
       
   101 	{
       
   102 	iAuthoritative = aAuthoritative;
       
   103 	}
       
   104 	
       
   105 EXPORT_C void CCacheEntry::SetSessionId(TUint32 aSessionId)
       
   106 	{
       
   107 	iSessionId = aSessionId;
       
   108 	}
       
   109 	
       
   110 EXPORT_C TUint32 CCacheEntry::SessionId()const
       
   111 	{
       
   112 	return iSessionId;
       
   113 	}
       
   114 
       
   115 void CCacheEntry::SetEntryExpired(TBool aEntryExpired)
       
   116 	{
       
   117 	iEntryExpired = aEntryExpired;
       
   118 	}
       
   119 	
       
   120 EXPORT_C  TBool CCacheEntry::EntryExpired()const
       
   121 	{
       
   122 	return iEntryExpired;
       
   123 	}
       
   124 
       
   125