Package roslib_electric :: Module msgs :: Class MsgSpec
[frames] | no frames]

Class MsgSpec

source code

object --+
         |
        MsgSpec

Container class for storing loaded msg description files. Field types and names are stored in separate lists with 1-to-1 correspondence. MsgSpec can also return an md5 of the source text.

Instance Methods
 
__init__(self, types, names, constants, text, full_name='', short_name='', package='')
x.__init__(...) initializes x; see help(type(x)) for signature
source code
[(str,str),]
fields(self)
Returns: zip list of types and names (e.g.
source code
[Field,]
parsed_fields(self)
Returns: list of Field classes
source code
bool
has_header(self)
Returns: True if msg decription contains a 'Header header' declaration at the beginning
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, types, names, constants, text, full_name='', short_name='', package='')
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • types ([str]) - list of field types, in order of declaration
  • names ([str]) - list of field names, in order of declaration
  • constants ([Constant]) - Constant declarations
  • text (str) - text of declaration
Raises:
Overrides: object.__init__

fields(self)

source code 
Returns: [(str,str),]
zip list of types and names (e.g. [('int32', 'x'), ('int32', 'y')]

parsed_fields(self)

source code 
Returns: [Field,]
list of Field classes

has_header(self)

source code 
Returns: bool
True if msg decription contains a 'Header header' declaration at the beginning

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)