
Public Member Functions | |
| def | __init__ |
| def | fragment |
Public Attributes | |
| fragmentation_seed | |
Static Public Attributes | |
| int | fragmentation_seed = 0 |
Private Member Functions | |
| def | _create_fragment |
| def | _fragment_generator |
The Fragmentation capability doesn't define any incoming operation handlers, but provides methods to fragment outgoing messages
Definition at line 36 of file fragmentation.py.
| def rosbridge_library.capabilities.fragmentation.Fragmentation.__init__ | ( | self, | |
| protocol | |||
| ) |
Abstract class constructor. All capabilities require a handle to the containing protocol. Keyword arguments: protocol -- the protocol instance for this capability instance
Reimplemented from rosbridge_library.capability.Capability.
Definition at line 42 of file fragmentation.py.
| def rosbridge_library.capabilities.fragmentation.Fragmentation._create_fragment | ( | self, | |
| fragment, | |||
| num, | |||
| total, | |||
| mid | |||
| ) | [private] |
Given a string fragment of the original message, creates the appropriate fragment message
Definition at line 89 of file fragmentation.py.
| def rosbridge_library.capabilities.fragmentation.Fragmentation._fragment_generator | ( | self, | |
| msg, | |||
| size, | |||
| mid | |||
| ) | [private] |
Returns a generator of fragment messages
Definition at line 80 of file fragmentation.py.
| def rosbridge_library.capabilities.fragmentation.Fragmentation.fragment | ( | self, | |
| message, | |||
| fragment_size, | |||
mid = None |
|||
| ) |
Serializes the provided message, then splits the serialized message according to fragment_size, then sends the fragments. If the size of the message is less than the fragment size, then the original message is returned rather than a single fragment Since fragmentation is typically only used for very large messages, this method returns a generator for fragments rather than a list Keyword Arguments message -- the message dict object to be fragmented fragment_size -- the max size for the fragments mid -- (optional) if provided, the fragment messages will be given this id. Otherwise an id will be auto-generated. Returns a generator of message dict objects representing the fragments
Definition at line 46 of file fragmentation.py.
Definition at line 40 of file fragmentation.py.
Definition at line 62 of file fragmentation.py.