Exemplo n.º 1
0
        public static string GetRMWIdentifier()
        {
            IntPtr ptr            = RCLdotnetDelegates.native_rcl_get_rmw_identifier();
            string rmw_identifier = Marshal.PtrToStringAnsi(ptr);

            return(rmw_identifier);
        }
Exemplo n.º 2
0
        public static string GetErrorString()
        {
            StringBuilder buffer = new StringBuilder(1024);

            RCLdotnetDelegates.native_rcl_get_error_string(buffer.Capacity, buffer);
            return(buffer.ToString());
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public static void Init()
 {
     lock (syncLock) {
         if (!initialized)
         {
             RCLdotnetDelegates.native_rcl_init();
             initialized = true;
         }
     }
 }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
        public static RCLRet Init()
        {
            RCLRet ret = RCLRet.Ok;

            lock (syncLock) {
                if (!initialized)
                {
                    ret         = (RCLRet)RCLdotnetDelegates.native_rcl_init();
                    initialized = true;
                }
            }

            return(ret);
        }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
0
 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
 }
Exemplo n.º 9
0
 private static void DestroyWaitSet(IntPtr waitSetHandle)
 {
     RCLdotnetDelegates.native_rcl_destroy_wait_set(waitSetHandle);
 }
Exemplo n.º 10
0
 private static void WaitSetAddSubscription(IntPtr waitSetHandle, IntPtr subscriptionHandle)
 {
     RCLdotnetDelegates.native_rcl_wait_set_add_subscription(waitSetHandle, subscriptionHandle);
 }
Exemplo n.º 11
0
 private static void WaitSetClear(IntPtr waitSetHandle)
 {
     RCLdotnetDelegates.native_rcl_wait_set_clear(waitSetHandle);
 }
Exemplo n.º 12
0
 private static IntPtr GetZeroInitializedWaitSet()
 {
     return(RCLdotnetDelegates.native_rcl_get_zero_initialized_wait_set());
 }
Exemplo n.º 13
0
 public static bool Ok()
 {
     return(RCLdotnetDelegates.native_rcl_ok());
 }
Exemplo n.º 14
0
 private static void WaitSetClearSubscriptions(IntPtr waitSetHandle)
 {
     RCLdotnetDelegates.native_rcl_wait_set_clear_subscriptions(waitSetHandle);
 }