Nebula
Loading...
Searching...
No Matches
nsharpserver.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
14#include "core/refcounted.h"
15#include "core/singleton.h"
16#include "util/string.h"
17#include "ids/id.h"
18#include "io/uri.h"
19#include "util/arrayallocator.h"
20#include "util/dictionary.h"
21#include "system/library.h"
22#include "nsconfig.h"
23#include "assemblyid.h"
24#include "util/delegate.h"
25
26//------------------------------------------------------------------------------
27namespace Scripting
28{
29
31{
34public:
38 virtual ~NSharpServer();
40 bool Open();
42 void Close();
44 void SetDebuggingEnabled(bool enabled);
45 void WaitForDebuggerToConnect(bool enabled);
49 int ExecUnmanagedCall(AssemblyId assemblyId, Util::String const& function);
51 bool const IsOpen();
54 AssemblyId assemblyId, Util::String const& assemblyQualifiedFunctionName, Util::String const& assemblyQualifiedDelegateName
55 );
57 void* GetUnmanagedFuncPointer(AssemblyId assemblyId, Util::String const& assemblyQualifiedFunctionName);
58
59private:
60 struct Assembly;
61
63 bool LoadHostFxr();
64 void CloseHostFxr();
65
68
71
72 bool isOpen;
74};
75
76
77} // namespace Scripting
78//------------------------------------------------------------------------------
The common base class of Nebula.
Definition refcounted.h:38
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
C# backend for the Nebula scripting subsystem.
Definition nsharpserver.h:31
bool waitForDebugger
Definition nsharpserver.h:70
bool isOpen
Definition nsharpserver.h:72
bool LoadHostFxr()
load the host fxr library and get exported function addresses
Definition nsharpserver.cc:148
Util::Dictionary< Util::String, uint32_t > assemblyTable
Definition nsharpserver.h:67
Util::ArrayAllocator< Assembly * > assemblies
Definition nsharpserver.h:66
__DeclareSingleton(NSharpServer)
NSharpServer()
constructor
Definition nsharpserver.cc:84
System::Library hostfxr
Definition nsharpserver.h:73
void CloseHostFxr()
Definition nsharpserver.cc:182
void Close()
close the script server
Definition nsharpserver.cc:363
void * GetUnmanagedFuncPointer(AssemblyId assemblyId, Util::String const &assemblyQualifiedFunctionName)
Get a function pointer ([UnmanagedCallersOnly]) from an assembly.
Definition nsharpserver.cc:242
void WaitForDebuggerToConnect(bool enabled)
Definition nsharpserver.cc:385
bool Open()
open the script server
Definition nsharpserver.cc:348
void SetDebuggingEnabled(bool enabled)
enable debugging. this needs to be called before Open()
Definition nsharpserver.cc:376
virtual ~NSharpServer()
destructor
Definition nsharpserver.cc:95
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 delega...
Definition nsharpserver.cc:425
bool const IsOpen()
Check if server is open.
Definition nsharpserver.cc:443
bool debuggerEnabled
Definition nsharpserver.h:69
AssemblyId LoadAssembly(IO::URI const &uri)
Load dotnet exe or DLL at path.
Definition nsharpserver.cc:394
void * GetDelegatePointer(AssemblyId assemblyId, Util::String const &assemblyQualifiedFunctionName, Util::String const &assemblyQualifiedDelegateName)
Get a delegate pointer from an assembly.
Definition nsharpserver.cc:193
__DeclareClass(NSharpServer)
Use to load dynamic libraries and their addresses.
The ArrayAllocator provides a variadic list of types which is to be contained in the allocator and fe...
Definition arrayallocator.h:34
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
Prototype for deargui scripting init.
Definition deargui.cpp:2701
Definition assemblyid.h:12
Definition nsharpserver.cc:41
Nebula's universal string class.
Definition string.h:50