Logo ROOT   6.14/05
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 #include "Rtypes.h"
16 
17 typedef void (*TGWin32CallBack)(void*);
18 class TList;
19 class TGWin32ProxyBasePrivate;
20 
21 ////////////////////////////////////////////////////////////////////////////////
23 friend class TGWin32;
24 friend class TGWin32GL;
25 
26 protected:
27  TGWin32ProxyBasePrivate *fPimpl; ///< very private data
28  Int_t fBatchLimit; ///< batch limit
29  TList *fListOfCallBacks; ///< list of callbacks (used for batch processing)
30  TGWin32CallBack fCallBack; ///< callback function (executed by "main" thread)
31  void *fParam; ///< arguments passed to/from callback function
32  ULong_t fId; ///< thread id. There is one proxy per client thread
33  Bool_t fIsVirtualX; ///< true if actual TVirtualX implementation
34  static UInt_t fMaxResponseTime; ///< max period for waiting response from server thread
35  static Long_t fgLock; ///< fgLock=1 - all client threads locked
36 
37  virtual Bool_t ForwardCallBack(Bool_t sync);
38  virtual void SendExitMessage();
39 
40 public: // private:
41  static ULong_t fgPostMessageId; ///< post message ID
42  static ULong_t fgPingMessageId; ///< ping message ID
43  static ULong_t fgMainThreadId; ///< main thread ID
44  static ULong_t fgUserThreadId; ///< user (e.g. python) thread ID
45 
46  static void Lock();
47  static void Unlock();
48  static void GlobalLock();
49  static void GlobalUnlock();
50  static Bool_t IsGloballyLocked();
51  static Bool_t Ping();
52 
53 public:
55  virtual ~TGWin32ProxyBase();
56  virtual void ExecuteCallBack(Bool_t sync);
57  virtual Double_t GetMilliSeconds();
58  ULong_t GetId() const { return fId; }
59 };
60 
61 #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:67
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:44
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