public SubscriberCallbacks(SubscriberStatusCallback connectCB, SubscriberStatusCallback disconnectCB, CallbackQueueInterface Callback) { connect = connectCB; disconnect = disconnectCB; this.Callback = Callback; }
public AdvertiseOptions( string topic, int queueSize, string md5Sum, string dataType, string messageDefinition, SubscriberStatusCallback connectcallback = null, SubscriberStatusCallback disconnectcallback = null, ICallbackQueue callbackQueue = null ) { this.topic = topic; this.md5Sum = md5Sum; this.queueSize = queueSize; this.callbackQueue = callbackQueue; T tt = new T(); this.dataType = dataType.Length > 0 ? dataType : tt.MessageType; this.messageDefinition = string.IsNullOrEmpty(messageDefinition) ? tt.MessageDefinition() : messageDefinition; this.hasHeader = tt.HasHeader(); this.connectCB = connectcallback; this.disconnectCB = disconnectcallback; }
public AdvertiseOptions(string t, int q_size, string md5, string dt, string message_def, SubscriberStatusCallback connectcallback, SubscriberStatusCallback disconnectcallback) { topic = t; queue_size = q_size; md5sum = md5; T tt = new T(); if (dt.Length > 0) { datatype = dt; } else { datatype = tt.msgtype.ToString().Replace("__", "/"); } if (message_def.Length == 0) { message_definition = tt.MessageDefinition; } else { message_definition = message_def; } has_header = tt.HasHeader; connectCB = connectcallback; disconnectCB = disconnectcallback; }
/// <summary> /// Creates a publisher with connect and disconnect callbacks, specify latching. /// </summary> /// <typeparam name="M">Type of topic</typeparam> /// <param name="topic">Name of topic</param> /// <param name="queue_size">How many messages to enqueue if asynchrinous</param> /// <param name="connectcallback">Callback to fire when this node connects</param> /// <param name="disconnectcallback">Callback to fire when this node disconnects</param> /// <param name="l">Boolean determines whether the given publisher will latch or not</param> /// <returns>A publisher with the specified topic type, name and options</returns> public Publisher <M> advertise <M>(string topic, int queue_size, SubscriberStatusCallback connectcallback, SubscriberStatusCallback disconnectcallback, bool l) where M : IRosMessage, new() { return(advertise(new AdvertiseOptions <M>(topic, queue_size, connectcallback, disconnectcallback) { latch = l })); }
Publisher <M> queue_advertise <M> (string topic, uint queue_size, SubscriberStatusCallback connect_cb, SubscriberStatusCallback disconnect_cb, CallbackQueueInterface queue) where M : IRosMessage, new() { AdvertiseOptions <M> ops = new AdvertiseOptions <M> (topic, (int)queue_size, connect_cb, disconnect_cb); // ops.tracked_object = ros::VoidPtr(); ops.latch = false; ops.callback_queue = queue; return(nodeHandle.advertise(ops)); }
public static AdvertiseOptions <M> Create <M>(string topic, int q_size, SubscriberStatusCallback connectcallback, SubscriberStatusCallback disconnectcallback, CallbackQueue queue) where M : IRosMessage, new() { return(new AdvertiseOptions <M>(topic, q_size, connectcallback, disconnectcallback) { callback_queue = queue }); }
public AdvertiseOptions(string t, int q_size, SubscriberStatusCallback connectcallback, SubscriberStatusCallback disconnectcallback) : this( t, q_size, new T().MD5Sum, new T().msgtype.ToString().Replace("__", "/"), new T().MessageDefinition, connectcallback, disconnectcallback) { }
public SubscriberCallbacks( SubscriberStatusCallback connectCB, SubscriberStatusCallback disconnectCB, ICallbackQueue callbackQueue ) { this.connect = connectCB; this.disconnect = disconnectCB; this.CallbackQueue = callbackQueue; }
public SubscriberCallbacks( SubscriberStatusCallback onConnect, SubscriberStatusCallback onDisconnect, ICallbackQueue callbackQueue ) { this.OnConnect = onConnect; this.OnDisconnect = onDisconnect; this.CallbackQueue = callbackQueue; }
/// <summary> /// Creates a publisher with connect and disconnect callbacks /// </summary> /// <typeparam name="M">Type of topic</typeparam> /// <param name="topic">Name of topic</param> /// <param name="queue_size">How many messages to enqueue if asynchrinous</param> /// <param name="connectcallback">Callback to fire when this node connects</param> /// <param name="disconnectcallback">Callback to fire when this node disconnects</param> /// <returns>A publisher with the specified topic type, name and options</returns> public Publisher <M> advertise <M>(string topic, int queue_size, SubscriberStatusCallback connectcallback, SubscriberStatusCallback disconnectcallback) where M : IRosMessage, new() { if (started_by_visual_studio) { return(null); } return(advertise <M>(topic, queue_size, connectcallback, disconnectcallback, false)); }
public AdvertiseOptions(string t, int q_size, string md5, string dt, string message_def, SubscriberStatusCallback connectcallback, SubscriberStatusCallback disconnectcallback) { topic = t; queue_size = q_size; md5sum = md5; T tt = new T(); if (dt.Length > 0) { datatype = dt; } else { datatype = tt.msgtype.ToString().Replace("__", "/"); } if (message_def.Length == 0) { message_definition = tt.MessageDefinition; } else { message_definition = message_def; } List <Type> visited = new List <Type>(); Queue <IRosMessage> frontier = new Queue <IRosMessage>(); IRosMessage current = tt; do { if (frontier.Count > 0) { current = frontier.Dequeue(); message_definition += "\n================================================================================\nMSG: " + current.msgtype.ToString().Replace("__", "/") + "\n" + current.MessageDefinition; } foreach (MsgFieldInfo fi in current.Fields.Values) { if (fi.message_type == MsgTypes.Unknown) { continue; } IRosMessage field = IRosMessage.generate(fi.message_type); if (field != null && fi.IsMetaType && !visited.Contains(fi.Type)) { frontier.Enqueue(field); visited.Add(fi.Type); } } } while (frontier.Count > 0); has_header = tt.HasHeader; connectCB = connectcallback; disconnectCB = disconnectcallback; }
public static AdvertiseOptions <M> Create <M>( string topic, int queueSize, SubscriberStatusCallback connectcallback, SubscriberStatusCallback disconnectcallback, ICallbackQueue callbackQueue ) where M : RosMessage, new() { return(new AdvertiseOptions <M>(topic, queueSize, connectcallback, disconnectcallback, callbackQueue)); }
public AdvertiseOptions( string topic, int queueSize, SubscriberStatusCallback connectCallback, SubscriberStatusCallback disconnectCallback, ICallbackQueue callbackQueue = null ) : this( topic, queueSize, new T().MD5Sum(), new T().MessageType, new T().MessageDefinition(), connectCallback, disconnectCallback ) { }
public PeerConnDisconnCallback(SubscriberStatusCallback callback, SubscriberLink sub_link) { this.callback = callback; this.sub_link = sub_link; }
public Publisher <M> Advertise <M>(string topic, int queueSize, SubscriberStatusCallback connectCallback, SubscriberStatusCallback disconnectCallback, bool latch) where M : RosMessage, new() => AdvertiseAsync <M>(topic, queueSize, connectCallback, disconnectCallback, latch).Result;
public PeerConnDisconnCallback(SubscriberStatusCallback callback, SubscriberLink subscriberLink) { this.callback = callback; this.subscriberLink = subscriberLink; }
/// <summary> /// Creates a publisher with connect and disconnect callbacks, specify latching. /// </summary> /// <typeparam name="M">Type of topic</typeparam> /// <param name="topic">Name of topic</param> /// <param name="queueSize">How many messages to enqueue if asynchrinous</param> /// <param name="connectCallback">Callback to fire when this node connects</param> /// <param name="disconnectCallback">Callback to fire when this node disconnects</param> /// <param name="latch">Boolean determines whether the given publisher will latch or not</param> /// <returns>A publisher with the specified topic type, name and options</returns> public async Task <Publisher <M> > AdvertiseAsync <M>(string topic, int queueSize, SubscriberStatusCallback connectCallback, SubscriberStatusCallback disconnectCallback, bool latch) where M : RosMessage, new() { return(await AdvertiseAsync(new AdvertiseOptions <M>(topic, queueSize, connectCallback, disconnectCallback) { Latch = latch })); }
/// <summary> /// Creates a publisher with connect and disconnect callbacks /// </summary> /// <typeparam name="M">Type of topic</typeparam> /// <param name="topic">Name of topic</param> /// <param name="queueSize">How many messages to enqueue if asynchrinous</param> /// <param name="connectCallback">Callback to fire when this node connects</param> /// <param name="disconnectCallback">Callback to fire when this node disconnects</param> /// <returns>A publisher with the specified topic type, name and options</returns> public async Task <Publisher <M> > AdvertiseAsync <M>(string topic, int queueSize, SubscriberStatusCallback connectCallback, SubscriberStatusCallback disconnectCallback) where M : RosMessage, new() { return(await AdvertiseAsync <M>(topic, queueSize, connectCallback, disconnectCallback, false)); }
public AdvertiseOptions(string t, int q_size, string md5, string dt, string message_def, SubscriberStatusCallback connectcallback) : this(t, q_size, md5, dt, message_def, connectcallback, null) { }
/// <summary> /// Creates a publisher with connect and disconnect callbacks /// </summary> /// <typeparam name="M">Type of topic</typeparam> /// <param name="topic">Name of topic</param> /// <param name="queueSize">How many messages to enqueue if asynchrinous</param> /// <param name="connectCallback">Callback to fire when this node connects</param> /// <param name="disconnectCallback">Callback to fire when this node disconnects</param> /// <returns>A publisher with the specified topic type, name and options</returns> public Publisher <M> advertise <M>(string topic, int queueSize, SubscriberStatusCallback connectCallback, SubscriberStatusCallback disconnectCallback) where M : RosMessage, new() { return(advertise <M>(topic, queueSize, connectCallback, disconnectCallback, false)); }