Added demo for cpp module and updated the CppModule

This commit is contained in:
2025-06-24 22:11:15 +03:00
parent 89385a8c89
commit 962d813466
16 changed files with 304 additions and 62 deletions

View File

@@ -43,25 +43,26 @@ public class ExternalApplicationHandler
_ExternalApplicationManager.FreeApplication(applicationId);
}
public void CallFunctionWithParameter(Guid appId, string functionName, ref object parameter)
public T GetFunctionDelegate<T>(Guid applicationId, string functionName) where T : Delegate
{
if (_ExternalApplicationManager is null)
{
_Logger.Log("Failed to call function because the manager is not initialized. This should have never happened in the first place!!!", this, LogType.Critical);
return;
_Logger.Log("Failed to get function delegate because the manager is not initialized. This should have never happened in the first place!!!", this, LogType.Critical);
return default!;
}
_ExternalApplicationManager.ExecuteApplicationFunctionWithParameter(appId, functionName, ref parameter);
return _ExternalApplicationManager.GetFunctionDelegate<T>(applicationId, functionName);
}
public void CallFunctionWithoutParameter(Guid appId, string functionName)
public object? SetExternFunctionToPointToFunction<TLocalFunctionDelegate>(Guid applicationId, string functionName,
TLocalFunctionDelegate localFunction) where TLocalFunctionDelegate : Delegate
{
if (_ExternalApplicationManager is null)
if(_ExternalApplicationManager is null)
{
_Logger.Log("Failed to call function because the manager is not initialized. This should have never happened in the first place!!!", this, LogType.Critical);
return;
_Logger.Log("Failed to set external function pointer because the manager is not initialized. This should have never happened in the first place!!!", this, LogType.Critical);
return null;
}
_ExternalApplicationManager.ExecuteApplicationFunctionWithoutParameter(appId, functionName);
return _ExternalApplicationManager.SetExternFunctionToPointToFunction(applicationId, functionName, localFunction);
}
}