Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
rosbridge_library.capabilities.fragmentation.Fragmentation Class Reference
Inheritance diagram for rosbridge_library.capabilities.fragmentation.Fragmentation:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, protocol)
 
def fragment (self, message, fragment_size, mid=None)
 
- Public Member Functions inherited from rosbridge_library.capability.Capability
def basic_type_check (self, msg, types_info)
 
def finish (self)
 
def handle_message (self, message)
 

Public Attributes

 fragmentation_seed
 
- Public Attributes inherited from rosbridge_library.capability.Capability
 protocol
 

Static Public Attributes

int fragmentation_seed = 0
 

Private Member Functions

def _create_fragment (self, fragment, num, total, mid)
 
def _fragment_generator (self, msg, size, mid)
 

Detailed Description

The Fragmentation capability doesn't define any incoming operation
handlers, but provides methods to fragment outgoing messages 

Definition at line 37 of file fragmentation.py.

Constructor & Destructor Documentation

◆ __init__()

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 43 of file fragmentation.py.

Member Function Documentation

◆ _create_fragment()

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 97 of file fragmentation.py.

◆ _fragment_generator()

def rosbridge_library.capabilities.fragmentation.Fragmentation._fragment_generator (   self,
  msg,
  size,
  mid 
)
private
Returns a generator of fragment messages 

Definition at line 88 of file fragmentation.py.

◆ fragment()

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 47 of file fragmentation.py.

Member Data Documentation

◆ fragmentation_seed [1/2]

int rosbridge_library.capabilities.fragmentation.Fragmentation.fragmentation_seed = 0
static

Definition at line 41 of file fragmentation.py.

◆ fragmentation_seed [2/2]

rosbridge_library.capabilities.fragmentation.Fragmentation.fragmentation_seed

Definition at line 68 of file fragmentation.py.


The documentation for this class was generated from the following file:


rosbridge_library
Author(s): Jonathan Mace
autogenerated on Tue Oct 3 2023 02:12:45