os/ossrv/genericopenlibs/openenvcore/ewsd/inc/pls.dosc
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/** @file  ../inc/pls.h
sl@0
     2
@internalComponent
sl@0
     3
*/
sl@0
     4
sl@0
     5
/** @fn  Pls(const TUid& aLibraryUid, TInt (*aInitFunc)(T*) = 0)
sl@0
     6
@return Pls() will always return a non-NULL value.
sl@0
     7
If Pls() fails to allocate memory, it will panic rather than returning NULL. 
sl@0
     8
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
     9
sl@0
    10
A templated function that is used by a library (DLL) that requires to use
sl@0
    11
WSD on the emulator.
sl@0
    12
The function returns the PLS (Process Local Storage) object of the specified library, 
sl@0
    13
for the current process. If the PLS object doesn't yet exist then it is allocated, 
sl@0
    14
initialised, stored and returned.
sl@0
    15
The template type T is the type of the PLS object, and is supplied by the caller.
sl@0
    16
sl@0
    17
Takes as a parameter the TUid of the library DLL whose PLS is to be returned for the 
sl@0
    18
current process. It also takes as a parameter a pointer to a (non-leaving, non-panicing) 
sl@0
    19
initialisation function defined by the caller which takes a pointer to T (i.e. the 
sl@0
    20
PLS object) as a parameter and returns one of the system wide error codes as a TInt.
sl@0
    21
This parameter is optional but it should be used when necessary to ensure that if Pls() 
sl@0
    22
requires to create a PLS object then the object is completely initialised on its return. 
sl@0
    23
The initialisation function is called after the PLS object has been allocated and its 
sl@0
    24
constructor called if it is an instance of a class - neither the constructor nor the 
sl@0
    25
initialisation function should call Pls().
sl@0
    26
sl@0
    27
Returns a pointer to the PLS object		
sl@0
    28
sl@0
    29
sl@0
    30
@publishedAll
sl@0
    31
@released
sl@0
    32
*/