os/ossrv/genericopenlibs/openenvcore/backend/inc/mmapcontrollernode.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/openenvcore/backend/inc/mmapcontrollernode.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,109 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Declaration of CMmapControllerNode
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +
    1.23 +#ifndef MMAP_CONTROLLER_NODE_H
    1.24 +#define MMAP_CONTROLLER_NODE_H
    1.25 +
    1.26 +//  INCLUDES
    1.27 +#include <e32base.h>
    1.28 +#include <e32std.h>
    1.29 +#include "mmapmemorynode.h"
    1.30 +#include "base.h"
    1.31 +
    1.32 +// CONSTANTS
    1.33 +
    1.34 +// MACROS
    1.35 +
    1.36 +// FORWARD DECLARATIONS
    1.37 +class CMmapMemoryNode;
    1.38 +
    1.39 +// DATA TYPES
    1.40 +
    1.41 +// FUNCTION PROTOTYPES
    1.42 +
    1.43 +// CLASS DECLARATION
    1.44 +
    1.45 +/*
    1.46 +*  This class is responsible to managing the memory mapped nodes.
    1.47 +*  This will maintain the mapped memory in a list format.
    1.48 +*  @since MRT 2.0
    1.49 +*/
    1.50 +NONSHARABLE_CLASS ( CMmapControllerNode ): public BBase
    1.51 +    {
    1.52 +public:
    1.53 +    /*
    1.54 +    * 1st phase constructor. 
    1.55 +    */
    1.56 +    static CMmapControllerNode * NewL();
    1.57 +    
    1.58 +    /*
    1.59 +    * Default destructor.
    1.60 +    */
    1.61 +    ~CMmapControllerNode();
    1.62 +    
    1.63 +    /*
    1.64 +    * To create a mapped memory and add in mmap node list
    1.65 +    */
    1.66 +    
    1.67 +    static TAny* AddMmapNodeL(struct _reent *r, size_t len, int flag, \
    1.68 +					   int shmflg, int fildes, off_t offset, size_t maplen);
    1.69 +	
    1.70 +	/*
    1.71 +    * To unmap a mapped memory and delete from mmap node list
    1.72 +    */
    1.73 +					   
    1.74 +    int DeleteMmapNode(TAny* aAddr, int& anerror);
    1.75 +    
    1.76 +    /*
    1.77 +    * To sync a mapped memory into the file below
    1.78 +    */
    1.79 +					   
    1.80 +    int SyncMmapNode(TAny* aAddr, size_t len, int flags, int& anerror);
    1.81 +    
    1.82 +    /*
    1.83 +    * To modify protection mode of a mapped memory.
    1.84 +    */
    1.85 +    
    1.86 +    int ChprotMmapNode(const TAny* addr, size_t len, int prot, int& anerrno);
    1.87 +    
    1.88 +    /*
    1.89 +    * To delete a mapped memory from node list.
    1.90 +    */
    1.91 +    
    1.92 +    static void RemoveControllerL(void *p);
    1.93 +    
    1.94 +private:
    1.95 +    /*
    1.96 +    * Default constructor.
    1.97 +    */
    1.98 +    CMmapControllerNode();
    1.99 +    
   1.100 +    /*
   1.101 +    * 2nd phase constructor.    
   1.102 +    */
   1.103 +    void ConstructL();
   1.104 +
   1.105 +private: // data    
   1.106 +    TSglQue<CMmapMemoryNode> iMmapQueue;
   1.107 +    TSglQueIter<CMmapMemoryNode> iMmapQueueIter;
   1.108 +    };
   1.109 +
   1.110 +#endif // MMAP_CONTROLLER_NODE_H
   1.111 +
   1.112 +// End of File