Logo ROOT   6.08/07
Reference Guide
TGWin32ProxyBase.h
Go to the documentation of this file.
1 // @(#)root/win32gdk:$Id$
2 // Author: Valeriy Onuchin 08/08/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TGWin32ProxyBase
13 #define ROOT_TGWin32ProxyBase
14 
15 #ifndef ROOT_Rtypes
16 #include "Rtypes.h"
17 #endif
18 
19 typedef void (*TGWin32CallBack)(void*);
20 class TList;
21 class TGWin32ProxyBasePrivate;
22 
23 ////////////////////////////////////////////////////////////////////////////////
25 friend class TGWin32;
26 friend class TGWin32GL;
27 
28 protected:
29  TGWin32ProxyBasePrivate *fPimpl; ///< very private data
30  Int_t fBatchLimit; ///< batch limit
31  TList *fListOfCallBacks; ///< list of callbacks (used for batch processing)
32  TGWin32CallBack fCallBack; ///< callback function (executed by "main" thread)
33  void *fParam; ///< arguments passed to/from callback function
34  ULong_t fId; ///< thread id. There is one proxy per client thread
35  Bool_t fIsVirtualX; ///< true if actual TVirtualX implementation
36  static UInt_t fMaxResponseTime; ///< max period for waiting response from server thread
37  static Long_t fgLock; ///< fgLock=1 - all client threads locked
38 
39  virtual Bool_t ForwardCallBack(Bool_t sync);
40  virtual void SendExitMessage();
41 
42 public: // private:
43  static ULong_t fgPostMessageId; ///< post message ID
44  static ULong_t fgPingMessageId; ///< ping message ID
45  static ULong_t fgMainThreadId; ///< main thread ID
46  static ULong_t fgUserThreadId; ///< user (e.g. python) thread ID
47 
48  static void Lock();
49  static void Unlock();
50  static void GlobalLock();
51  static void GlobalUnlock();
52  static Bool_t IsGloballyLocked();
53  static Bool_t Ping();
54 
55 public:
57  virtual ~TGWin32ProxyBase();
58  virtual void ExecuteCallBack(Bool_t sync);
59  virtual Double_t GetMilliSeconds();
60  ULong_t GetId() const { return fId; }
61 };
62 
63 #endif
virtual void ExecuteCallBack(Bool_t sync)
Executes all batched callbacks and the latest callback This method is executed by server thread...
void * fParam
arguments passed to/from callback function
TGWin32CallBack fCallBack
callback function (executed by "main" thread)
TList * fListOfCallBacks
list of callbacks (used for batch processing)
static void GlobalUnlock()
unlock any proxy (client thread)
static UInt_t fMaxResponseTime
max period for waiting response from server thread
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~TGWin32ProxyBase()
dtor
This class is the basic interface to the Win32 graphics system.
Definition: TGWin32.h:71
Proxy classes provide thread-safe interface to global objects.
static void Lock()
enter critical section
virtual void SendExitMessage()
send exit message to server thread
static Long_t fgLock
fgLock=1 - all client threads locked
static void GlobalLock()
lock any proxy (client thread)
static ULong_t fgMainThreadId
main thread ID
A doubly linked list.
Definition: TList.h:47
static ULong_t fgPostMessageId
post message ID
static ULong_t fgUserThreadId
user (e.g. python) thread ID
unsigned int UInt_t
Definition: RtypesCore.h:42
Int_t fBatchLimit
batch limit
friend class TGWin32GL
Bool_t fIsVirtualX
true if actual TVirtualX implementation
ULong_t GetId() const
long Long_t
Definition: RtypesCore.h:50
double Double_t
Definition: RtypesCore.h:55
unsigned long ULong_t
Definition: RtypesCore.h:51
void(* TGWin32CallBack)(void *)
ULong_t fId
thread id. There is one proxy per client thread
TGWin32ProxyBasePrivate * fPimpl
very private data
virtual Bool_t ForwardCallBack(Bool_t sync)
if sync is kTRUE:
static ULong_t fgPingMessageId
ping message ID
typedef void((*Func_t)())
static Bool_t IsGloballyLocked()
Check the status of the lock.
virtual Double_t GetMilliSeconds()
returns elapsed time in milliseconds with microseconds precision
static Bool_t Ping()
send ping messsage to server thread
static void Unlock()
leave critical section