Go to the documentation of this file.00001 """autogenerated by genmsg_py from Bid.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class Bid(roslib.message.Message):
00008 _md5sum = "a9fd8c7cc5d27c4274d3730239f98aaf"
00009 _type = "auction_msgs/Bid"
00010 _has_header = True
00011 _full_text = """Header header
00012 string buyer_id
00013 int64 cost_distance
00014
00015 ================================================================================
00016 MSG: std_msgs/Header
00017 # Standard metadata for higher-level stamped data types.
00018 # This is generally used to communicate timestamped data
00019 # in a particular coordinate frame.
00020 #
00021 # sequence ID: consecutively increasing ID
00022 uint32 seq
00023 #Two-integer timestamp that is expressed as:
00024 # * stamp.secs: seconds (stamp_secs) since epoch
00025 # * stamp.nsecs: nanoseconds since stamp_secs
00026 # time-handling sugar is provided by the client library
00027 time stamp
00028 #Frame this data is associated with
00029 # 0: no frame
00030 # 1: global frame
00031 string frame_id
00032
00033 """
00034 __slots__ = ['header','buyer_id','cost_distance']
00035 _slot_types = ['Header','string','int64']
00036
00037 def __init__(self, *args, **kwds):
00038 """
00039 Constructor. Any message fields that are implicitly/explicitly
00040 set to None will be assigned a default value. The recommend
00041 use is keyword arguments as this is more robust to future message
00042 changes. You cannot mix in-order arguments and keyword arguments.
00043
00044 The available fields are:
00045 header,buyer_id,cost_distance
00046
00047 @param args: complete set of field values, in .msg order
00048 @param kwds: use keyword arguments corresponding to message field names
00049 to set specific fields.
00050 """
00051 if args or kwds:
00052 super(Bid, self).__init__(*args, **kwds)
00053
00054 if self.header is None:
00055 self.header = std_msgs.msg._Header.Header()
00056 if self.buyer_id is None:
00057 self.buyer_id = ''
00058 if self.cost_distance is None:
00059 self.cost_distance = 0
00060 else:
00061 self.header = std_msgs.msg._Header.Header()
00062 self.buyer_id = ''
00063 self.cost_distance = 0
00064
00065 def _get_types(self):
00066 """
00067 internal API method
00068 """
00069 return self._slot_types
00070
00071 def serialize(self, buff):
00072 """
00073 serialize message into buffer
00074 @param buff: buffer
00075 @type buff: StringIO
00076 """
00077 try:
00078 _x = self
00079 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00080 _x = self.header.frame_id
00081 length = len(_x)
00082 buff.write(struct.pack('<I%ss'%length, length, _x))
00083 _x = self.buyer_id
00084 length = len(_x)
00085 buff.write(struct.pack('<I%ss'%length, length, _x))
00086 buff.write(_struct_q.pack(self.cost_distance))
00087 except struct.error as se: self._check_types(se)
00088 except TypeError as te: self._check_types(te)
00089
00090 def deserialize(self, str):
00091 """
00092 unpack serialized message in str into this message instance
00093 @param str: byte array of serialized message
00094 @type str: str
00095 """
00096 try:
00097 if self.header is None:
00098 self.header = std_msgs.msg._Header.Header()
00099 end = 0
00100 _x = self
00101 start = end
00102 end += 12
00103 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00104 start = end
00105 end += 4
00106 (length,) = _struct_I.unpack(str[start:end])
00107 start = end
00108 end += length
00109 self.header.frame_id = str[start:end]
00110 start = end
00111 end += 4
00112 (length,) = _struct_I.unpack(str[start:end])
00113 start = end
00114 end += length
00115 self.buyer_id = str[start:end]
00116 start = end
00117 end += 8
00118 (self.cost_distance,) = _struct_q.unpack(str[start:end])
00119 return self
00120 except struct.error as e:
00121 raise roslib.message.DeserializationError(e)
00122
00123
00124 def serialize_numpy(self, buff, numpy):
00125 """
00126 serialize message with numpy array types into buffer
00127 @param buff: buffer
00128 @type buff: StringIO
00129 @param numpy: numpy python module
00130 @type numpy module
00131 """
00132 try:
00133 _x = self
00134 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00135 _x = self.header.frame_id
00136 length = len(_x)
00137 buff.write(struct.pack('<I%ss'%length, length, _x))
00138 _x = self.buyer_id
00139 length = len(_x)
00140 buff.write(struct.pack('<I%ss'%length, length, _x))
00141 buff.write(_struct_q.pack(self.cost_distance))
00142 except struct.error as se: self._check_types(se)
00143 except TypeError as te: self._check_types(te)
00144
00145 def deserialize_numpy(self, str, numpy):
00146 """
00147 unpack serialized message in str into this message instance using numpy for array types
00148 @param str: byte array of serialized message
00149 @type str: str
00150 @param numpy: numpy python module
00151 @type numpy: module
00152 """
00153 try:
00154 if self.header is None:
00155 self.header = std_msgs.msg._Header.Header()
00156 end = 0
00157 _x = self
00158 start = end
00159 end += 12
00160 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 start = end
00165 end += length
00166 self.header.frame_id = str[start:end]
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 start = end
00171 end += length
00172 self.buyer_id = str[start:end]
00173 start = end
00174 end += 8
00175 (self.cost_distance,) = _struct_q.unpack(str[start:end])
00176 return self
00177 except struct.error as e:
00178 raise roslib.message.DeserializationError(e)
00179
00180 _struct_I = roslib.message.struct_I
00181 _struct_q = struct.Struct("<q")
00182 _struct_3I = struct.Struct("<3I")