MezzanineEngine
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Mezzanine
src
eventsubscriberslot.cpp
1
// © Copyright 2010 - 2012 BlackTopp Studios Inc.
2
/* This file is part of The Mezzanine Engine.
3
4
The Mezzanine Engine is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
The Mezzanine Engine is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
/* The original authors have included a copy of the license specified above in the
18
'Docs' folder. See 'gpl.txt'
19
*/
20
/* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21
Build professional software and charge for their product.
22
23
However there are some practical restrictions, so if your project involves
24
any of the following you should contact us and we will try to work something
25
out:
26
- DRM or Copy Protection of any kind(except Copyrights)
27
- Software Patents You Do Not Wish to Freely License
28
- Any Kind of Linking to Non-GPL licensed Works
29
- Are Currently In Violation of Another Copyright Holder's GPL License
30
- If You want to change our code and not add a few hundred MB of stuff to
31
your distribution
32
33
These and other limitations could cause serious legal problems if you ignore
34
them, so it is best to simply contact us or the Free Software Foundation, if
35
you have any questions.
36
37
Joseph Toppi - toppij@gmail.com
38
John Blackwood - makoenergy02@gmail.com
39
*/
40
#ifndef _eventsubscriberslot_cpp
41
#define _eventsubscriberslot_cpp
42
43
#include "eventsubscriberslot.h"
44
#include "eventsubscriber.h"
45
46
namespace
Mezzanine
47
{
48
///////////////////////////////////////////////////////////////////////////////
49
// EventSubscriberSlot Methods
50
51
EventSubscriberSlot::EventSubscriberSlot
(
Event
* Ev) :
52
SubbedEvent(Ev)
53
{ }
54
55
EventSubscriberSlot::~EventSubscriberSlot
()
56
{ }
57
58
///////////////////////////////////////////////////////////////////////////////
59
// Utility
60
61
Event
*
EventSubscriberSlot::GetEvent
()
const
62
{
return
this->
SubbedEvent
; }
63
64
///////////////////////////////////////////////////////////////////////////////
65
// Internal Methods
66
67
///////////////////////////////////////////////////////////////////////////////
68
// CustomEventSubscriberSlot Methods
69
70
CustomSubscriberSlot::CustomSubscriberSlot
(
Event
* Ev,
EventSubscriber
* Sub) :
71
EventSubscriberSlot
(Ev),
72
Subscriber(Sub)
73
{ }
74
75
CustomSubscriberSlot::~CustomSubscriberSlot
()
76
{ }
77
78
///////////////////////////////////////////////////////////////////////////////
79
// Utility
80
81
EventSubscriber
*
CustomSubscriberSlot::GetSubscriber
()
const
82
{
return
this->
Subscriber
; }
83
84
EventSubscriberSlot::SlotType
CustomSubscriberSlot::GetType
()
const
85
{
return
EventSubscriberSlot::ST_Custom; }
86
87
///////////////////////////////////////////////////////////////////////////////
88
// Internal Methods
89
90
void
CustomSubscriberSlot::_NotifyEvent
(
const
EventArguments
& Args)
91
{ this->
Subscriber
->
_NotifyEvent
(Args); }
92
93
///////////////////////////////////////////////////////////////////////////////
94
// FunctorSubscriberSlot Methods
95
96
FunctorSubscriberSlot::FunctorSubscriberSlot
(
Event
* Ev,
FunctorDefinition
* Funct,
bool
CleanUpAfter) :
97
EventSubscriberSlot
(Ev),
98
Functor(Funct),
99
CleanUp(CleanUpAfter)
100
{ }
101
102
FunctorSubscriberSlot::~FunctorSubscriberSlot
()
103
{ }
104
105
///////////////////////////////////////////////////////////////////////////////
106
// Utility
107
108
FunctorSubscriberSlot::FunctorDefinition
*
FunctorSubscriberSlot::GetFunctor
()
const
109
{
return
this->
Functor
; }
110
111
EventSubscriberSlot::SlotType
FunctorSubscriberSlot::GetType
()
const
112
{
return
EventSubscriberSlot::ST_Functor; }
113
114
///////////////////////////////////////////////////////////////////////////////
115
// Internal Methods
116
117
void
FunctorSubscriberSlot::_NotifyEvent
(
const
EventArguments
& Args)
118
{ this->
Functor
->operator()(Args); }
119
120
///////////////////////////////////////////////////////////////////////////////
121
// CFunctionSubscriberSlot Methods
122
123
CFunctionSubscriberSlot::CFunctionSubscriberSlot
(
Event
* Ev, SubscriberFunction* Funct) :
124
EventSubscriberSlot
(Ev),
125
Function(Funct)
126
{ }
127
128
CFunctionSubscriberSlot::~CFunctionSubscriberSlot
()
129
{ }
130
131
///////////////////////////////////////////////////////////////////////////////
132
// Utility
133
134
CFunctionSubscriberSlot::SubscriberFunction
*
CFunctionSubscriberSlot::GetFunction
()
const
135
{
return
this->
Function
; }
136
137
EventSubscriberSlot::SlotType
CFunctionSubscriberSlot::GetType
()
const
138
{
return
EventSubscriberSlot::ST_CFunction; }
139
140
///////////////////////////////////////////////////////////////////////////////
141
// Internal Methods
142
143
void
CFunctionSubscriberSlot::_NotifyEvent
(
const
EventArguments
& Args)
144
{ this->
Function
(Args); }
145
146
///////////////////////////////////////////////////////////////////////////////
147
// ScriptSubscriberSlot Methods
148
149
ScriptSubscriberSlot::ScriptSubscriberSlot
(
Event
* Ev,
Scripting::iScript
* SubScript) :
150
EventSubscriberSlot
(Ev),
151
SubscriberScript(SubScript)
152
{ }
153
154
ScriptSubscriberSlot::~ScriptSubscriberSlot
()
155
{ }
156
157
///////////////////////////////////////////////////////////////////////////////
158
// Utility
159
160
Scripting::iScript
*
ScriptSubscriberSlot::GetScript
()
const
161
{
return
this->
SubscriberScript
; }
162
163
EventSubscriberSlot::SlotType
ScriptSubscriberSlot::GetType
()
const
164
{
return
EventSubscriberSlot::ST_Script; }
165
166
///////////////////////////////////////////////////////////////////////////////
167
// Internal Methods
168
169
void
ScriptSubscriberSlot::_NotifyEvent
(
const
EventArguments
& Args)
170
{
171
/// @todo This needs to be implemented.
172
}
173
}
//Mezzanine
174
175
#endif
Generated on Mon Jan 6 2014 20:58:05 for MezzanineEngine by
1.8.4