realtimenetprots/sipfw/SigComp/CompDeflate/src/SigCompDeflateContext.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Name        : CSigCompDeflateContext.cpp
       
    15 // Part of     : CDeflateComp
       
    16 // Interface   : 
       
    17 // compression context
       
    18 // Version     : 1.0
       
    19 //
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <badesca.h>
       
    26 #include "SigCompDeflateContext.h"
       
    27 #include "DeflateComp.h"
       
    28 
       
    29 CSigCompDeflateContext::CSigCompDeflateContext()
       
    30     {
       
    31     iUploadState = EFalse;
       
    32     iBytecodeStateConfirmed = EFalse;
       
    33     iCBStateConfirmed = EFalse;
       
    34     iDecompressionMemorySize = 2048;
       
    35     iStateMemorySize = 2048;
       
    36     iUdvmSize = 0;
       
    37     iCBSize = 0;
       
    38     }
       
    39 
       
    40 CSigCompDeflateContext::~CSigCompDeflateContext()
       
    41     {
       
    42     delete iWindow;
       
    43     }
       
    44 
       
    45 void CSigCompDeflateContext::SetWindowSize(TInt aWindowSize)
       
    46     {
       
    47     iWindowSize = aWindowSize;
       
    48     }
       
    49 
       
    50 TInt CSigCompDeflateContext::WindowSize()
       
    51     {
       
    52     return iWindowSize;
       
    53     }
       
    54 
       
    55 void CSigCompDeflateContext::SetCurrentPosition(TInt aCurrentPosition)
       
    56     {
       
    57     iCurrentPosition = aCurrentPosition;
       
    58     }
       
    59 
       
    60 TInt CSigCompDeflateContext::CurrentPosition()
       
    61     {
       
    62     return iCurrentPosition;
       
    63     }
       
    64 
       
    65 void CSigCompDeflateContext::SetWindow(CArrayFixFlat<TUint8>* aWindow)
       
    66     {
       
    67     delete iWindow;
       
    68     iWindow = aWindow;
       
    69     }
       
    70 
       
    71 CArrayFixFlat<TUint8>* CSigCompDeflateContext::Window()
       
    72     {
       
    73     return iWindow;
       
    74     }
       
    75 
       
    76 void CSigCompDeflateContext::SetCBStateHash(const TUint8* aHash)
       
    77     {
       
    78     Mem::Copy(iCBStateHash, aHash, KMinPartialStateLength);
       
    79     }
       
    80 
       
    81 void CSigCompDeflateContext::SetBytecodeHash(const TUint8* aHash)
       
    82     {
       
    83     Mem::Copy(iBytecodeStateHash, aHash, KMinPartialStateLength);
       
    84     }
       
    85 
       
    86 const TUint8* CSigCompDeflateContext::CBStateHash() const
       
    87     {
       
    88     return iCBStateHash;
       
    89     }
       
    90 
       
    91 const TUint8* CSigCompDeflateContext::BytecodeHash() const
       
    92     {
       
    93     return iBytecodeStateHash;
       
    94     }
       
    95 
       
    96 void CSigCompDeflateContext::SetCBStateLength(TInt aLength)
       
    97     {
       
    98     iCBStateLength = aLength;
       
    99     }
       
   100 
       
   101 TInt CSigCompDeflateContext::CBStateLength() const
       
   102     {
       
   103     return iCBStateLength;
       
   104     }
       
   105 
       
   106 void CSigCompDeflateContext::SetUploadState(TBool aUploadState)
       
   107     {
       
   108     iUploadState = aUploadState;
       
   109     }
       
   110 
       
   111 TBool CSigCompDeflateContext::UploadState()
       
   112     {
       
   113     return iUploadState;
       
   114     }
       
   115 
       
   116 void CSigCompDeflateContext::SetStateItem(TStateItem* aStateItem,
       
   117                                           TInt aStateItemLength)
       
   118     {
       
   119     iStateItem = aStateItem;
       
   120     iStateItemLength = aStateItemLength;
       
   121     }
       
   122 
       
   123 TStateItem* CSigCompDeflateContext::StateItem()
       
   124     {
       
   125     return iStateItem;
       
   126     }
       
   127 
       
   128 TInt CSigCompDeflateContext::StateItemLength()
       
   129     {
       
   130     return iStateItemLength;
       
   131     }
       
   132 
       
   133 TBool CSigCompDeflateContext::CBStateConfirmed() const
       
   134     {
       
   135     return iCBStateConfirmed;
       
   136     }
       
   137 
       
   138 void CSigCompDeflateContext::SetCBStateConfirmed(TBool aStateConfirmed)
       
   139     {
       
   140     iCBStateConfirmed = aStateConfirmed;
       
   141     }
       
   142 
       
   143 TBool CSigCompDeflateContext::BytecodeStateConfirmed() const
       
   144     {
       
   145     return iBytecodeStateConfirmed;
       
   146     }
       
   147 
       
   148 void CSigCompDeflateContext::SetBytecodeStateConfirmed(
       
   149                                     TBool aBytecodeStateConfirmed)
       
   150     {
       
   151     iBytecodeStateConfirmed = aBytecodeStateConfirmed;
       
   152     }
       
   153 
       
   154 TInt CSigCompDeflateContext::Sms() const
       
   155     {
       
   156     return iStateMemorySize;
       
   157     }
       
   158 
       
   159 TInt CSigCompDeflateContext::Dms() const
       
   160     {
       
   161     return iDecompressionMemorySize;
       
   162     }
       
   163 
       
   164 void CSigCompDeflateContext::SetSms(TInt aSms)
       
   165     {
       
   166     iStateMemorySize = aSms;
       
   167     }
       
   168 
       
   169 void CSigCompDeflateContext::SetDms(TInt aDms)
       
   170     {
       
   171     iDecompressionMemorySize = aDms;
       
   172     }
       
   173 
       
   174 TInt CSigCompDeflateContext::UdvmSize() const
       
   175     {
       
   176     return iUdvmSize;
       
   177     }
       
   178 
       
   179 void CSigCompDeflateContext::SetUdvmSize(TInt aUdvmSize)
       
   180     {
       
   181     iUdvmSize = aUdvmSize;
       
   182     }
       
   183 
       
   184 TInt CSigCompDeflateContext::CBSize() const
       
   185     {
       
   186     return iCBSize;
       
   187     }
       
   188 
       
   189 void CSigCompDeflateContext::SetCBSize(TInt aCBSize)
       
   190     {
       
   191     iCBSize = aCBSize;
       
   192     }