Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ansys/dpf/gate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
from .generated import external_operator_capi
from .generated import f_e_model_abstract_api
from .generated import f_e_model_capi
from .generated import fbs_ref_abstract_api
from .generated import fbs_ref_capi
from .generated import field_abstract_api
from .generated import field_capi
from .generated import field_definition_abstract_api
Expand Down
31 changes: 31 additions & 0 deletions src/ansys/dpf/gate/generated/capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5078,4 +5078,35 @@ def load_api(path):
dll.Workflow_create_connection_map_for_object.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.Workflow_create_connection_map_for_object.restype = ctypes.c_void_p

#-------------------------------------------------------------------------------
# FbsRef
#-------------------------------------------------------------------------------
if hasattr(dll, "FbsRef_new"):
dll.FbsRef_new.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.c_void_p, ctypes.c_size_t, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.FbsRef_new.restype = ctypes.c_void_p

if hasattr(dll, "FbsRef_getFromDB"):
dll.FbsRef_getFromDB.argtypes = (ctypes.c_size_t, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.FbsRef_getFromDB.restype = ctypes.c_void_p

if hasattr(dll, "FbsRef_getID"):
dll.FbsRef_getID.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.FbsRef_getID.restype = ctypes.c_size_t

if hasattr(dll, "Any_getAs_FbsRef"):
dll.Any_getAs_FbsRef.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.c_void_p, ctypes.POINTER(ctypes.c_size_t), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.Any_getAs_FbsRef.restype = None

if hasattr(dll, "FbsRef_StartOrGetThreadServer"):
dll.FbsRef_StartOrGetThreadServer.argtypes = (ctypes.c_bool, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.FbsRef_StartOrGetThreadServer.restype = ctypes.c_void_p

if hasattr(dll, "FbsRef_new_on_client"):
dll.FbsRef_new_on_client.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.c_void_p, ctypes.c_size_t, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.FbsRef_new_on_client.restype = ctypes.c_void_p

if hasattr(dll, "FbsRef_StartOrGetThreadServer_on_client"):
dll.FbsRef_StartOrGetThreadServer_on_client.argtypes = (ctypes.c_void_p, ctypes.c_bool, ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.FbsRef_StartOrGetThreadServer_on_client.restype = ctypes.c_void_p


41 changes: 41 additions & 0 deletions src/ansys/dpf/gate/generated/fbs_ref_abstract_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#-------------------------------------------------------------------------------
# FbsRef
#-------------------------------------------------------------------------------

class FbsRefAbstractAPI:
@staticmethod
def init_fbs_ref_environment(object):
pass

@staticmethod
def finish_fbs_ref_environment(object):
pass

@staticmethod
def fbs_ref_new(client, channel_address, req_slice, req_offset):
raise NotImplementedError

@staticmethod
def fbs_ref_get_from_db(id):
raise NotImplementedError

@staticmethod
def fbs_ref_get_id(obj):
raise NotImplementedError

@staticmethod
def any_get_as_fbs_ref(obj, client, channel_address, req_slice, req_offset):
raise NotImplementedError

@staticmethod
def fbs_ref_start_or_get_thread_server(get_existing, ip, port, address):
raise NotImplementedError

@staticmethod
def fbs_ref_new_on_client(client, channel, channel_address, req_slice, req_offset):
raise NotImplementedError

@staticmethod
def fbs_ref_start_or_get_thread_server_on_client(client, get_existing, ip, port, address):
raise NotImplementedError

82 changes: 82 additions & 0 deletions src/ansys/dpf/gate/generated/fbs_ref_capi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import ctypes
from ansys.dpf.gate import utils
from ansys.dpf.gate import errors
from ansys.dpf.gate.generated import capi
from ansys.dpf.gate.generated import fbs_ref_abstract_api
from ansys.dpf.gate.generated.data_processing_capi import DataProcessingCAPI

#-------------------------------------------------------------------------------
# FbsRef
#-------------------------------------------------------------------------------

class FbsRefCAPI(fbs_ref_abstract_api.FbsRefAbstractAPI):

@staticmethod
def init_fbs_ref_environment(object):
# get core api
DataProcessingCAPI.init_data_processing_environment(object)
object._deleter_func = (DataProcessingCAPI.data_processing_delete_shared_object, lambda obj: obj)

@staticmethod
def fbs_ref_new(client, channel_address, req_slice, req_offset):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
res = capi.dll.FbsRef_new(client, utils.to_char_ptr(channel_address), req_slice, req_offset, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def fbs_ref_get_from_db(id):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
res = capi.dll.FbsRef_getFromDB(id, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def fbs_ref_get_id(obj):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
res = capi.dll.FbsRef_getID(obj._internal_obj if obj is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def any_get_as_fbs_ref(obj, client, channel_address, req_slice, req_offset):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
res = capi.dll.Any_getAs_FbsRef(obj._internal_obj if obj is not None else None, client, utils.to_char_ptr(channel_address), req_slice, req_offset, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def fbs_ref_start_or_get_thread_server(get_existing, ip, port, address):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
res = capi.dll.FbsRef_StartOrGetThreadServer(get_existing, utils.to_char_ptr(ip), utils.to_int32(port), utils.to_char_ptr(address), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def fbs_ref_new_on_client(client, channel, channel_address, req_slice, req_offset):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
res = capi.dll.FbsRef_new_on_client(client._internal_obj if client is not None else None, channel, utils.to_char_ptr(channel_address), req_slice, req_offset, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def fbs_ref_start_or_get_thread_server_on_client(client, get_existing, ip, port, address):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
res = capi.dll.FbsRef_StartOrGetThreadServer_on_client(client._internal_obj if client is not None else None, get_existing, utils.to_char_ptr(ip), utils.to_int32(port), utils.to_char_ptr(address), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

Binary file modified src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll
Binary file not shown.
Binary file modified src/ansys/dpf/gatebin/DPFClientAPI.dll
Binary file not shown.
Binary file modified src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so
Binary file not shown.
Binary file modified src/ansys/dpf/gatebin/libDPFClientAPI.so
Binary file not shown.
Loading
Loading