perfsrv/memspy/Driver/Kernel/Include/SubChannels/MemSpyDriverLogChanBase.h
changeset 51 98307c651589
child 54 a151135b0cf9
equal deleted inserted replaced
42:0ff24a8f6ca2 51:98307c651589
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MEMSPYDRIVERLOGCHANBASE_H
       
    19 #define MEMSPYDRIVERLOGCHANBASE_H
       
    20 
       
    21 // System includes
       
    22 #include <e32cmn.h>
       
    23 #include <kern_priv.h>
       
    24 #ifdef __MARM__
       
    25 #include <arm.h>
       
    26 #endif
       
    27 
       
    28 // User includes
       
    29 #include "MemSpyDriverStreamWriter.h"
       
    30 
       
    31 // Classes referenced
       
    32 class DMemSpyDriverDevice;
       
    33 class DMemSpyDriverXferBuffer;
       
    34 class DMemSpyDriverOSAdaption;
       
    35 class DMemSpySuspensionManager;
       
    36 
       
    37 class DMemSpyDriverLogChanBase : public DBase
       
    38 	{
       
    39 public:
       
    40 	~DMemSpyDriverLogChanBase();
       
    41 
       
    42 protected: // Internal construction
       
    43 	DMemSpyDriverLogChanBase( DMemSpyDriverDevice& aDevice, DThread& aThread );
       
    44     TInt BaseConstruct( TInt aTransferBufferSize = 0 );
       
    45 
       
    46 public: // API
       
    47     /**
       
    48      * Finish construction of the channel object
       
    49      */
       
    50     virtual TInt Construct();
       
    51 
       
    52     /**
       
    53      * Request a channel function - this function implementation (in this class)
       
    54      * is able to perform general policing, e.g. SID, capability etc.
       
    55      *
       
    56      * Currently this always returns KErrNone, but none the less, derived classes
       
    57      * should call this implementation and handle return value appropriately.
       
    58      */
       
    59     virtual TInt Request( TInt aFunction, TAny* a1, TAny* a2 );
       
    60 
       
    61     /**
       
    62      * Sub channel should return ETrue if it can handle the specified function
       
    63      * request.
       
    64      */
       
    65     virtual TBool IsHandler( TInt aFunction ) const = 0;
       
    66 
       
    67 protected: // Internal access
       
    68     DMemSpyDriverDevice& MemSpyDevice();
       
    69     DMemSpySuspensionManager& SuspensionManager();
       
    70 
       
    71 protected: // Internal methods
       
    72 	TInt OpenTempObject( TUint aId, TObjectType aType, TBool aAllowDeadObjects = EFalse );
       
    73 	void CloseTempObject();
       
    74     DThread& TempObjectAsThread();
       
    75     DProcess& TempObjectAsProcess();
       
    76 
       
    77 protected: // Transfer buffer
       
    78     RMemSpyMemStreamWriter OpenXferStream();
       
    79     TInt OpenXferStream( RMemSpyMemStreamWriter& aWriter, TInt aRequiredSize );
       
    80 
       
    81 protected: // Internal access
       
    82     DMemSpyDriverOSAdaption& OSAdaption();
       
    83     inline DObject* TempObject() { return iTempObj; }
       
    84     inline const DObject* TempObject() const { return iTempObj; }
       
    85     //
       
    86     inline DThread& ClientThread() { return iClientThread; }
       
    87 
       
    88 private: // Data members
       
    89     DMemSpyDriverDevice& iDevice;
       
    90 	DThread& iClientThread;
       
    91 	DObject* iTempObj;
       
    92     DMemSpyDriverXferBuffer* iXferBuffer;
       
    93 	};
       
    94 
       
    95 
       
    96 
       
    97 #endif