GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_contextmanager.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
23 
24 #ifndef GLC_CONTEXTMANAGER_H_
25 #define GLC_CONTEXTMANAGER_H_
26 
27 #include <QSet>
28 
29 #include "glc_config.h"
30 
31 
32 class GLC_Context;
33 
36 
37 
39 {
40 private:
42 public:
43  virtual ~GLC_ContextManager();
44 
46 
47 
49 
50 public:
52  static GLC_ContextManager* instance();
53 
55  GLC_Context* currentContext() const;
56 
58  inline bool currentContextExists() const
59  {return (NULL != m_pCurrentContext);}
60 
62  inline bool hasContext() const
63  {return !m_SetOfContext.isEmpty();}
64 
66 
67 
69 
70 public:
72  void addContext(GLC_Context* pContext);
73 
75  void remove(GLC_Context* pContext);
76 
78  void setCurrent(GLC_Context* pContext);
79 
81 
83 
84 private:
86 
88 
89 
91 // Private members
93 private:
96 
99 
101  QSet<GLC_Context*> m_SetOfContext;
102 };
103 
104 #endif /* GLC_CONTEXTMANAGER_H_ */

©2005-2013 Laurent Ribon