KSquare Utilities
GlobalGoalKeeper.h
Go to the documentation of this file.
1 /* GlobalGoalKeeper.h -- Implements blocking routines to support thread synchronization.
2  * Copyright (C) 1994-2011 Kurt Kramer
3  * For conditions of distribution and use, see copyright notice in KKB.h
4  */
5 #ifndef _KKU_GLOBALGOALKEEPER_
6 #define _KKU_GLOBALGOALKEEPER_
7 
8 
9 #include "KKStr.h"
10 
11 namespace KKB
12 {
13  #if !defined(_GoalKeeper_Defined_)
14  class GoalKeeper;
15  typedef GoalKeeper* GoalKeeperPtr;
16  #endif
17 
18 
19  /**
20  *@brief Maintains one instance of a GoalKeeper object that can be used anywhere in the application.
21  *@details It is meant to be used for simple cases.
22  */
24  {
25  public:
26  static void StartBlock ();
27  static void EndBlock ();
28 
29  private:
30  static void CreateGlobalGoalie ();
31  static void CleanUp ();
32 
33  static GoalKeeperPtr globalGoalie;
34  }; /* GlobalGoalKeeper */
35 }
36 
37 #endif
GoalKeeper * GoalKeeperPtr
KKTHread * KKTHreadPtr
Maintains one instance of a GoalKeeper object that can be used anywhere in the application.