First public contribution.
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef __TESTFRAMEWORKIPC_INL__
20 #define __TESTFRAMEWORKIPC_INL__
27 // Pass throughs - equiv to using...
29 inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction) const
31 return RMmfSessionBase::SendReceive(aFunction);
34 inline void RMmfSessionBaseX::SendReceive(TInt aFunction, TRequestStatus& aStatus) const
36 RMmfSessionBase::SendReceive(aFunction, aStatus);
39 inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0) const
41 return RMmfSessionBase::SendReceive(aFunction, aParam0);
44 inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0, TInt aParam1) const
46 return RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1);
49 inline void RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0, TRequestStatus& aStatus) const
51 RMmfSessionBase::SendReceive(aFunction, aParam0, aStatus);
54 inline void RMmfSessionBaseX::SendReceive(TInt aFunction, TInt aParam0, TInt aParam1, TRequestStatus& aStatus) const
56 RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aStatus);
59 inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0) const
61 return RMmfSessionBase::SendReceive(aFunction, aParam0);
64 inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1) const
66 return RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1);
69 inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1, const TDesC8& aParam2) const
71 return RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aParam2);
74 inline void RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, TRequestStatus& aStatus) const
76 RMmfSessionBase::SendReceive(aFunction, aParam0, aStatus);
79 inline void RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1, TRequestStatus& aStatus) const
81 RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aStatus);
84 inline void RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC8& aParam0, const TDesC8& aParam1, const TDesC8& aParam2, TRequestStatus& aStatus) const
86 RMmfSessionBase::SendReceive(aFunction, aParam0, aParam1, aParam2, aStatus);
91 inline TInt RMmfSessionBaseX::SendReceive(TInt aFunction, const TDesC& aParam0, TInt aParam1) const
93 #ifdef __MMF_USE_IPC_V2__
94 return RSessionBase::SendReceive(aFunction, TIpcArgs(&aParam0,aParam1));
96 TAny* p[KMaxMessageArguments];
97 p[0] = static_cast<TAny*>(const_cast<TDesC16*>(&aParam0));
98 p[1] = reinterpret_cast<TAny*>(aParam1);
101 return RSessionBase::SendReceive(aFunction, p);
102 #endif __MMF_USE_IPC_V2__
111 inline TInt MmfMessageUtilX::Read(const RMmfIpcMessage& aMessage, TInt aParam, TDes8& aResult)
113 return MmfMessageUtil::Read(aMessage, aParam, aResult);
116 inline TInt MmfMessageUtilX::Write(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC8& aValue)
118 return MmfMessageUtil::Write(aMessage, aParam, aValue);
121 inline void MmfMessageUtilX::ReadL(const RMmfIpcMessage& aMessage, TInt aParam, TDes8& aResult)
123 MmfMessageUtil::ReadL(aMessage, aParam, aResult);
126 inline void MmfMessageUtilX::WriteL(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC8& aValue)
128 MmfMessageUtil::WriteL(aMessage, aParam, aValue);
134 inline void MmfMessageUtilX::ReadL(const RMmfIpcMessage& aMessage, TInt aParam, TDes16& aResult)
136 #ifdef __MMF_USE_IPC_V2__
137 User::LeaveIfError(aMessage.Read(aParam, aResult));
139 // expect aParam to be a literal - so this code should optimise out
141 aMessage.ReadL(aMessage.Ptr0(), aResult);
143 aMessage.ReadL(aMessage.Ptr1(), aResult);
145 aMessage.ReadL(aMessage.Ptr2(), aResult);
147 aMessage.ReadL(aMessage.Ptr3(), aResult);
149 User::Leave(KErrArgument);
150 #endif __MMF_USE_IPC_V2__
153 inline void MmfMessageUtilX::WriteL(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC16& aValue)
155 #ifdef __MMF_USE_IPC_V2__
156 User::LeaveIfError(aMessage.Write(aParam, aValue));
158 // expect aParam to be a literal - so this code should optimise out
160 aMessage.WriteL(aMessage.Ptr0(), aValue);
162 aMessage.WriteL(aMessage.Ptr1(), aValue);
164 aMessage.WriteL(aMessage.Ptr2(), aValue);
166 aMessage.WriteL(aMessage.Ptr3(), aValue);
168 User::Leave(KErrArgument);
169 #endif __MMF_USE_IPC_V2__
172 inline TInt MmfMessageUtilX::Read(const RMmfIpcMessage& aMessage, TInt aParam, TDes16& aResult)
174 #ifdef __MMF_USE_IPC_V2__
175 return aMessage.Read(aParam, aResult);
177 TRAPD(error, ReadL(aMessage, aParam, aResult));
179 #endif __MMF_USE_IPC_V2__
182 inline TInt MmfMessageUtilX::Write(const RMmfIpcMessage& aMessage, TInt aParam, const TDesC16& aValue)
184 #ifdef __MMF_USE_IPC_V2__
185 return aMessage.Write(aParam, aValue);
187 TRAPD(error, WriteL(aMessage, aParam, aValue));
189 #endif __MMF_USE_IPC_V2__
194 #endif // __TESTFRAMEWORKIPC_INL__