public static string GetRMWIdentifier() { IntPtr ptr = RCLdotnetDelegates.native_rcl_get_rmw_identifier(); string rmw_identifier = Marshal.PtrToStringAnsi(ptr); return(rmw_identifier); }
public static string GetErrorString() { StringBuilder buffer = new StringBuilder(1024); RCLdotnetDelegates.native_rcl_get_error_string(buffer.Capacity, buffer); return(buffer.ToString()); }
public static Node CreateNode(string nodeName, string nodeNamespace) { IntPtr nodeHandle = IntPtr.Zero; int ret = RCLdotnetDelegates.native_rcl_create_node_handle(ref nodeHandle, nodeName, nodeNamespace); Node node = new Node(nodeHandle); return(node); }
public static void Init() { lock (syncLock) { if (!initialized) { RCLdotnetDelegates.native_rcl_init(); initialized = true; } } }
private static void WaitSetInit( IntPtr waitSetHandle, long numberOfSubscriptions, long numberOfGuardConditions, long numberOfTimers, long numberOfClients, long numberOfServices) { RCLdotnetDelegates.native_rcl_wait_set_init( waitSetHandle, numberOfSubscriptions, numberOfGuardConditions, numberOfTimers, numberOfClients, numberOfServices); }
public static RCLRet Init() { RCLRet ret = RCLRet.Ok; lock (syncLock) { if (!initialized) { ret = (RCLRet)RCLdotnetDelegates.native_rcl_init(); initialized = true; } } return(ret); }
private static bool Take(IntPtr subscriptionHandle, IMessage message) { bool status = false; IntPtr messageHandle = message._CREATE_NATIVE_MESSAGE(); RCLRet ret = (RCLRet)RCLdotnetDelegates.native_rcl_take(subscriptionHandle, messageHandle); switch (ret) { case RCLRet.Ok: message._READ_HANDLE(messageHandle); status = true; break; case RCLRet.SubscriptionTakeFailed: status = false; break; default: break; } message._DESTROY_NATIVE_MESSAGE(messageHandle); return(status); }
private static void Wait(IntPtr waitSetHandle, long timeout) { long ns_timeout = timeout * 1000000; RCLRet ret = (RCLRet)RCLdotnetDelegates.native_rcl_wait(waitSetHandle, ns_timeout); // TODO(esteve): do something with ret }
private static void DestroyWaitSet(IntPtr waitSetHandle) { RCLdotnetDelegates.native_rcl_destroy_wait_set(waitSetHandle); }
private static void WaitSetAddSubscription(IntPtr waitSetHandle, IntPtr subscriptionHandle) { RCLdotnetDelegates.native_rcl_wait_set_add_subscription(waitSetHandle, subscriptionHandle); }
private static void WaitSetClear(IntPtr waitSetHandle) { RCLdotnetDelegates.native_rcl_wait_set_clear(waitSetHandle); }
private static IntPtr GetZeroInitializedWaitSet() { return(RCLdotnetDelegates.native_rcl_get_zero_initialized_wait_set()); }
public static bool Ok() { return(RCLdotnetDelegates.native_rcl_ok()); }
private static void WaitSetClearSubscriptions(IntPtr waitSetHandle) { RCLdotnetDelegates.native_rcl_wait_set_clear_subscriptions(waitSetHandle); }