os/ossrv/genericopenlibs/openenvcore/backend/inc/mmapcontrollernode.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-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 CMmapControllerNode
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef MMAP_CONTROLLER_NODE_H
    21 #define MMAP_CONTROLLER_NODE_H
    22 
    23 //  INCLUDES
    24 #include <e32base.h>
    25 #include <e32std.h>
    26 #include "mmapmemorynode.h"
    27 #include "base.h"
    28 
    29 // CONSTANTS
    30 
    31 // MACROS
    32 
    33 // FORWARD DECLARATIONS
    34 class CMmapMemoryNode;
    35 
    36 // DATA TYPES
    37 
    38 // FUNCTION PROTOTYPES
    39 
    40 // CLASS DECLARATION
    41 
    42 /*
    43 *  This class is responsible to managing the memory mapped nodes.
    44 *  This will maintain the mapped memory in a list format.
    45 *  @since MRT 2.0
    46 */
    47 NONSHARABLE_CLASS ( CMmapControllerNode ): public BBase
    48     {
    49 public:
    50     /*
    51     * 1st phase constructor. 
    52     */
    53     static CMmapControllerNode * NewL();
    54     
    55     /*
    56     * Default destructor.
    57     */
    58     ~CMmapControllerNode();
    59     
    60     /*
    61     * To create a mapped memory and add in mmap node list
    62     */
    63     
    64     static TAny* AddMmapNodeL(struct _reent *r, size_t len, int flag, \
    65 					   int shmflg, int fildes, off_t offset, size_t maplen);
    66 	
    67 	/*
    68     * To unmap a mapped memory and delete from mmap node list
    69     */
    70 					   
    71     int DeleteMmapNode(TAny* aAddr, int& anerror);
    72     
    73     /*
    74     * To sync a mapped memory into the file below
    75     */
    76 					   
    77     int SyncMmapNode(TAny* aAddr, size_t len, int flags, int& anerror);
    78     
    79     /*
    80     * To modify protection mode of a mapped memory.
    81     */
    82     
    83     int ChprotMmapNode(const TAny* addr, size_t len, int prot, int& anerrno);
    84     
    85     /*
    86     * To delete a mapped memory from node list.
    87     */
    88     
    89     static void RemoveControllerL(void *p);
    90     
    91 private:
    92     /*
    93     * Default constructor.
    94     */
    95     CMmapControllerNode();
    96     
    97     /*
    98     * 2nd phase constructor.    
    99     */
   100     void ConstructL();
   101 
   102 private: // data    
   103     TSglQue<CMmapMemoryNode> iMmapQueue;
   104     TSglQueIter<CMmapMemoryNode> iMmapQueueIter;
   105     };
   106 
   107 #endif // MMAP_CONTROLLER_NODE_H
   108 
   109 // End of File