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