examples/Base/IPC/ClientServer/Complex/ComplexClientSubSession.cpp

00001 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
00002 // All rights reserved.
00003 // This component and the accompanying materials are made available
00004 // under the terms of "Eclipse Public License v1.0"
00005 // which accompanies this distribution, and is available
00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00007 //
00008 // Initial Contributors:
00009 // Nokia Corporation - initial contribution.
00010 //
00011 // Contributors:
00012 //
00013 // Description:
00014 // Implementation of the RCountSubSession class
00015 //
00016 
00017 
00018 
00019 #include "ComplexClientAndServer.h"
00020 #include "ComplexClient.h"
00021 
00022 
00023 
00027 TInt RCountSubSession::Open(RCountSession &aSession)
00028     {
00029     return CreateSubSession(aSession,ECountServCreateSubSession);
00030         }
00031 
00032 
00039 void RCountSubSession::Close()
00040         {
00041         RSubSessionBase::CloseSubSession(ECountServCloseSubSession);
00042         }
00043 
00044 
00049 TInt RCountSubSession::SetFromString(const TDesC& aString)
00050         {
00051         TIpcArgs args(&aString);
00052     return SendReceive(ECountServInitSubSession, args);
00053         }
00054 
00055 
00060 void RCountSubSession::Increase()  
00061         {
00062         if (SubSessionHandle())
00063                 {
00064                 SendReceive(ECountServIncrease);
00065                 }
00066         }
00067 
00068 
00073 void RCountSubSession::IncreaseBy(TInt anInt)
00074         {
00075         if (SubSessionHandle())
00076                 {
00077                 TIpcArgs args(anInt);
00078             SendReceive(ECountServIncreaseBy, args);
00079                 }
00080         }
00081 
00082 
00087 void RCountSubSession::Decrease() 
00088         {
00089         if (SubSessionHandle())
00090                 {
00091                 SendReceive(ECountServDecrease);
00092                 }
00093         }
00094 
00095 
00100 void RCountSubSession::DecreaseBy(TInt anInt)
00101         {
00102         if (SubSessionHandle())
00103                 {
00104                 TIpcArgs args(anInt);
00105             SendReceive(ECountServDecreaseBy, args);
00106                 }
00107         }
00108 
00109 
00113 void RCountSubSession::Reset()
00114         {
00115         if (SubSessionHandle())
00116                 {
00117                 SendReceive(ECountServReset);
00118                 }
00119         }
00120 
00121 
00127 TInt RCountSubSession::CounterValue()
00128         {
00129         TInt res = KErrNotFound;
00130         TPckgBuf<TInt> pckg;
00131         
00132         if (SubSessionHandle())
00133                 {
00134                   // Note that TPckgBuf is of type TDes8
00135             TIpcArgs args(&pckg);
00136             SendReceive(ECountServValue, args);
00137                 
00138                   // Extract the value returned from the server. 
00139             res = pckg();
00140                 }
00141                 
00142     return res;        
00143         }
00144 
00145 
00146 

Generated by  doxygen 1.6.2