testexecmdw/tef/tef/utils/inc/testexecuteserverutils.inl
branchRCL_3
changeset 3 9397a16b6eb8
parent 1 6edeef394eb7
equal deleted inserted replaced
1:6edeef394eb7 3:9397a16b6eb8
     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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 inline TRequestStatus& CActiveBase::Status()
       
    22 	{
       
    23 	return iStatus;
       
    24 	}
       
    25 
       
    26 inline void CActiveBase::SetActive()
       
    27 	{
       
    28 	if (!IsActive())
       
    29 		CActive::SetActive();
       
    30 	}
       
    31 
       
    32 inline void CActiveBase::Kick()
       
    33 	{
       
    34 	Prime();
       
    35 	Complete(KErrNone);
       
    36 	}
       
    37 
       
    38 inline void CActiveBase::Prime()
       
    39 	{
       
    40 	iStatus = KRequestPending;
       
    41 	if (!IsActive())
       
    42 		CActive::SetActive();
       
    43 	}
       
    44 
       
    45 inline void CActiveBase::Complete(TInt aCode)
       
    46 	{
       
    47 	TRequestStatus* status = &iStatus;
       
    48 	User::RequestComplete(status, aCode);
       
    49 	}
       
    50 
       
    51 inline CActiveBase::CActiveBase() :
       
    52 	CActive(EPriorityStandard)
       
    53 	{
       
    54 	CActiveScheduler::Add(this);
       
    55 	}
       
    56 
       
    57 inline CActiveBase::~CActiveBase()
       
    58 	{
       
    59 	}
       
    60 
       
    61 inline TDes& CActiveBase::Error()
       
    62 	{
       
    63 	return iError;
       
    64 	}
       
    65 
       
    66 inline TBool& CActiveBase::TimedOut()
       
    67 	{
       
    68 	return iTimeOut;
       
    69 	}
       
    70 
       
    71 ///////
       
    72 
       
    73 inline CControlBase::CControlBase(CTestServer& aServer) :
       
    74 	iServer(aServer)
       
    75 	{
       
    76 	}
       
    77 
       
    78 inline CTestServer& CControlBase::Server()
       
    79 	{
       
    80 	return iServer;
       
    81 	}
       
    82 
       
    83 inline TDes& CControlBase::Args()
       
    84 	{
       
    85 	return iArgs;
       
    86 	}
       
    87 
       
    88 inline RMessage2& CControlBase::Message()
       
    89 	{
       
    90 	return iMessage;
       
    91 	}
       
    92 
       
    93 inline RThread& CControlBase::WorkerThread()
       
    94 	{
       
    95 	return iWorkerThread;
       
    96 	}
       
    97 
       
    98 inline void CControlBase::DoCancel()
       
    99 	{
       
   100 	}
       
   101 
       
   102 ///////
       
   103 
       
   104 inline void CPersistentStepControl::ChildCompletion()
       
   105 	{
       
   106 	Complete(KErrNone);
       
   107 	}
       
   108 
       
   109 ///////
       
   110 
       
   111 inline void CPersistentBlockControl::ChildCompletion()
       
   112 	{
       
   113 	Complete(KErrNone);
       
   114 	}
       
   115 
       
   116 ///////
       
   117 
       
   118 inline CWorkerMonitor::CWorkerMonitor(TRequestStatus& aParentStatus) :
       
   119 	iParentStatus(aParentStatus)
       
   120 	{
       
   121 	}
       
   122 
       
   123 inline CWorkerMonitor::~CWorkerMonitor()
       
   124 	{
       
   125 	}
       
   126 
       
   127 inline void CWorkerMonitor::RunL()
       
   128 	{
       
   129 	TRequestStatus* status = &iParentStatus;
       
   130 	User::RequestComplete(status, KErrNone);
       
   131 	}
       
   132 
       
   133 inline void CWorkerMonitor::DoCancel()
       
   134 	{
       
   135 	}
       
   136 
       
   137 ///////
       
   138 
       
   139 inline CWorkerControl::CWorkerControl(CTestServer& aServer,
       
   140 		TRequestStatus& aParentStatus) :
       
   141 	iServer(aServer), iParentStatus(aParentStatus)
       
   142 	{
       
   143 	}
       
   144 
       
   145 inline CWorkerControl::~CWorkerControl()
       
   146 	{
       
   147 	}
       
   148 
       
   149 inline void CWorkerControl::RunL()
       
   150 	{
       
   151 	TRequestStatus* status = &iParentStatus;
       
   152 	User::RequestComplete(status, KErrNone);
       
   153 	}
       
   154 
       
   155 inline void CWorkerControl::DoCancel()
       
   156 	{
       
   157 	}
       
   158 
       
   159 inline TRequestStatus& CWorkerControl::WorkerStatus()
       
   160 	{
       
   161 	return iWorkerStatus;
       
   162 	}
       
   163 
       
   164 inline RThread& CWorkerControl::ControllerThread()
       
   165 	{
       
   166 	return iControllerThread;
       
   167 	}
       
   168 
       
   169 inline RSemaphore& CWorkerControl::Semaphore()
       
   170 	{
       
   171 	return iSemaphore;
       
   172 	}
       
   173 
       
   174 inline CTestServer& CWorkerControl::Server()
       
   175 	{
       
   176 	return iServer;
       
   177 	}
       
   178 
       
   179 inline TInt& CWorkerControl::Result()
       
   180 	{
       
   181 	return iResult;
       
   182 	}
       
   183 
       
   184 inline TPtrC& CWorkerControl::Args()
       
   185 	{
       
   186 	return iArgs;
       
   187 	}
       
   188 
       
   189 inline TPtrC& CWorkerControl::StepName()
       
   190 	{
       
   191 	return iStepName;
       
   192 	}
       
   193 
       
   194 inline TDes& CWorkerControl::PersistentError()
       
   195 	{
       
   196 	return iPersistentError;
       
   197 	}
       
   198 
       
   199 //defect 116046
       
   200 inline void CWorkerControl::SetCleanupPtr(CTrapCleanup* aCleanup)
       
   201 	{
       
   202 	iCleanup = aCleanup;
       
   203 	}
       
   204 
       
   205 inline void CWorkerControl::Cleanup()
       
   206 	{
       
   207 	if (iCleanup)
       
   208 		delete iCleanup;
       
   209 	iCleanup = NULL;
       
   210 	}
       
   211 //END defect 116046
       
   212 
       
   213 ///////
       
   214 
       
   215 inline CBlockWorkerControl::CBlockWorkerControl(CTestServer& aServer,
       
   216 		TRequestStatus& aParentStatus) :
       
   217 	CWorkerControl(aServer, aParentStatus)
       
   218 	{
       
   219 	}
       
   220 
       
   221 inline CBlockWorkerControl::~CBlockWorkerControl()
       
   222 	{
       
   223 	}
       
   224 
       
   225 inline void CBlockWorkerControl::SetBlockArray(TTEFItemArray* aBlockArray)
       
   226 	{
       
   227 	iBlockArray = aBlockArray;
       
   228 	}
       
   229 
       
   230 inline TTEFItemArray* CBlockWorkerControl::BlockArray() const
       
   231 	{
       
   232 	return iBlockArray;
       
   233 	}
       
   234 
       
   235 ///////
       
   236 
       
   237 inline CStepControlBase::CStepControlBase(CTestServer& aServer) :
       
   238 	CControlBase(aServer)
       
   239 	{
       
   240 	}
       
   241 
       
   242 inline TDes& CStepControlBase::StepName()
       
   243 	{
       
   244 	return iStepName;
       
   245 	}
       
   246 
       
   247 ///////
       
   248 
       
   249 inline CBlockControlBase::CBlockControlBase(CTestServer& aServer) :
       
   250 	CControlBase(aServer), iBlockArray(NULL)
       
   251 	{
       
   252 	}