grepros 1.3.0
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
MultiSink Class Reference
Inheritance diagram for MultiSink:
Inheritance graph

Public Member Functions

 __init__ (self, args=None, sinks=(), **kwargs)
 
 bind (self, source)
 
 close (self)
 
 configure (self, args=None, **kwargs)
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 
 emit_meta (self)
 
 flush (self)
 
 is_highlighting (self)
 
 validate (self)
 
- Public Member Functions inherited from Sink
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 
 autodetect (cls, target)
 
 thread_excepthook (self, text, exc)
 

Public Attributes

 sinks
 List of all combined sinks.
 
 valid
 
- Public Attributes inherited from Sink
 args
 
 source
 inputs.Source instance bound to this sink
 
 valid
 Result of validate()
 

Static Public Attributes

dict FLAG_CLASSES = {"PUBLISH": LiveSink, "CONSOLE": ConsoleSink, "APP": AppSink}
 Autobinding between argument flags and sink classes.
 
dict FORMAT_CLASSES = {"bag": BagSink}
 Autobinding between `–write TARGET format=FORMAT` and sink classes.
 
- Static Public Attributes inherited from Sink
 DEFAULT_ARGS = dict(META=False)
 Constructor argument defaults.
 
tuple FILE_EXTENSIONS = ()
 Auto-detection file extensions for subclasses, as (".ext", )
 

Detailed Description

Combines any number of sinks.

Definition at line 901 of file outputs.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  args = None,
  sinks = (),
**  kwargs 
)
Accepts more arguments, given to the real sinks constructed.

@param   args           arguments as namespace or dictionary, case-insensitive
@param   args.console   print matches to console
@param   args.write     [[target, format=FORMAT, key=value, ], ]
@param   args.publish   publish matches to live topics
@param   args.app       provide messages to given callback function
@param   sinks          pre-created sinks, arguments will be ignored
@param   kwargs         any and all arguments as keyword overrides, case-insensitive

Reimplemented from Sink.

Definition at line 910 of file outputs.py.

Member Function Documentation

◆ bind()

bind (   self,
  source 
)
Attaches source to all sinks, sets thread_excepthook on all sinks.

Reimplemented from Sink.

Definition at line 963 of file outputs.py.

◆ close()

close (   self)
Closes all sinks.

Reimplemented from Sink.

Definition at line 987 of file outputs.py.

◆ configure()

configure (   self,
  args = None,
**  kwargs 
)
Updates sinks configuration.

@param   args    arguments as namespace or dictionary, case-insensitive
@param   kwargs  any and all arguments as keyword overrides, case-insensitive

Reimplemented from Sink.

Definition at line 970 of file outputs.py.

◆ emit()

emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)
Outputs ROS message to all sinks.

Reimplemented from Sink.

Definition at line 955 of file outputs.py.

◆ emit_meta()

emit_meta (   self)
Outputs source metainfo in one sink, if not already emitted.

Reimplemented from Sink.

Definition at line 947 of file outputs.py.

◆ flush()

flush (   self)
Flushes all sinks.

Reimplemented from Sink.

Definition at line 992 of file outputs.py.

◆ is_highlighting()

is_highlighting (   self)
Returns whether any sink requires highlighted matches.

Reimplemented from Sink.

Definition at line 997 of file outputs.py.

◆ validate()

validate (   self)
Returns whether prerequisites are met for all sinks.

Reimplemented from Sink.

Definition at line 981 of file outputs.py.

Member Data Documentation

◆ FLAG_CLASSES

dict FLAG_CLASSES = {"PUBLISH": LiveSink, "CONSOLE": ConsoleSink, "APP": AppSink}
static

Autobinding between argument flags and sink classes.

Definition at line 905 of file outputs.py.

◆ FORMAT_CLASSES

dict FORMAT_CLASSES = {"bag": BagSink}
static

Autobinding between `–write TARGET format=FORMAT` and sink classes.

Definition at line 908 of file outputs.py.

◆ sinks

sinks

List of all combined sinks.

Definition at line 927 of file outputs.py.

◆ valid

valid

Definition at line 924 of file outputs.py.


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