xoreos  0.0.5
requesttypes.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef EVENTS_REQUESTTYPES_H
26 #define EVENTS_REQUESTTYPES_H
27 
28 #include "src/common/types.h"
29 #include "src/common/mutex.h"
30 
31 #include "src/events/types.h"
32 
33 #include "src/graphics/types.h"
34 
35 namespace Graphics {
36  class GLContainer;
37 }
38 
39 namespace Events {
40 
41 // Data structures for specific requests
42 
45 };
46 
49 };
50 
52 class Request {
53 public:
54  Request(ITCEvent type);
55  ~Request();
56 
57  bool isGarbage() const;
58 
59 private:
61 
62  bool _dispatched;
63  bool _garbage;
64 
66 
68 
70  union {
73  };
74 
76  void create();
77 
79  void copyToReply();
80 
82  void signalReply();
83 
84  void setGarbage();
85 
86  friend class EventsManager;
87  friend class RequestManager;
88 };
89 
90 } // End of namespace Events
91 
92 #endif // EVENTS_REQUESTTYPES_H
void create()
Create the empty request frame.
void signalReply()
Signal that the request was answered.
Basic event types.
Event _event
The actual event.
Definition: requesttypes.h:67
The request manager, handling all requests.
Definition: requests.h:65
A semaphore .
Definition: mutex.h:55
RequestDataGLContainer _glContainer
Definition: requesttypes.h:72
Graphics::GLContainer * glContainer
Definition: requesttypes.h:48
Basic graphics types.
ITCEvent _type
Definition: requesttypes.h:60
SDL_Event Event
Definition: types.h:42
const MainThreadCallerFunctor * caller
Definition: requesttypes.h:44
bool isGarbage() const
void copyToReply()
Copy reply data to the reply address.
ITCEvent
Specific type of the inter-thread communication.
Definition: types.h:70
Low-level type definitions to handle fixed width types portably.
The events manager.
Definition: events.h:48
boost::function< void()> MainThreadCallerFunctor
Definition: types.h:346
Thread mutex classes.
Request(ITCEvent type)
Common::Semaphore _hasReply
Do we have a reply?
Definition: requesttypes.h:65
A request, carrying inter-thread communication.
Definition: requesttypes.h:52
A container of OpenGL elements.
Definition: glcontainer.h:35
RequestCallInMainThread _callInMainThread
Definition: requesttypes.h:71
bool _dispatched
Was the request dispatched?
Definition: requesttypes.h:62