sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #ifndef __RIPC_SESSION__ sl@0: #define __RIPC_SESSION__ sl@0: sl@0: #include //RSessionBase sl@0: #include //Varargs sl@0: #include sl@0: #include sl@0: sl@0: struct msqid_ds; sl@0: struct shmid_ds; sl@0: sl@0: class TChunk sl@0: { sl@0: public: sl@0: TChunk(): iRef(0){} sl@0: TChunk(TInt aShmID): iShmID(aShmID), iRef(0){} sl@0: TInt iShmID; sl@0: RChunk iChunk; sl@0: TInt iRef; sl@0: }; sl@0: sl@0: sl@0: //----------------------------------------------------------------------- sl@0: //Class name: RIpcSession sl@0: //Description: It represents the session to Ipc Server. sl@0: //----------------------------------------------------------------------- sl@0: sl@0: class RIpcSession : public RSessionBase sl@0: { sl@0: public: sl@0: RIpcSession():iIsConnected(EFalse) sl@0: {iLock.CreateLocal();} sl@0: sl@0: //msgqueue functions sl@0: int msgctl(int msqid, int cmd, struct msqid_ds *buf, int &aerrno); sl@0: int msgget(key_t key, int msgflg, int& aerrno); sl@0: ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg, int& aerrno); sl@0: int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg, int& aerrno); sl@0: sl@0: //msgqueue functions sl@0: int shmctl(int shmid, int cmd, struct shmid_ds *buf, int &aerrno); sl@0: int shmget(key_t key, size_t size, int shmflg, int& aerrno); sl@0: void *shmat(int shmid, const void *shmaddr, int shmflg, int& aerrno); sl@0: int shmdt(const void *shmaddr, int& aerrno); sl@0: sl@0: //semqueue functions sl@0: int semget(key_t key, int nsems, int semflags, int& aerrno); sl@0: int semctl(int semid, int semnum, int cmd, union semun *arg, int& aerrno); sl@0: int semop(int semid, struct sembuf *sops, size_t nsops, int& aerrno); sl@0: sl@0: RFastLock iLock; sl@0: private: sl@0: TInt AddToList(const TInt& aKey, const TInt& aErr, TAny*& aRetPtr); sl@0: TInt OnDemandConnection(); sl@0: void Lock() sl@0: { sl@0: iLock.Wait(); sl@0: } sl@0: void UnLock() sl@0: { sl@0: iLock.Signal(); sl@0: } sl@0: private: sl@0: sl@0: TInt Connect(); sl@0: TInt iIsConnected; sl@0: //todo put a lock around this list sl@0: RArray iChunkList; sl@0: }; sl@0: sl@0: #endif //__RIPC_SESSION__ sl@0: sl@0: