incrementSequence() public method

public incrementSequence ( ) : uint
return uint
コード例 #1
0
        public void incrementSequence(string topic)
        {
            Publication pub = lookupPublication(topic);

            if (pub != null)
            {
                pub.incrementSequence();
            }
        }
コード例 #2
0
        public void publish(Publication p, IRosMessage msg, SerializeFunc serfunc = null)
        {
            if (msg == null)
            {
                return;
            }
            if (serfunc == null)
            {
                serfunc = msg.Serialize;
            }
            if (p.connection_header == null)
            {
                p.connection_header = new Header {
                    Values = new Hashtable()
                };
                p.connection_header.Values["type"]               = p.DataType;
                p.connection_header.Values["md5sum"]             = p.Md5sum;
                p.connection_header.Values["message_definition"] = p.MessageDefinition;
                p.connection_header.Values["callerid"]           = this_node.Name;
                p.connection_header.Values["latching"]           = p.Latch;
            }
            if (!ROS.ok || shutting_down)
            {
                return;
            }
            if (p.HasSubscribers || p.Latch)
            {
                bool nocopy    = false;
                bool serialize = false;
                if (msg != null && msg.msgtype() != MsgTypes.Unknown)
                {
                    p.getPublishTypes(ref serialize, ref nocopy, msg.msgtype());
                }
                else
                {
                    serialize = true;
                }

                p.publish(new MessageAndSerializerFunc(msg, serfunc, serialize, nocopy));

                if (serialize)
                {
                    PollManager.Instance.poll_set.signal();
                }
            }
            else
            {
                p.incrementSequence();
            }
        }