Public Member Functions | Public Attributes | List of all members
rosbridge_library.capability.Capability Class Reference
Inheritance diagram for rosbridge_library.capability.Capability:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, protocol)
 
def basic_type_check (self, msg, types_info)
 
def finish (self)
 
def handle_message (self, message)
 

Public Attributes

 protocol
 

Detailed Description

Handles the operation-specific logic of a rosbridge message

May define one or more opcodes to handle, for example 'publish' or
'call_service'

Each connected client receives its own capability instance, which are
managed by the client's own protocol instance.

Protocol.send() is available to send messages back to the client.

Definition at line 37 of file capability.py.

Constructor & Destructor Documentation

◆ __init__()

def rosbridge_library.capability.Capability.__init__ (   self,
  protocol 
)

Member Function Documentation

◆ basic_type_check()

def rosbridge_library.capability.Capability.basic_type_check (   self,
  msg,
  types_info 
)
Performs basic typechecking on fields in msg.

Keyword arguments:
msg        -- a message, deserialized into a dictoinary
types_info -- a list of tuples (mandatory, fieldname, fieldtype) where
mandatory - boolean, is the field mandatory
fieldname - the name of the field in the message
fieldtypes - the expected python type of the field or list of types

Throws:
MissingArgumentException -- if a field is mandatory but not present in
the message
InvalidArgumentException -- if a field is present but not of the type
specified by fieldtype

Definition at line 76 of file capability.py.

◆ finish()

def rosbridge_library.capability.Capability.finish (   self)
Notify this capability that the client is finished and that it's
time to free up resources. 

Reimplemented in rosbridge_library.capabilities.subscribe.Subscribe, rosbridge_library.capabilities.defragmentation.Defragment, rosbridge_library.capabilities.advertise.Advertise, and rosbridge_library.capabilities.publish.Publish.

Definition at line 71 of file capability.py.

◆ handle_message()

def rosbridge_library.capability.Capability.handle_message (   self,
  message 
)
Handle an incoming message.

Called by the protocol after having already checked the message op code

Keyword arguments:
message -- the incoming message, deserialized into a dictionary

Definition at line 60 of file capability.py.

Member Data Documentation

◆ protocol

rosbridge_library.capability.Capability.protocol

Definition at line 58 of file capability.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