/
GoalID.cs
69 lines (60 loc) · 2.34 KB
/
GoalID.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
//////////////////////////////////////////////////
///// AUTOGENERATED MESSAGE DEFINITION /////
//////////////////////////////////////////////////
///// DO NOT MODIFY BY HAND! /////
//////////////////////////////////////////////////
namespace ROS_CS
{
namespace actionlib_msgs
{
public class GoalID : ROS_CS.Core.BaseMessage
{
public readonly string typeID = "GoalID";
public readonly string md5sum = "302881f31927c1df708a2dbab0e80ee8";
public ROS_CS.Core.Time stamp;
public string id;
public GoalID ()
{
stamp = new ROS_CS.Core.Time();
id = "";
}
public override string ToString ()
{
return ROS_CS.Core.PrettyPrinter.PrettyPrint(ToStringRaw());
}
public override string ToStringRaw ()
{
string string_rep = typeID + ":\n";
string_rep += stamp.ToStringRaw() + "\n";
string_rep += "id: " + id + "\n";
return string_rep;
}
public override void Serialize(MemoryStream stream)
{
stamp.Serialize(stream);
System.Byte[] id_bytes = System.Text.Encoding.UTF8.GetBytes(id);
System.Byte[] id_len_bytes = BitConverter.GetBytes((System.UInt32)id_bytes.Length);
stream.Write(id_len_bytes, 0, id_len_bytes.Length);
stream.Write(id_bytes, 0, id_bytes.Length);
}
public override int Deserialize(System.Byte[] serialized)
{
return Deserialize(serialized, 0);
}
public override int Deserialize(System.Byte[] serialized, int startIndex)
{
int curIndex = startIndex;
curIndex += stamp.Deserialize(serialized, curIndex);
System.UInt32 id_len = BitConverter.ToUInt32(serialized, curIndex);
curIndex += BitConverter.GetBytes(id_len).Length;
id = System.Text.Encoding.UTF8.GetString(serialized, curIndex, (int)id_len);
curIndex += (int)id_len;
return (curIndex - startIndex);
}
}
}
}