messagingfw/msgsrvnstore/server/inc/CMsvChangeBuffer.h
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     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 //
       
    15 
       
    16 #ifndef __CMSVCHANGEBUFFER_H__
       
    17 #define __CMSVCHANGEBUFFER_H__
       
    18 
       
    19 //**********************************
       
    20 // TMsvChangeRecord
       
    21 //**********************************
       
    22 
       
    23 class CMsvChangeRecord : public CBase
       
    24 /**
       
    25 @internalComponent
       
    26 @released
       
    27 */
       
    28 	{
       
    29 public:
       
    30 	static CMsvChangeRecord* NewL(const TDesC8& aChange, TUint32 aNotifySequence);
       
    31 	~CMsvChangeRecord();
       
    32 	//
       
    33 	inline const TDesC8& Change() const;
       
    34 	inline TUint32 NotifySequence() const;
       
    35 	//
       
    36 private:
       
    37 	CMsvChangeRecord(TUint32 aNotifySequence);
       
    38 	void ConstructL(const TDesC8& aChange);
       
    39 	//
       
    40 private:
       
    41 	HBufC8* iChange;
       
    42 	TUint32 iNotifySequence;
       
    43 	};
       
    44 
       
    45 //**********************************
       
    46 // CMsvChangeBuffer
       
    47 //**********************************
       
    48 
       
    49 const TInt KMsvChangeBufferSize=16;
       
    50 const TInt KMsvChangeBufferGranularity=16;
       
    51 
       
    52 class CMsvChangeBuffer : public CBase
       
    53 /**
       
    54 @internalComponent
       
    55 @released
       
    56 */
       
    57 	{
       
    58 public:
       
    59 	static CMsvChangeBuffer* NewL();
       
    60 	~CMsvChangeBuffer();
       
    61 	//
       
    62 	inline TBool IsEmpty() const;
       
    63 	inline TUint32 NotifySequence() const;
       
    64 	//
       
    65 	void InL(const TDesC8& aChange);
       
    66 	const TDesC8& Next(TUint32& aNotifySequence);
       
    67 	void Out();
       
    68 private:
       
    69 	CMsvChangeBuffer();
       
    70 	void ConstructL();
       
    71 	void ShrinkArray();
       
    72 	void GrowArrayL();
       
    73 private:
       
    74 	TInt iInPos;
       
    75 	TInt iOutPos;
       
    76 	CArrayPtrFlat<CMsvChangeRecord>* iArray;
       
    77 	TUint iNotifySequence;
       
    78 	};
       
    79 
       
    80 #include "CMsvChangeBuffer.inl"
       
    81 
       
    82 #endif // __CMSVCHANGEBUFFER_H__