|
Nebula
|
#include <nsharpserver.h>
C# backend for the Nebula scripting subsystem.
Main goals for the nSharp library: Fast compilation times. Hot reloading.
(C) 2019 Individual contributors, see AUTHORS file
Inherits Core::RefCounted.
Classes | |
| struct | Assembly |
Public Member Functions | |
| NSharpServer () | |
| constructor | |
| virtual | ~NSharpServer () |
| destructor | |
| bool | Open () |
| open the script server | |
| void | Close () |
| close the script server | |
| void | SetDebuggingEnabled (bool enabled) |
| enable debugging. this needs to be called before Open() | |
| void | WaitForDebuggerToConnect (bool enabled) |
| AssemblyId | LoadAssembly (IO::URI const &uri) |
| Load dotnet exe or DLL at path. | |
| int | ExecUnmanagedCall (AssemblyId assemblyId, Util::String const &function) |
| Execute function in an assembly. This is not very efficient and should not be used in place of delegates. | |
| bool const | IsOpen () |
| Check if server is open. | |
| void * | GetDelegatePointer (AssemblyId assemblyId, Util::String const &assemblyQualifiedFunctionName, Util::String const &assemblyQualifiedDelegateName) |
| Get a delegate pointer from an assembly. | |
| void * | GetUnmanagedFuncPointer (AssemblyId assemblyId, Util::String const &assemblyQualifiedFunctionName) |
| Get a function pointer ([UnmanagedCallersOnly]) from an assembly. | |
Public Member Functions inherited from Core::RefCounted | |
| RefCounted () | |
| constructor | |
| int | GetRefCount () const |
| get the current refcount | |
| void | AddRef () |
| increment refcount by one | |
| void | Release () |
| decrement refcount and destroy object if refcount is zero | |
| bool | IsInstanceOf (const Rtti &rtti) const |
| return true if this object is instance of given class | |
| bool | IsInstanceOf (const Util::String &className) const |
| return true if this object is instance of given class by string | |
| bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
| return true if this object is instance of given class by fourcc | |
| bool | IsA (const Rtti &rtti) const |
| return true if this object is instance of given class, or a derived class | |
| bool | IsA (const Util::String &rttiName) const |
| return true if this object is instance of given class, or a derived class, by string | |
| bool | IsA (const Util::FourCC &rttiFourCC) const |
| return true if this object is instance of given class, or a derived class, by fourcc | |
| const Util::String & | GetClassName () const |
| get the class name | |
| Util::FourCC | GetClassFourCC () const |
| get the class FourCC code | |
Private Member Functions | |
| __DeclareClass (NSharpServer) | |
| __DeclareSingleton (NSharpServer) | |
| bool | LoadHostFxr () |
| load the host fxr library and get exported function addresses | |
| void | CloseHostFxr () |
Private Attributes | |
| Util::ArrayAllocator< Assembly * > | assemblies |
| Util::Dictionary< Util::String, uint32_t > | assemblyTable |
| bool | debuggerEnabled |
| bool | waitForDebugger |
| bool | isOpen |
| System::Library | hostfxr |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::RefCounted | |
| static void | DumpRefCountingLeaks () |
| dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!) | |
Protected Member Functions inherited from Core::RefCounted | |
| virtual | ~RefCounted () |
| destructor (called when refcount reaches zero) | |
| Scripting::NSharpServer::NSharpServer | ( | ) |
constructor
|
virtual |
destructor
|
private |
|
private |
| void Scripting::NSharpServer::Close | ( | ) |
close the script server
|
private |
| int Scripting::NSharpServer::ExecUnmanagedCall | ( | AssemblyId | assemblyId, |
| Util::String const & | function ) |
Execute function in an assembly. This is not very efficient and should not be used in place of delegates.
Function should be formatted as: "Namespace.Namespace.Class+NestedClass::Function()".
| void * Scripting::NSharpServer::GetDelegatePointer | ( | AssemblyId | assemblyId, |
| Util::String const & | assemblyQualifiedFunctionName, | ||
| Util::String const & | assemblyQualifiedDelegateName ) |
Get a delegate pointer from an assembly.
Function should be formatted as: "Namespace.Namespace.Class+NestedClass::Function()".
| void * Scripting::NSharpServer::GetUnmanagedFuncPointer | ( | AssemblyId | assemblyId, |
| Util::String const & | assemblyQualifiedFunctionName ) |
Get a function pointer ([UnmanagedCallersOnly]) from an assembly.
Function should be formatted as: "Namespace.Namespace.Class+NestedClass::Function()".
| bool const Scripting::NSharpServer::IsOpen | ( | ) |
Check if server is open.
| AssemblyId Scripting::NSharpServer::LoadAssembly | ( | IO::URI const & | uri | ) |
Load dotnet exe or DLL at path.
|
private |
load the host fxr library and get exported function addresses
Using the nethost library, discover the location of hostfxr and get exports.
| bool Scripting::NSharpServer::Open | ( | ) |
open the script server
| void Scripting::NSharpServer::SetDebuggingEnabled | ( | bool | enabled | ) |
enable debugging. this needs to be called before Open()
| void Scripting::NSharpServer::WaitForDebuggerToConnect | ( | bool | enabled | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |