Update contrib.
2 * Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef UNIQUEINSTANCEBASE_H_
20 #define UNIQUEINSTANCEBASE_H_
24 // The namespace UniqueInstance contains definitions that are not useful to the
25 // user, but are useful to the implementation. There is no need to use any symbols
26 // within it directly.
27 namespace UniqueInstance
33 typedef TInt TCompareFn(void*,void*);
39 typedef void TDeleteFn(void* aObjectToBeDeleted);
41 Copy aObjectToCopy into a newly allocated buffer, return the new object.
42 aObjectSize is the size of the object that the repository has been specialised
43 to work with. If this is not a true size of the object (for example in the case
44 of HBufC) this value should be ignored.
47 typedef void* TCopyFnL(void* aObjectToCopy, TInt aObjectSize);
50 class CRepositoryImpl;
54 * Type-unsafe repository with shared equivalent objects.
57 * @since App-frameworks6.1
59 NONSHARABLE_CLASS(CUniqueInstanceRepositoryBase) : public CBase
62 static void* DumbCopyL(void* aObjectTocopy, TInt aNumberOfBytes);
63 static void DumbDelete(void* aDeleteThis);
65 void ConstructL(TCompareFn*, TDeleteFn*, TCopyFnL*,
66 TInt aMaxLinks, TInt aObjectSize);
67 ~CUniqueInstanceRepositoryBase();
71 friend class RInstanceImpl;
72 CRepositoryImpl* iImpl;
76 * Type-unsafe repository client.
79 * @since App-frameworks6.1
84 explicit RInstanceImpl(CUniqueInstanceRepositoryBase& aRepository);
85 ~RInstanceImpl(); // asserts that no object is owned
87 void TakeL(void* aObject);
88 void TakeCopyL(void* aObject);
90 void CopyTo(RInstanceImpl& aOther) const;
91 void MoveTo(RInstanceImpl& aOther);
96 RInstanceImpl(RInstanceImpl&); // unimplemented
97 RInstanceImpl &operator=(const RInstanceImpl&); // unimplemented
100 CRepositoryImpl* iRepository;
104 #endif // UNIQUEINSTANCEBASE_H_