5.2.6. vlcp.event.matchtree

Note

This document is generated from the source file.

View Source on GitHub

Created on 2015/06/01

author:hubo
class vlcp.event.matchtree.EventTree(parent=None, branch=5)

Store events; match matchers

__init__(parent=None, branch=5)

Constructor

subtree(event, create=False)

Find a subtree from an event

class vlcp.event.matchtree.MatchTree(parent=None)

A dictionary tree for fast event match

__init__(parent=None)

Constructor

insert(matcher, obj)

Insert a new matcher

Parameters:
  • matcher – an EventMatcher
  • obj – object to return
matches(event)

Return all matches for this event. The first matcher is also returned for each matched object.

Parameters:event – an input event
matchesWithMatchers(event)

Return all matches for this event. The first matcher is also returned for each matched object.

Parameters:event – an input event
matchfirst(event)

Return first match for this event

Parameters:event – an input event
matchfirstwithmatcher(event)

Return first match with matcher for this event

Parameters:event – an input event
remove(matcher, obj)

Remove the matcher

Parameters:
  • matcher – an EventMatcher
  • obj – the object to remove
subtree(matcher, create=False)

Find a subtree from a matcher

Parameters:
  • matcher – the matcher to locate the subtree. If None, return the root of the tree.
  • create – if True, the subtree is created if not exists; otherwise return None if not exists