_Remote.py
Go to the documentation of this file.
00001 """autogenerated by genpy from gateway_comms/RemoteRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import gateway_comms.msg
00008 
00009 class RemoteRequest(genpy.Message):
00010   _md5sum = "e9d79fdaee662b9f88ad5ffedb506465"
00011   _type = "gateway_comms/RemoteRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """
00014 
00015 
00016 
00017 RemoteRule[] remotes
00018 
00019 
00020 bool cancel
00021 
00022 
00023 ================================================================================
00024 MSG: gateway_comms/RemoteRule
00025 # Definition for a flip. It represents either:
00026 #
00027 # 1) an existing flipped connection (from the local gateway)
00028 # 2) a rule that is put on a watchlist
00029 
00030 # The target recipient of the flip
00031 string gateway
00032 
00033 # Connection has the following parameters that need setting
00034 # - name : fully qualified name of the connection (str)
00035 # - type : connection type (str)
00036 #  
00037 # Use one of the types defined in Connection string constants:
00038 #     (publisher, subscriber, service, action_client, action_server)
00039 #
00040 # - node : name of the node it originates from (str)(optional)
00041 #
00042 # Node name is necessary, for instance, if you have multiple subscribers
00043 # publishing to a single topic. Most of the time it is not necessary,
00044 # but in some cases it helps refine the rule. It helps refine the rule.
00045 #
00046 Rule rule
00047 
00048 ================================================================================
00049 MSG: gateway_comms/Rule
00050 # Standard gateway connection rule
00051 
00052 # type of connection (from gateway_comms.msg.Connection)
00053 string type
00054 
00055 # this is the topic/service name or the action base name (a regex is supported)
00056 string name 
00057 
00058 # (optional) an optional node name can be provided. if node name is not provided
00059 # then all nodes are matched (also supports regex)
00060 string node
00061 
00062 """
00063   __slots__ = ['remotes','cancel']
00064   _slot_types = ['gateway_comms/RemoteRule[]','bool']
00065 
00066   def __init__(self, *args, **kwds):
00067     """
00068     Constructor. Any message fields that are implicitly/explicitly
00069     set to None will be assigned a default value. The recommend
00070     use is keyword arguments as this is more robust to future message
00071     changes.  You cannot mix in-order arguments and keyword arguments.
00072 
00073     The available fields are:
00074        remotes,cancel
00075 
00076     :param args: complete set of field values, in .msg order
00077     :param kwds: use keyword arguments corresponding to message field names
00078     to set specific fields.
00079     """
00080     if args or kwds:
00081       super(RemoteRequest, self).__init__(*args, **kwds)
00082       #message fields cannot be None, assign default values for those that are
00083       if self.remotes is None:
00084         self.remotes = []
00085       if self.cancel is None:
00086         self.cancel = False
00087     else:
00088       self.remotes = []
00089       self.cancel = False
00090 
00091   def _get_types(self):
00092     """
00093     internal API method
00094     """
00095     return self._slot_types
00096 
00097   def serialize(self, buff):
00098     """
00099     serialize message into buffer
00100     :param buff: buffer, ``StringIO``
00101     """
00102     try:
00103       length = len(self.remotes)
00104       buff.write(_struct_I.pack(length))
00105       for val1 in self.remotes:
00106         _x = val1.gateway
00107         length = len(_x)
00108         if python3 or type(_x) == unicode:
00109           _x = _x.encode('utf-8')
00110           length = len(_x)
00111         buff.write(struct.pack('<I%ss'%length, length, _x))
00112         _v1 = val1.rule
00113         _x = _v1.type
00114         length = len(_x)
00115         if python3 or type(_x) == unicode:
00116           _x = _x.encode('utf-8')
00117           length = len(_x)
00118         buff.write(struct.pack('<I%ss'%length, length, _x))
00119         _x = _v1.name
00120         length = len(_x)
00121         if python3 or type(_x) == unicode:
00122           _x = _x.encode('utf-8')
00123           length = len(_x)
00124         buff.write(struct.pack('<I%ss'%length, length, _x))
00125         _x = _v1.node
00126         length = len(_x)
00127         if python3 or type(_x) == unicode:
00128           _x = _x.encode('utf-8')
00129           length = len(_x)
00130         buff.write(struct.pack('<I%ss'%length, length, _x))
00131       buff.write(_struct_B.pack(self.cancel))
00132     except struct.error as se: self._check_types(se)
00133     except TypeError as te: self._check_types(te)
00134 
00135   def deserialize(self, str):
00136     """
00137     unpack serialized message in str into this message instance
00138     :param str: byte array of serialized message, ``str``
00139     """
00140     try:
00141       if self.remotes is None:
00142         self.remotes = None
00143       end = 0
00144       start = end
00145       end += 4
00146       (length,) = _struct_I.unpack(str[start:end])
00147       self.remotes = []
00148       for i in range(0, length):
00149         val1 = gateway_comms.msg.RemoteRule()
00150         start = end
00151         end += 4
00152         (length,) = _struct_I.unpack(str[start:end])
00153         start = end
00154         end += length
00155         if python3:
00156           val1.gateway = str[start:end].decode('utf-8')
00157         else:
00158           val1.gateway = str[start:end]
00159         _v2 = val1.rule
00160         start = end
00161         end += 4
00162         (length,) = _struct_I.unpack(str[start:end])
00163         start = end
00164         end += length
00165         if python3:
00166           _v2.type = str[start:end].decode('utf-8')
00167         else:
00168           _v2.type = str[start:end]
00169         start = end
00170         end += 4
00171         (length,) = _struct_I.unpack(str[start:end])
00172         start = end
00173         end += length
00174         if python3:
00175           _v2.name = str[start:end].decode('utf-8')
00176         else:
00177           _v2.name = str[start:end]
00178         start = end
00179         end += 4
00180         (length,) = _struct_I.unpack(str[start:end])
00181         start = end
00182         end += length
00183         if python3:
00184           _v2.node = str[start:end].decode('utf-8')
00185         else:
00186           _v2.node = str[start:end]
00187         self.remotes.append(val1)
00188       start = end
00189       end += 1
00190       (self.cancel,) = _struct_B.unpack(str[start:end])
00191       self.cancel = bool(self.cancel)
00192       return self
00193     except struct.error as e:
00194       raise genpy.DeserializationError(e) #most likely buffer underfill
00195 
00196 
00197   def serialize_numpy(self, buff, numpy):
00198     """
00199     serialize message with numpy array types into buffer
00200     :param buff: buffer, ``StringIO``
00201     :param numpy: numpy python module
00202     """
00203     try:
00204       length = len(self.remotes)
00205       buff.write(_struct_I.pack(length))
00206       for val1 in self.remotes:
00207         _x = val1.gateway
00208         length = len(_x)
00209         if python3 or type(_x) == unicode:
00210           _x = _x.encode('utf-8')
00211           length = len(_x)
00212         buff.write(struct.pack('<I%ss'%length, length, _x))
00213         _v3 = val1.rule
00214         _x = _v3.type
00215         length = len(_x)
00216         if python3 or type(_x) == unicode:
00217           _x = _x.encode('utf-8')
00218           length = len(_x)
00219         buff.write(struct.pack('<I%ss'%length, length, _x))
00220         _x = _v3.name
00221         length = len(_x)
00222         if python3 or type(_x) == unicode:
00223           _x = _x.encode('utf-8')
00224           length = len(_x)
00225         buff.write(struct.pack('<I%ss'%length, length, _x))
00226         _x = _v3.node
00227         length = len(_x)
00228         if python3 or type(_x) == unicode:
00229           _x = _x.encode('utf-8')
00230           length = len(_x)
00231         buff.write(struct.pack('<I%ss'%length, length, _x))
00232       buff.write(_struct_B.pack(self.cancel))
00233     except struct.error as se: self._check_types(se)
00234     except TypeError as te: self._check_types(te)
00235 
00236   def deserialize_numpy(self, str, numpy):
00237     """
00238     unpack serialized message in str into this message instance using numpy for array types
00239     :param str: byte array of serialized message, ``str``
00240     :param numpy: numpy python module
00241     """
00242     try:
00243       if self.remotes is None:
00244         self.remotes = None
00245       end = 0
00246       start = end
00247       end += 4
00248       (length,) = _struct_I.unpack(str[start:end])
00249       self.remotes = []
00250       for i in range(0, length):
00251         val1 = gateway_comms.msg.RemoteRule()
00252         start = end
00253         end += 4
00254         (length,) = _struct_I.unpack(str[start:end])
00255         start = end
00256         end += length
00257         if python3:
00258           val1.gateway = str[start:end].decode('utf-8')
00259         else:
00260           val1.gateway = str[start:end]
00261         _v4 = val1.rule
00262         start = end
00263         end += 4
00264         (length,) = _struct_I.unpack(str[start:end])
00265         start = end
00266         end += length
00267         if python3:
00268           _v4.type = str[start:end].decode('utf-8')
00269         else:
00270           _v4.type = str[start:end]
00271         start = end
00272         end += 4
00273         (length,) = _struct_I.unpack(str[start:end])
00274         start = end
00275         end += length
00276         if python3:
00277           _v4.name = str[start:end].decode('utf-8')
00278         else:
00279           _v4.name = str[start:end]
00280         start = end
00281         end += 4
00282         (length,) = _struct_I.unpack(str[start:end])
00283         start = end
00284         end += length
00285         if python3:
00286           _v4.node = str[start:end].decode('utf-8')
00287         else:
00288           _v4.node = str[start:end]
00289         self.remotes.append(val1)
00290       start = end
00291       end += 1
00292       (self.cancel,) = _struct_B.unpack(str[start:end])
00293       self.cancel = bool(self.cancel)
00294       return self
00295     except struct.error as e:
00296       raise genpy.DeserializationError(e) #most likely buffer underfill
00297 
00298 _struct_I = genpy.struct_I
00299 _struct_B = struct.Struct("<B")
00300 """autogenerated by genpy from gateway_comms/RemoteResponse.msg. Do not edit."""
00301 import sys
00302 python3 = True if sys.hexversion > 0x03000000 else False
00303 import genpy
00304 import struct
00305 
00306 
00307 class RemoteResponse(genpy.Message):
00308   _md5sum = "cb1e85ae0c5f4b1c31221493724cc5aa"
00309   _type = "gateway_comms/RemoteResponse"
00310   _has_header = False #flag to mark the presence of a Header object
00311   _full_text = """
00312 
00313 
00314 int8 result
00315 string error_message
00316 
00317 
00318 
00319 """
00320   __slots__ = ['result','error_message']
00321   _slot_types = ['int8','string']
00322 
00323   def __init__(self, *args, **kwds):
00324     """
00325     Constructor. Any message fields that are implicitly/explicitly
00326     set to None will be assigned a default value. The recommend
00327     use is keyword arguments as this is more robust to future message
00328     changes.  You cannot mix in-order arguments and keyword arguments.
00329 
00330     The available fields are:
00331        result,error_message
00332 
00333     :param args: complete set of field values, in .msg order
00334     :param kwds: use keyword arguments corresponding to message field names
00335     to set specific fields.
00336     """
00337     if args or kwds:
00338       super(RemoteResponse, self).__init__(*args, **kwds)
00339       #message fields cannot be None, assign default values for those that are
00340       if self.result is None:
00341         self.result = 0
00342       if self.error_message is None:
00343         self.error_message = ''
00344     else:
00345       self.result = 0
00346       self.error_message = ''
00347 
00348   def _get_types(self):
00349     """
00350     internal API method
00351     """
00352     return self._slot_types
00353 
00354   def serialize(self, buff):
00355     """
00356     serialize message into buffer
00357     :param buff: buffer, ``StringIO``
00358     """
00359     try:
00360       buff.write(_struct_b.pack(self.result))
00361       _x = self.error_message
00362       length = len(_x)
00363       if python3 or type(_x) == unicode:
00364         _x = _x.encode('utf-8')
00365         length = len(_x)
00366       buff.write(struct.pack('<I%ss'%length, length, _x))
00367     except struct.error as se: self._check_types(se)
00368     except TypeError as te: self._check_types(te)
00369 
00370   def deserialize(self, str):
00371     """
00372     unpack serialized message in str into this message instance
00373     :param str: byte array of serialized message, ``str``
00374     """
00375     try:
00376       end = 0
00377       start = end
00378       end += 1
00379       (self.result,) = _struct_b.unpack(str[start:end])
00380       start = end
00381       end += 4
00382       (length,) = _struct_I.unpack(str[start:end])
00383       start = end
00384       end += length
00385       if python3:
00386         self.error_message = str[start:end].decode('utf-8')
00387       else:
00388         self.error_message = str[start:end]
00389       return self
00390     except struct.error as e:
00391       raise genpy.DeserializationError(e) #most likely buffer underfill
00392 
00393 
00394   def serialize_numpy(self, buff, numpy):
00395     """
00396     serialize message with numpy array types into buffer
00397     :param buff: buffer, ``StringIO``
00398     :param numpy: numpy python module
00399     """
00400     try:
00401       buff.write(_struct_b.pack(self.result))
00402       _x = self.error_message
00403       length = len(_x)
00404       if python3 or type(_x) == unicode:
00405         _x = _x.encode('utf-8')
00406         length = len(_x)
00407       buff.write(struct.pack('<I%ss'%length, length, _x))
00408     except struct.error as se: self._check_types(se)
00409     except TypeError as te: self._check_types(te)
00410 
00411   def deserialize_numpy(self, str, numpy):
00412     """
00413     unpack serialized message in str into this message instance using numpy for array types
00414     :param str: byte array of serialized message, ``str``
00415     :param numpy: numpy python module
00416     """
00417     try:
00418       end = 0
00419       start = end
00420       end += 1
00421       (self.result,) = _struct_b.unpack(str[start:end])
00422       start = end
00423       end += 4
00424       (length,) = _struct_I.unpack(str[start:end])
00425       start = end
00426       end += length
00427       if python3:
00428         self.error_message = str[start:end].decode('utf-8')
00429       else:
00430         self.error_message = str[start:end]
00431       return self
00432     except struct.error as e:
00433       raise genpy.DeserializationError(e) #most likely buffer underfill
00434 
00435 _struct_I = genpy.struct_I
00436 _struct_b = struct.Struct("<b")
00437 class Remote(object):
00438   _type          = 'gateway_comms/Remote'
00439   _md5sum = 'd2170021bdea1c8bfca632d3d43a6993'
00440   _request_class  = RemoteRequest
00441   _response_class = RemoteResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


gateway_comms
Author(s): Jihoon
autogenerated on Wed Nov 21 2012 15:02:06