class_docstr: Decode IB messages and invoke corresponding wrapper methods.
class_docstr_tok: ["Decode","IB","messages","and","invoke","corresponding","wrapper","methods","."]
docstr: Create a message handler that invokes a wrapper method
  with the in-order message fields as parameters, skipping over
  the first ``skip`` fields, and parsed according to the ``types`` list.
code: def wrap(self, methodName, types, skip=2):
      """
      Create a message handler that invokes a wrapper method
      with the in-order message fields as parameters, skipping over
      the first ``skip`` fields, and parsed according to the ``types`` list.
      """
  
      def handler(fields):
          method = getattr(self.wrapper, methodName, None)
          if method:
              try:
                  args = [
                      field
                      if typ is str
                      else int(field or 0)
                      if typ is int
                      else float(field or 0)
                      if typ is float
                      else bool(int(field or 0))
                      for (typ, field) in zip(types, fields[skip:])
                  ]
                  method(*args)
              except Exception:
                  self.logger.exception(f"Error for {methodName}:")
  
      return handler
  
imports: import dataclasses
  import logging
  from datetime import datetime, timezone
  from typing import Any, cast
  from .contract import ComboLeg, Contract, ContractDescription, ContractDetails, DeltaNeutralContract
  from .objects import BarData, CommissionReport, DepthMktDataDescription, Execution, FamilyCode, HistogramData, HistoricalSession, HistoricalTick, HistoricalTickBidAsk, HistoricalTickLast, NewsProvider, PriceIncrement, SmartComponent, SoftDollarTier, TagValue, TickAttribBidAsk, TickAttribLast
  from .order import Order, OrderComboLeg, OrderCondition, OrderState
  from .util import UNSET_DOUBLE, ZoneInfo, parseIBDatetime
  from .wrapper import Wrapper
label_desc: Use image node_id 2 for calling the Decoder obj's underlying member method code with example usage: obj.wrap(methodName, types, skip) and returns: handler