| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
- // Please see LICENSE.md in repository root for license information
- // https://github.com/AtomicGameEngine/AtomicGameEngine
- #pragma once
- #include <Atomic/Core/Context.h>
- #include <Atomic/Core/Object.h>
- #include "JSVM.h"
- namespace Atomic
- {
- class JSVM;
- /// Javascript subsystem.
- class ATOMIC_API Javascript : public Object
- {
- OBJECT(Javascript);
- public:
- /// Construct.
- Javascript(Context* context);
- /// Destruct.
- ~Javascript();
- /// Returns NULL if a VM with name already exists
- JSVM* InstantiateVM(const String& name);
- /// Gets a VM with the given name
- inline JSVM* GetVM(const String& name)
- {
- return vms_[name];
- }
- /// Closes the VM with the given name
- void ShutdownVM(const String& name);
- private:
- HashMap<String, SharedPtr<JSVM> > vms_;
- };
- /// Register Javascript library objects.
- void ATOMIC_API RegisterJavascriptLibrary(Context* context);
- }
|