sl@0: /** @file ../inc/pls.h sl@0: @internalComponent sl@0: */ sl@0: sl@0: /** @fn Pls(const TUid& aLibraryUid, TInt (*aInitFunc)(T*) = 0) sl@0: @return Pls() will always return a non-NULL value. sl@0: If Pls() fails to allocate memory, it will panic rather than returning NULL. sl@0: The risk of such a panic is minimal due to the allocation of Windows OS memory for the Pls object (which is effectively unlimited) rather than memory from the Emulator. sl@0: sl@0: A templated function that is used by a library (DLL) that requires to use sl@0: WSD on the emulator. sl@0: The function returns the PLS (Process Local Storage) object of the specified library, sl@0: for the current process. If the PLS object doesn't yet exist then it is allocated, sl@0: initialised, stored and returned. sl@0: The template type T is the type of the PLS object, and is supplied by the caller. sl@0: sl@0: Takes as a parameter the TUid of the library DLL whose PLS is to be returned for the sl@0: current process. It also takes as a parameter a pointer to a (non-leaving, non-panicing) sl@0: initialisation function defined by the caller which takes a pointer to T (i.e. the sl@0: PLS object) as a parameter and returns one of the system wide error codes as a TInt. sl@0: This parameter is optional but it should be used when necessary to ensure that if Pls() sl@0: requires to create a PLS object then the object is completely initialised on its return. sl@0: The initialisation function is called after the PLS object has been allocated and its sl@0: constructor called if it is an instance of a class - neither the constructor nor the sl@0: initialisation function should call Pls(). sl@0: sl@0: Returns a pointer to the PLS object sl@0: sl@0: sl@0: @publishedAll sl@0: @released sl@0: */