Leviathan  0.8.0.0
Leviathan game engine
ScriptNotifiers.h
Go to the documentation of this file.
1 #pragma once
2 // ------------------------------------ //
3 #include "Define.h"
4 // ------------------------------------ //
6 #include "angelscript.h"
8 #include <map>
9 
10 
11 namespace Leviathan{
12 
13  bool RegisterNotifiersWithAngelScript(asIScriptEngine* engine);
14 
17  public:
18  DLLEXPORT ScriptNotifier(asIScriptFunction* functiontocall);
19  DLLEXPORT virtual ~ScriptNotifier();
20 
21 
22  protected:
23 
25  virtual void OnNotified(Lock &ownlock, BaseNotifiableAll* child, Lock &childlock)
26  override;
27 
28  // ------------------------------------ //
29 
31  asIScriptFunction* CallbackFunction;
32  };
33 
34 
37  public:
38  DLLEXPORT ScriptNotifiable(asIScriptFunction* functiontocall);
39  DLLEXPORT virtual ~ScriptNotifiable();
40 
41 
42  protected:
43 
45  virtual void OnNotified(Lock &ownlock, BaseNotifierAll* parent, Lock &parentlock)
46  override;
47 
48  // ------------------------------------ //
49 
51  asIScriptFunction* CallbackFunction;
52  };
53 
54 
55 }
56 
bool RegisterNotifiersWithAngelScript(asIScriptEngine *engine)
BaseNotifier for use in scripts.
Specialized class for accepting all parent/child objects.
Definition: BaseNotifier.h:103
virtual void OnNotified(Lock &ownlock, BaseNotifiableAll *child, Lock &childlock) override
Calls into the script engine.
DLLEXPORT ScriptNotifiable(asIScriptFunction *functiontocall)
virtual DLLEXPORT ~ScriptNotifiable()
virtual void OnNotified(Lock &ownlock, BaseNotifierAll *parent, Lock &parentlock) override
Calls into the script engine.
asIScriptFunction * CallbackFunction
The function that is called when this is notified.
asIScriptFunction * CallbackFunction
The function that is called when this is notified.
Specialized class for accepting all parent/child objects.
DLLEXPORT ScriptNotifier(asIScriptFunction *functiontocall)
BaseNotifiable for use in scripts.
#define DLLEXPORT
Definition: Include.h:115
The access mask controls which registered functions and classes a script sees.
Definition: GameModule.h:12
virtual DLLEXPORT ~ScriptNotifier()
std::unique_lock< std::mutex > Lock
Definition: ThreadSafe.h:16