$search
00001 """autogenerated by genmsg_py from SHMGetBlocksRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class SHMGetBlocksRequest(roslib.message.Message): 00007 _md5sum = "d41d8cd98f00b204e9800998ecf8427e" 00008 _type = "sharedmem_transport/SHMGetBlocksRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 """ 00012 __slots__ = [] 00013 _slot_types = [] 00014 00015 def __init__(self, *args, **kwds): 00016 """ 00017 Constructor. Any message fields that are implicitly/explicitly 00018 set to None will be assigned a default value. The recommend 00019 use is keyword arguments as this is more robust to future message 00020 changes. You cannot mix in-order arguments and keyword arguments. 00021 00022 The available fields are: 00023 00024 00025 @param args: complete set of field values, in .msg order 00026 @param kwds: use keyword arguments corresponding to message field names 00027 to set specific fields. 00028 """ 00029 if args or kwds: 00030 super(SHMGetBlocksRequest, self).__init__(*args, **kwds) 00031 00032 def _get_types(self): 00033 """ 00034 internal API method 00035 """ 00036 return self._slot_types 00037 00038 def serialize(self, buff): 00039 """ 00040 serialize message into buffer 00041 @param buff: buffer 00042 @type buff: StringIO 00043 """ 00044 try: 00045 pass 00046 except struct.error as se: self._check_types(se) 00047 except TypeError as te: self._check_types(te) 00048 00049 def deserialize(self, str): 00050 """ 00051 unpack serialized message in str into this message instance 00052 @param str: byte array of serialized message 00053 @type str: str 00054 """ 00055 try: 00056 end = 0 00057 return self 00058 except struct.error as e: 00059 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00060 00061 00062 def serialize_numpy(self, buff, numpy): 00063 """ 00064 serialize message with numpy array types into buffer 00065 @param buff: buffer 00066 @type buff: StringIO 00067 @param numpy: numpy python module 00068 @type numpy module 00069 """ 00070 try: 00071 pass 00072 except struct.error as se: self._check_types(se) 00073 except TypeError as te: self._check_types(te) 00074 00075 def deserialize_numpy(self, str, numpy): 00076 """ 00077 unpack serialized message in str into this message instance using numpy for array types 00078 @param str: byte array of serialized message 00079 @type str: str 00080 @param numpy: numpy python module 00081 @type numpy: module 00082 """ 00083 try: 00084 end = 0 00085 return self 00086 except struct.error as e: 00087 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00088 00089 _struct_I = roslib.message.struct_I 00090 """autogenerated by genmsg_py from SHMGetBlocksResponse.msg. Do not edit.""" 00091 import roslib.message 00092 import struct 00093 00094 import sharedmem_transport.msg 00095 00096 class SHMGetBlocksResponse(roslib.message.Message): 00097 _md5sum = "2f7f2be967ee5b16b25d7eeba51fc62a" 00098 _type = "sharedmem_transport/SHMGetBlocksResponse" 00099 _has_header = False #flag to mark the presence of a Header object 00100 _full_text = """sharedmem_transport/SharedMemBlock[] blocks 00101 00102 00103 ================================================================================ 00104 MSG: sharedmem_transport/SharedMemBlock 00105 uint32 handle 00106 uint32 size 00107 uint32 allocated 00108 string name 00109 00110 """ 00111 __slots__ = ['blocks'] 00112 _slot_types = ['sharedmem_transport/SharedMemBlock[]'] 00113 00114 def __init__(self, *args, **kwds): 00115 """ 00116 Constructor. Any message fields that are implicitly/explicitly 00117 set to None will be assigned a default value. The recommend 00118 use is keyword arguments as this is more robust to future message 00119 changes. You cannot mix in-order arguments and keyword arguments. 00120 00121 The available fields are: 00122 blocks 00123 00124 @param args: complete set of field values, in .msg order 00125 @param kwds: use keyword arguments corresponding to message field names 00126 to set specific fields. 00127 """ 00128 if args or kwds: 00129 super(SHMGetBlocksResponse, self).__init__(*args, **kwds) 00130 #message fields cannot be None, assign default values for those that are 00131 if self.blocks is None: 00132 self.blocks = [] 00133 else: 00134 self.blocks = [] 00135 00136 def _get_types(self): 00137 """ 00138 internal API method 00139 """ 00140 return self._slot_types 00141 00142 def serialize(self, buff): 00143 """ 00144 serialize message into buffer 00145 @param buff: buffer 00146 @type buff: StringIO 00147 """ 00148 try: 00149 length = len(self.blocks) 00150 buff.write(_struct_I.pack(length)) 00151 for val1 in self.blocks: 00152 _x = val1 00153 buff.write(_struct_3I.pack(_x.handle, _x.size, _x.allocated)) 00154 _x = val1.name 00155 length = len(_x) 00156 buff.write(struct.pack('<I%ss'%length, length, _x)) 00157 except struct.error as se: self._check_types(se) 00158 except TypeError as te: self._check_types(te) 00159 00160 def deserialize(self, str): 00161 """ 00162 unpack serialized message in str into this message instance 00163 @param str: byte array of serialized message 00164 @type str: str 00165 """ 00166 try: 00167 end = 0 00168 start = end 00169 end += 4 00170 (length,) = _struct_I.unpack(str[start:end]) 00171 self.blocks = [] 00172 for i in range(0, length): 00173 val1 = sharedmem_transport.msg.SharedMemBlock() 00174 _x = val1 00175 start = end 00176 end += 12 00177 (_x.handle, _x.size, _x.allocated,) = _struct_3I.unpack(str[start:end]) 00178 start = end 00179 end += 4 00180 (length,) = _struct_I.unpack(str[start:end]) 00181 start = end 00182 end += length 00183 val1.name = str[start:end] 00184 self.blocks.append(val1) 00185 return self 00186 except struct.error as e: 00187 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00188 00189 00190 def serialize_numpy(self, buff, numpy): 00191 """ 00192 serialize message with numpy array types into buffer 00193 @param buff: buffer 00194 @type buff: StringIO 00195 @param numpy: numpy python module 00196 @type numpy module 00197 """ 00198 try: 00199 length = len(self.blocks) 00200 buff.write(_struct_I.pack(length)) 00201 for val1 in self.blocks: 00202 _x = val1 00203 buff.write(_struct_3I.pack(_x.handle, _x.size, _x.allocated)) 00204 _x = val1.name 00205 length = len(_x) 00206 buff.write(struct.pack('<I%ss'%length, length, _x)) 00207 except struct.error as se: self._check_types(se) 00208 except TypeError as te: self._check_types(te) 00209 00210 def deserialize_numpy(self, str, numpy): 00211 """ 00212 unpack serialized message in str into this message instance using numpy for array types 00213 @param str: byte array of serialized message 00214 @type str: str 00215 @param numpy: numpy python module 00216 @type numpy: module 00217 """ 00218 try: 00219 end = 0 00220 start = end 00221 end += 4 00222 (length,) = _struct_I.unpack(str[start:end]) 00223 self.blocks = [] 00224 for i in range(0, length): 00225 val1 = sharedmem_transport.msg.SharedMemBlock() 00226 _x = val1 00227 start = end 00228 end += 12 00229 (_x.handle, _x.size, _x.allocated,) = _struct_3I.unpack(str[start:end]) 00230 start = end 00231 end += 4 00232 (length,) = _struct_I.unpack(str[start:end]) 00233 start = end 00234 end += length 00235 val1.name = str[start:end] 00236 self.blocks.append(val1) 00237 return self 00238 except struct.error as e: 00239 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00240 00241 _struct_I = roslib.message.struct_I 00242 _struct_3I = struct.Struct("<3I") 00243 class SHMGetBlocks(roslib.message.ServiceDefinition): 00244 _type = 'sharedmem_transport/SHMGetBlocks' 00245 _md5sum = '2f7f2be967ee5b16b25d7eeba51fc62a' 00246 _request_class = SHMGetBlocksRequest 00247 _response_class = SHMGetBlocksResponse