testtoolsconn/stat/desktop/testsource/dlltestermt/inc/stattask.h
changeset 0 3da2a79470a7
equal deleted inserted replaced
-1:000000000000 0:3da2a79470a7
       
     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 #ifndef STATTASK_H
       
    22 #define STATTASK_H
       
    23 
       
    24 // pointer to our thread procedure
       
    25 typedef DWORD (WINAPI *ThreadProc) (LPVOID);
       
    26 
       
    27 class STATTask
       
    28 {
       
    29 public:
       
    30 	STATTask(const ThreadProc pFunc, void *pMember, char *pConection = NULL);
       
    31 	~STATTask();
       
    32 	bool Start();
       
    33 	bool StillActive(DWORD timeout = 5);
       
    34 	bool Kill();
       
    35 	void * Member() { return theMember; }
       
    36 	char * Connection() { return szConection; }
       
    37 
       
    38 private:
       
    39 	HANDLE hThreadHandle;				// handle to this thread
       
    40 	ThreadProc pfThreadProc;
       
    41 	void *theMember;					// pointer to associated object
       
    42 	char *szConection;					// connection string
       
    43 };
       
    44 
       
    45 #endif