Base class for all message update rules. More...
Public Member Functions | |
def | __init__ |
Initialize class. | |
def | apply |
The function actually called by the message migrator. | |
def | find_sub_paths |
Find all of the sub paths. | |
def | get_class_def |
A helper function to print out the definiton of autogenerated messages. | |
def | get_new_class |
Helper function to get the class of a submsg for the new type. | |
def | get_old_class |
Helper function to get the class of a submsg for the old type. | |
def | migrate |
Actually migrate one sub_type to another. | |
def | migrate_array |
Helper function to migrate a whole array of messages. | |
def | update |
The function which a user overrides to actually perform the message update. | |
Public Attributes | |
location | |
migrator | |
new_class | |
new_md5sum | |
new_type | |
new_types | |
old_class | |
old_md5sum | |
old_type | |
old_types | |
rename_rule | |
sub_rules | |
sub_rules_done | |
sub_rules_valid | |
Static Public Attributes | |
list | migrated_types = [] |
string | new_full_text = '' |
string | new_type = '' |
string | old_full_text = '' |
string | old_type = '' |
int | order = 1 |
valid = False |
Base class for all message update rules.
Definition at line 247 of file migration.py.
def rosbag.migration.MessageUpdateRule.__init__ | ( | self, | |
migrator, | |||
location | |||
) |
Initialize class.
Definition at line 259 of file migration.py.
def rosbag.migration.MessageUpdateRule.apply | ( | self, | |
old_msg | |||
) |
The function actually called by the message migrator.
old_msg | An instance of the old message type. |
Definition at line 415 of file migration.py.
Find all of the sub paths.
For any migrated type the user might want to use, we must make sure the migrator had found a path for it. To facilitated this check we require that all migrated types must be listed as pairs in the migrated_types field.
It would be nice not to need these through performing some kind of other inspection of the update rule itself.
Definition at line 307 of file migration.py.
def rosbag.migration.MessageUpdateRule.get_class_def | ( | self | ) |
A helper function to print out the definiton of autogenerated messages.
Definition at line 408 of file migration.py.
def rosbag.migration.MessageUpdateRule.get_new_class | ( | self, | |
t | |||
) |
Helper function to get the class of a submsg for the new type.
This function should be used inside of update to access new classes.
t | The subtype to return the class of |
Definition at line 345 of file migration.py.
def rosbag.migration.MessageUpdateRule.get_old_class | ( | self, | |
t | |||
) |
Helper function to get the class of a submsg for the old type.
This function should be used inside of update to access old classes.
t | The subtype to return the class of |
Definition at line 360 of file migration.py.
def rosbag.migration.MessageUpdateRule.migrate | ( | self, | |
msg_from, | |||
msg_to | |||
) |
Actually migrate one sub_type to another.
This function should be used inside of update to migrate sub msgs.
msg_from | A message instance of the old message type |
msg_to | A message instance of a new message type to be populated |
Definition at line 375 of file migration.py.
def rosbag.migration.MessageUpdateRule.migrate_array | ( | self, | |
msg_from_array, | |||
msg_to_array, | |||
msg_to_name | |||
) |
Helper function to migrate a whole array of messages.
This function should be used inside of update to migrate arrays of sub msgs.
msg_from_array | An array of messages of the old message type |
msg_to_array | An array of messages of the new message type (this will be emptied if not already) |
msg_to_class | The name of the new message type since msg_to_array may be an empty array. |
Definition at line 389 of file migration.py.
def rosbag.migration.MessageUpdateRule.update | ( | self, | |
old_msg, | |||
new_msg | |||
) |
The function which a user overrides to actually perform the message update.
msg_from | A message instance of the old message type |
msg_to | A message instance of a new message type to be populated |
Definition at line 435 of file migration.py.
Definition at line 259 of file migration.py.
list rosbag::migration.MessageUpdateRule::migrated_types = [] [static] |
Definition at line 252 of file migration.py.
Definition at line 259 of file migration.py.
Definition at line 259 of file migration.py.
string rosbag::migration.MessageUpdateRule::new_full_text = '' [static] |
Definition at line 251 of file migration.py.
Definition at line 259 of file migration.py.
string rosbag::migration.MessageUpdateRule::new_type = '' [static] |
Definition at line 250 of file migration.py.
Definition at line 259 of file migration.py.
Definition at line 259 of file migration.py.
Definition at line 259 of file migration.py.
string rosbag::migration.MessageUpdateRule::old_full_text = '' [static] |
Definition at line 249 of file migration.py.
Definition at line 259 of file migration.py.
string rosbag::migration.MessageUpdateRule::old_type = '' [static] |
Definition at line 248 of file migration.py.
Definition at line 259 of file migration.py.
Definition at line 259 of file migration.py.
int rosbag::migration.MessageUpdateRule::order = 1 [static] |
Definition at line 254 of file migration.py.
Definition at line 259 of file migration.py.
Definition at line 259 of file migration.py.
Definition at line 259 of file migration.py.
Definition at line 259 of file migration.py.
rosbag::migration.MessageUpdateRule::valid = False [static] |
Definition at line 256 of file migration.py.