memana/analyzetoolclient/storageserver/server/inc/atstorageserversession.h
changeset 2 6a82cd05fb1e
parent 1 3ff3fecb12fe
equal deleted inserted replaced
1:3ff3fecb12fe 2:6a82cd05fb1e
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Declaration of the server side session class CATStorageServerSession
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ATSTORAGESERVERSESSION_H
       
    20 #define ATSTORAGESERVERSESSION_H
       
    21 
       
    22 
       
    23 //  INCLUDES
       
    24 #include    <e32base.h>
       
    25 #include    <f32file.h>
       
    26 #include    <analyzetool/atcommon.h>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CATStorageServer;
       
    30 class CATMemoryEntry;
       
    31 
       
    32 // CLASS DECLARATIONS
       
    33 
       
    34 /**
       
    35 *  A class for storing memory addresses and sizes of allocations.
       
    36 *  Needed for giving allocation information for the configuration UI.
       
    37 */
       
    38 class TAllocInfo
       
    39     {
       
    40     public:
       
    41     
       
    42     // Constructor
       
    43     TAllocInfo( TUint32 aMemAddress, TInt aAllocSize );
       
    44     
       
    45     /** Address of a memory allocation. */
       
    46     const TUint32 iMemAddress;
       
    47     
       
    48     /** Size of the associated allocation. */
       
    49     const TInt iAllocSize;
       
    50     };
       
    51 
       
    52 
       
    53 /**
       
    54 *  The session class for Storage Server.
       
    55 *  When the Storage Server client connects to the server, a new object of this
       
    56 *  class is constructed. So, for every client there is an associated object
       
    57 *  of this class. CATStorageServer forwards all client messages to their associated
       
    58 *  session objects.
       
    59 */
       
    60 class CATStorageServerSession : public CSession2
       
    61     {
       
    62     public: // Enumerations
       
    63             
       
    64     public:  // Constructors and destructor
       
    65         
       
    66         /**
       
    67         * Two-phased constructor that can leave.
       
    68         * @return A new instance of this class
       
    69         */
       
    70         static CATStorageServerSession* NewL( CATStorageServer& aStorageServer );
       
    71         
       
    72         /**
       
    73         * Two-phased constructor that can leave and leaves a pointer
       
    74         * on the cleanup stack.
       
    75         * @return A new instance of this class
       
    76         */
       
    77         static CATStorageServerSession* NewLC( CATStorageServer& aStorageServer );
       
    78         
       
    79         /**
       
    80         * Destructor
       
    81         */
       
    82         virtual ~CATStorageServerSession();
       
    83         
       
    84     public: // Functions from base classes 
       
    85         
       
    86         /**
       
    87         * Receives messages sent by a client.
       
    88         * @param aMessage A message from a client
       
    89         */
       
    90         virtual void ServiceL( const RMessage2& aMessage );
       
    91                 
       
    92     protected: // new functions
       
    93   
       
    94         /**
       
    95         * Initializes this session for logging. This includes opening a logging file
       
    96         * with a requested name. The method is to be called as the first method after
       
    97         * connecting to the server. The method logs information on process starting into
       
    98         * the just opened logging file.
       
    99         * If a logging session is already ongoing, the method makes the client raise an
       
   100         * STSEClient: 3 panic, and returns KErrCancel.
       
   101         * @param aMessage A message that includes parameters sent by the client.
       
   102         * @return KErrNone, if successful; KErrCancel, if a logging session is already
       
   103         * ongoing. Otherwise one of the other system wide error codes.
       
   104         */
       
   105         TInt LogProcessStartedL( const RMessage2& aMessage );
       
   106         
       
   107         /**
       
   108         * Initializes this session for logging. The method is to be called as the first
       
   109         * method after connecting to the server. The method logs information on process
       
   110         * starting into XTI channel.
       
   111         * If a logging session is already ongoing, the method makes the client raise an
       
   112         * STSEClient: 3 panic, and returns KErrCancel.
       
   113         * @param aMessage A message that includes parameters sent by the client.
       
   114         * @return KErrNone, if successful; KErrCancel, if a logging session is already
       
   115         * ongoing. Otherwise one of the other system wide error codes.
       
   116         */
       
   117         TInt LogProcessStartXtiL( const RMessage2& aMessage );
       
   118          
       
   119         /**
       
   120         * Logs information on a DLL load into the opened file.
       
   121         * If a logging session is not ongoing, the method makes the client raise an
       
   122         * STSEClient: 3 panic, and returns KErrCancel.
       
   123         * @param aMessage A message that includes parameters sent by the client.
       
   124         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   125         *   currently ongoing; Otherwise one of the other system wide error codes.
       
   126         */
       
   127         TInt LogDllLoadedL( const RMessage2& aMessage );
       
   128         
       
   129         /**
       
   130         * Logs information on a DLL load into XTI channel.
       
   131         * If a logging session is not ongoing, the method makes the client raise an
       
   132         * STSEClient: 3 panic, and returns KErrCancel.
       
   133         * @param aMessage A message that includes parameters sent by the client.
       
   134         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   135         *   currently ongoing; Otherwise one of the other system wide error codes.
       
   136         */
       
   137         TInt LogDllLoadXtiL( const RMessage2& aMessage );
       
   138       
       
   139         /**
       
   140         * Logs information on a DLL unload into the opened file.
       
   141         * If a logging session is not ongoing, the method makes the client raise an
       
   142         * STSEClient: 3 panic, and returns KErrCancel.
       
   143         * @param aMessage A message that includes parameters sent by the client.
       
   144         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   145         *   currently ongoing; Otherwise one of the other system wide error codes.
       
   146         */
       
   147         TInt LogDllUnloadedL( const RMessage2& aMessage );
       
   148         
       
   149         /**
       
   150         * Logs information on a DLL unload into XTI channel.
       
   151         * If a logging session is not ongoing, the method makes the client raise an
       
   152         * STSEClient: 3 panic, and returns KErrCancel.
       
   153         * @param aMessage A message that includes parameters sent by the client.
       
   154         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   155         *   currently ongoing; Otherwise one of the other system wide error codes.
       
   156         */
       
   157         TInt LogDllUnloadXtiL( const RMessage2& aMessage );
       
   158  
       
   159         /**
       
   160         * Stores a memory allocation (memory address, current call stack, allocation
       
   161         * time and allocation size) in an internal array.
       
   162         * If a logging session is not ongoing, the method makes the client raise an
       
   163         * STSEClient: 3 panic, and returns KErrCancel.
       
   164         * @param aMessage A message that includes parameters sent by the client.
       
   165         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   166         *   currently ongoing; KErrAlreadyExists, if an attempt is being made to allocate
       
   167         *   again an already allocated memory area; Otherwise one of the other system
       
   168         *   wide error codes.
       
   169         */
       
   170         TInt LogMemoryAllocatedL( const RMessage2& aMessage );
       
   171         
       
   172         /**
       
   173         * Logs information on a memory allocation into XTI channel.
       
   174         * If a logging session is not ongoing, the method makes the client raise an
       
   175         * STSEClient: 3 panic, and returns KErrCancel.
       
   176         * @param aMessage A message that includes parameters sent by the client.
       
   177         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   178         *   currently ongoing; KErrAlreadyExists, if an attempt is being made to allocate
       
   179         *   again an already allocated memory area; Otherwise one of the other system
       
   180         *   wide error codes.
       
   181         */
       
   182         TInt LogMemoryAllocXtiL( const RMessage2& aMessage );
       
   183                 
       
   184         /**
       
   185 		* Check a memory allocation (memory address) from an internal array.
       
   186 		* If a logging session is not ongoing, the method makes the client raise an
       
   187 		* STSEClient: 3 panic, and returns KErrCancel.
       
   188 		* @param aMessage A message that includes parameters sent by the client.
       
   189 		* @return KErrNone, if memory address found in array; 
       
   190 		* 	KErrNotFound, if the requested memory address was not found.
       
   191 		*/
       
   192 		TInt IsMemoryAdded( const RMessage2& aMessage, const TBool aRemoveAlloc = EFalse );
       
   193         
       
   194         /**
       
   195         * Removes a memory allocation (memory address, current call stack, allocation
       
   196         * time and allocation size) from an internal array.
       
   197         * If a logging session is not ongoing, the method makes the client raise an
       
   198         * STSEClient: 3 panic, and returns KErrCancel.
       
   199         * @param aMessage A message that includes parameters sent by the client.
       
   200         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   201         *   currently ongoing; KErrNotFound, if the requested memory address was not
       
   202         *   found; Otherwise one of the other system wide error codes.
       
   203         */
       
   204         TInt LogMemoryFreedL( const RMessage2& aMessage );
       
   205         
       
   206         /**
       
   207         * Logs information on freeing of a memory allocatin into XTI channel.
       
   208         * If a logging session is not ongoing, the method makes the client raise an
       
   209         * STSEClient: 3 panic, and returns KErrCancel.
       
   210         * @param aMessage A message that includes parameters sent by the client.
       
   211         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   212         *   currently ongoing; KErrNotFound, if the requested memory address was not
       
   213         *   found; Otherwise one of the other system wide error codes.
       
   214         */
       
   215         TInt LogMemoryFreedXtiL( const RMessage2& aMessage );
       
   216         
       
   217         /**
       
   218         * Logs all non-released memory allocations into the opened file as memory leaks.
       
   219         * Then the method logs a number of possibly occured handle leaks into the file.
       
   220         * Next, the method logs information on process ending into the logging file.
       
   221         * Finally, this method closes the logging file opened for the connected process,
       
   222         * and ends the current logging session. However, this method does not end the 
       
   223         * actual client-server session.
       
   224         * If a logging session is not ongoing, the method makes the client raise an
       
   225         * STSEClient: 3 panic, and returns KErrCancel.
       
   226         * @param aMessage A message that includes parameters sent by the client.
       
   227         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   228         *   currently ongoing; KErrNotSupported if this method is called with a wrong
       
   229         *   process id from the client. Otherwise one of the other system wide error
       
   230         *   codes.
       
   231         */
       
   232         TInt LogProcessEndedL( const RMessage2& aMessage );
       
   233         
       
   234         /**
       
   235         * Logs a number of possibly occured handle leaks into XTI channel. Then, the method
       
   236         * logs information on process ending into XTI channel. The method also
       
   237         * ends the current logging session. However, this method does not end the actual
       
   238         * client-server session.
       
   239         * If a logging session is not ongoing, the method makes the client raise an
       
   240         * STSEClient: 3 panic, and returns KErrCancel.
       
   241         * @param aMessage A message that includes parameters sent by the client.
       
   242         * @return KErrNone, if successful; KErrCancel, if a logging session is not
       
   243         *   currently ongoing; KErrNotSupported if this method is called with a wrong
       
   244         *   process id from the client. Otherwise one of the other system wide error
       
   245         *   codes.
       
   246         */
       
   247         TInt LogProcessEndXtiL( const RMessage2& aMessage );
       
   248 
       
   249         /**
       
   250         * Checks if a given memory address can be found.
       
   251         * If a logging session is not ongoing, the method makes the client raise an
       
   252         * STSEClient: 3 panic, and returns KErrCancel.
       
   253         * @param aMessage A message that includes parameters sent by the client.
       
   254         * @return When the system is logging into a file: the index of a found 
       
   255         *   memory address, or KErrNotFound, if a matching memory address cannot
       
   256         *   be found. KErrNone, when the system is not logging into a file.
       
   257         *   KErrCancel, if a logging session is not currently ongoing.
       
   258         */
       
   259         TInt CheckMemoryAddressL( const RMessage2& aMessage );
       
   260         
       
   261         /**
       
   262         * Checks if a given memory address can be found.
       
   263         * If a logging session is not ongoing, the method makes the client raise an
       
   264         * STSEClient: 3 panic, and returns KErrCancel.
       
   265         * @param aMessage A message that includes parameters sent by the client.
       
   266         * @return When the system is logging into a file: the index of a found 
       
   267         *   memory address, or KErrNotFound, if a matching memory address cannot
       
   268         *   be found. KErrNone, when the system is not logging into a file.
       
   269         *   KErrCancel, if a logging session is not currently ongoing.
       
   270         */
       
   271         TInt CheckMemoryAddressXti( const RMessage2& aMessage );
       
   272         
       
   273         /**
       
   274         * Gets all the processes currently logging with AnalyzeTool
       
   275         * @param aMessage A message that includes parameters sent by the client.
       
   276         *   On return a buffer including all the currently logging processes is written
       
   277         *   into this message.
       
   278         * @return KErrNone, if successful; otherwise one of the other system wide error
       
   279         *   codes.
       
   280         */
       
   281         TInt GetProcessesL( const RMessage2& aMessage );
       
   282         
       
   283         /**
       
   284         * Gets all the DLLs loaded by the process determined by the parameters.
       
   285         * @param aMessage A message that includes parameters sent by the client.
       
   286         *   A buffer including all the DLLs loaded by the requested process is
       
   287         *   written into this message.
       
   288         * @return KErrNone, if successful; KErrNotFound, if the requested process was
       
   289         *   not found; otherwise one of the other system wide error codes.
       
   290         */
       
   291         TInt GetDllsL( const RMessage2& aMessage );
       
   292         
       
   293         /**
       
   294         * Gets the logging mode of the process determined by the parameters.
       
   295         * @param aMessage A message that includes parameters sent by the client.
       
   296         *   On return, the logging mode is written into this message.
       
   297         * @return KErrNone, if successful; KErrNotFound, if the requested process was
       
   298         *   not found; otherwise one of the other system wide error codes.
       
   299         */
       
   300         TInt GetLoggingModeL( const RMessage2& aMessage );
       
   301 
       
   302         /**
       
   303         * Starts a sub test for the given process.
       
   304         * @param aMessage A message that includes parameters sent by the client.
       
   305         * @return KErrNone, if successful; KErrNotFound, if the requested process is not
       
   306         *   found; KErrNotSupported, if the requested process does not have a logging
       
   307         *   session ongoing or its logging mode is not EATLogToXti; Otherwise one of the
       
   308         *   other system wide error codes.
       
   309         */
       
   310         TInt StartSubtestL( const RMessage2& aMessage );
       
   311         
       
   312         /**
       
   313         * Stops a sub test for the given process.
       
   314         * @param aMessage A message that includes parameters sent by the client.
       
   315         * @return KErrNone, if successful; KErrNotFound, if the requested process is not
       
   316         *   found; KErrNotSupported, if the requested process does not have a logging
       
   317         *   session ongoing or its logging mode is not EATLogToXti; Otherwise one of the
       
   318         *   other system wide error codes.
       
   319         */
       
   320         TInt StopSubtestL( const RMessage2& aMessage );
       
   321         
       
   322         /**
       
   323         * Starts a sub test for the calling process. Does not need a PID from the client.
       
   324         * @param aMessage A message that includes parameters sent by the client.
       
   325         * @return KErrNone, if successful; KErrNotSupported, if the calling process
       
   326         *   does not have a logging session ongoing or its logging mode is not
       
   327         *   EATLogToXti; Otherwise one of the other system wide error codes.
       
   328         */
       
   329         TInt StartSubtest2L( const RMessage2& aMessage );
       
   330         
       
   331         /**
       
   332         * Stops a sub test for the calling process. Does not need a PID from the client.
       
   333         * @param aMessage A message that includes parameters sent by the client.
       
   334         * @return KErrNone, if successful; KErrNotSupported, if the calling process
       
   335         *   does not have a logging session ongoing or its logging mode is not
       
   336         *   EATLogToXti; Otherwise one of the other system wide error codes.
       
   337         */
       
   338         TInt StopSubtest2( const RMessage2& aMessage );
       
   339         
       
   340         /**
       
   341         * Gets the number and total size of the current memory chunks allocated by the
       
   342         * requested process.
       
   343         * @param aMessage A message that includes parameters sent by the client. The
       
   344         *   requested information is written into this message.
       
   345         * @return KErrNone, if successful; KErrNotFound, if the requested process was
       
   346         *   not found; otherwise one of the other system wide error codes.
       
   347         */
       
   348         TInt GetCurrentAllocsL( const RMessage2& aMessage );
       
   349         
       
   350         /**
       
   351         * Gets the maximum number of memory chunks and the maximum amount of memory 
       
   352         * allocated by the requested process during the test run.
       
   353         * @param aMessage A message that includes parameters sent by the client. The
       
   354         *   requested information is written into this message.
       
   355         * @return KErrNone, if successful; KErrNotFound, if the requested process was
       
   356         *   not found; otherwise one of the other system wide error codes.
       
   357         */
       
   358         TInt GetMaxAllocsL( const RMessage2& aMessage );
       
   359         
       
   360         /**
       
   361         * Cancels logging for the requested process. After logging of a given process
       
   362         * has been cancelled, the session associated with that process will not be
       
   363         * usable anymore. If a process wants to start logging again, it needs to close
       
   364         * the handle and open it again in order to create a new session. Until then, any
       
   365         * of the server's methods that can be called by the client will return
       
   366         * KErrCancel.
       
   367         * @param aMessage A message that includes parameters sent by the client.
       
   368         * @return KErrNone, if successful; KErrNotFound, if the requested process was
       
   369         *   not found; otherwise one of the other system wide error codes.
       
   370         */
       
   371         TInt CancelLoggingL( const RMessage2& aMessage );
       
   372         
       
   373         /**
       
   374         * Gets the logging file of the process determined by the parameters.
       
   375         * @param aMessage A message that includes parameters sent by the client.
       
   376         *   On return, the logging file is written into this message.
       
   377         * @return KErrNone, if successful; KErrNotFound, if the requested process was
       
   378         *   not found; otherwise one of the other system wide error codes.
       
   379         */
       
   380         TInt GetLoggingFileL( const RMessage2& aMessage );
       
   381        
       
   382         /**
       
   383         * Gets the mode of the process determined by the parameters.
       
   384         * @param aMessage A message that includes parameters sent by the client.
       
   385         *   On return, the logging file is written into this message.
       
   386         * @return KErrNone, if successful; KErrNotFound, if the requested process was
       
   387         *   not found; otherwise one of the other system wide error codes.
       
   388         */
       
   389         TInt GetUdebL( const RMessage2& aMessage );
       
   390 
       
   391         /**
       
   392         * Sets the mode of the process determined by the parameters.
       
   393         * @param aMessage A message that includes parameters sent by the client.
       
   394         */
       
   395         void SetUdeb( const RMessage2& aMessage );
       
   396         
       
   397     private:  // New functions for internal use  
       
   398     
       
   399         /**
       
   400         * Releases the resources reserved by this object, and before closing the logging
       
   401         * file and file server session, the method logs information on the occured error
       
   402         * into the logging file.
       
   403         * @param aError The error code to be logged.
       
   404         */
       
   405         void HandleError( TInt aError );
       
   406         
       
   407         /**
       
   408         * Releases the resources reserved by this object, and logs information on the
       
   409         * occured error into XTI channel.
       
   410         * @param aError The error code to be logged.
       
   411         */
       
   412         void HandleErrorXti( TInt aError );
       
   413         
       
   414         /**
       
   415         * Opens a file server session and a file with the name specified.
       
   416         * @param aFileName The name of the file into which to log.
       
   417         * @param aProcessName Current process name.
       
   418         * @return KErrNone, if successful; otherwise one of the other system wide
       
   419         *   error codes.
       
   420         */
       
   421         TInt OpenFsAndFile( const TDesC& aFileName, const TDesC8& aProcessName );
       
   422         
       
   423         /**
       
   424 		* Method is used to parse file name extension.
       
   425 		* @param aFileName The name of the file into which to log.
       
   426 		* @param aExtension Parsed file extension. 
       
   427 		*/
       
   428 		void ParseExtension( TDes& aFileName, TDes& aExtension );
       
   429                 
       
   430         /**
       
   431 		* Called internally when need generate new file name.
       
   432 		* @param aFileName The name of the file into which to log.
       
   433 		* @param aProcessName Current process name.
       
   434 		*/
       
   435 		void GenerateNewFileName( TDes& aFileName, const TDesC8& aProcessName );
       
   436                 
       
   437         /**
       
   438 		* Method is used to check that file exists and is valid.
       
   439 		* @param aFileName The name of the file into which to log.
       
   440 		*/
       
   441         void CheckIfFileAlreadyExist( const TDes& aFileName );
       
   442         
       
   443 		/**
       
   444 		* Method is used to check file version.
       
   445 		* @param aFileName The name of the file into which to log.
       
   446 		*/
       
   447 		void CheckFileVersion( const TDes& aFileName );
       
   448 						
       
   449         /**
       
   450         * Closes the handles to the file server session and to the file (if currently open).
       
   451         */
       
   452         void CloseFsAndFile();
       
   453         
       
   454         /**
       
   455         * Writes the memory leaks stored in the iLeakArray member array into the
       
   456         * logging file opened for the current logging session. If the method is
       
   457         * called in a wrong program state (logging session is not ongoing, or the
       
   458         * logging mode is not EATLogToFile), STSEClient: 4, and STSEServer: 4
       
   459         * panics are raised.
       
   460         * @param aMessage The current message from the client.
       
   461         * @return KErrNone, if successful; otherwise one of the other system wide
       
   462         *   error codes.
       
   463         */
       
   464         TInt PrintLeaksL( const RMessage2& aMessage );
       
   465         
       
   466         /**
       
   467         * Sets the server's mode of operation. The operation mode is determined with
       
   468         * an enumeration value, which is received from the client. If the method is
       
   469         * called in a wrong program state (logging session is ongoing), STSEClient: 4,
       
   470         * and STSEServer: 4 panics are raised.
       
   471         * @param aMessage The current message from the client.
       
   472         */
       
   473         void SetLogOption( const RMessage2& aMessage );
       
   474         
       
   475         /**
       
   476         * Logs the given descriptor through XTI channel.
       
   477         * @param aLogString The descriptor to be logged.
       
   478         * @return KErrNone, if successful; KErrNotSupported, if a logging session is not
       
   479         *   ongoing, or the logging mode is not EATLogToXti;
       
   480         */
       
   481         TInt LogThroughXti( const TDesC& aLogString ) const;
       
   482         
       
   483         /**
       
   484         * Gives a reference to the allocation info array of this class.
       
   485         * @return A reference to iAllocInfoArray array
       
   486         */
       
   487         RArray<TAllocInfo>& AllocInfoArray();
       
   488                
       
   489         /**
       
   490         * Creates a panic in the associated client's code.
       
   491         * @param aPanic The panic code
       
   492         * @param aMessage The message associated with this panic.
       
   493         */
       
   494         void PanicClient( TInt aPanic, const RMessage2& aMessage );
       
   495               
       
   496         /**
       
   497 		* Logs the abnormal end to the XTI channel(If logging mode is EATLogToXti) 
       
   498 		* and to the file(If logging mode is EATLogToFile).
       
   499 		*/
       
   500         void LogAbnormalEnd();
       
   501         
       
   502         /**
       
   503         * Get the current universal time.
       
   504         * @return Time
       
   505         */
       
   506         TInt64 GetTime();
       
   507         
       
   508     private: // Constructors 
       
   509 
       
   510         /**
       
   511         * C++ default constructor.
       
   512         */
       
   513         CATStorageServerSession( CATStorageServer& aStorageServer );
       
   514 
       
   515         /**
       
   516         *  Symbian 2nd phase constructor.
       
   517         */
       
   518         void ConstructL();   
       
   519       
       
   520     private: // Data
       
   521             
       
   522         /** A reference to the CATStorageServer object that has created this session */    
       
   523         CATStorageServer& iStorageServer;
       
   524                
       
   525         /** A handle to a file server */
       
   526         RFs iFileServer;
       
   527         
       
   528         /** A handle to a file */
       
   529         RFile iFile;
       
   530         
       
   531         /** A member variable for storing results of server function calls. */ 
       
   532         TInt iError;
       
   533         
       
   534         /** An object for getting time stamps */ 
       
   535         TTime iTime;
       
   536         
       
   537         /** 
       
   538         * An array for storing CATMemoryEntry pointers. Used when logging
       
   539         * to an S60 file.
       
   540         */
       
   541         RPointerArray<CATMemoryEntry> iLeakArray;
       
   542         
       
   543         /** 
       
   544         * An array for storing TAllocInfo objects. Used for keeping records on memory
       
   545         * allocations and their sizes.
       
   546         */
       
   547         RArray<TAllocInfo> iAllocInfoArray;
       
   548         
       
   549         /** The ID of the process associated with this session. */
       
   550         TUint iProcessId;
       
   551         
       
   552         /** 
       
   553         * A boolean telling whether this session has been initialized for logging
       
   554         * ( whether the client's LogProcessStarted() method has been called ) or not.
       
   555         */
       
   556         TBool iLoggingOngoing;
       
   557         
       
   558         /** 
       
   559         * A variable telling the number of microseconds from January 1st, 0 AD
       
   560         * nominal Gregorian to January 1st, 1970 AD nominal Gregorian. 
       
   561         */
       
   562         TInt64 iMicroSecondsAt1970;
       
   563         
       
   564         /** 
       
   565         * An enumeration that tells the current operation mode of the Storage Server.
       
   566         */
       
   567         TATLogOption iLogOption;
       
   568         
       
   569         /** The total size of all the current allocations of this process */
       
   570         TUint32 iCurAllocSize;
       
   571         
       
   572         /** The maximum number of allocations of this process */
       
   573         TUint32 iMaxAllocs;
       
   574         
       
   575         /** The maximum total size of allocations of this process */
       
   576         TUint32 iMaxAllocSize;
       
   577         
       
   578         /** The logging file of this process */
       
   579         TBuf8<KMaxFileName> iLogFile;
       
   580 
       
   581         /** The mode of the session. Default is 1 = UDEB */
       
   582         TUint32 iIsUdeb;
       
   583     };
       
   584 
       
   585 #endif      // ATSTORAGESERVERSESSION_H   
       
   586             
       
   587 // End of File