grepros 1.2.2
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
MultiSink Class Reference

Combines any number of sinks. More...

Inheritance diagram for MultiSink:
Inheritance graph

Public Member Functions

 __init__ (self, args=None, sinks=(), **kwargs)
 Accepts more arguments, given to the real sinks constructed.
 
 bind (self, source)
 Attaches source to all sinks, sets thread_excepthook on all sinks.
 
 close (self)
 Closes all sinks.
 
 configure (self, args=None, **kwargs)
 Updates sinks configuration.
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 Outputs ROS message to all sinks.
 
 emit_meta (self)
 Outputs source metainfo in one sink, if not already emitted.
 
 flush (self)
 Flushes all sinks.
 
 is_highlighting (self)
 Returns whether any sink requires highlighted matches.
 
 validate (self)
 Returns whether prerequisites are met for all sinks.
 
- Public Member Functions inherited from Sink
 __init__ (self, args=None, **kwargs)
 
 __enter__ (self)
 Context manager entry.
 
 __exit__ (self, exc_type, exc_value, traceback)
 Context manager exit, closes sink.
 
 autodetect (cls, target)
 Returns true if target is recognizable as output for this sink class.
 
 bind (self, source)
 Attaches source to sink.
 
 close (self)
 Shuts down output, closing any files or connections.
 
 configure (self, args=None, **kwargs)
 Updates sink configuration.
 
 emit (self, topic, msg, stamp=None, match=None, index=None)
 Outputs ROS message.
 
 emit_meta (self)
 Outputs source metainfo like bag header as debug stream, if not already emitted.
 
 flush (self)
 Writes out any pending data to disk.
 
 is_highlighting (self)
 Returns whether this sink requires highlighted matches.
 
 thread_excepthook (self, text, exc)
 Handles exception, used by background threads.
 
 validate (self)
 Returns whether sink prerequisites are met (like ROS environment set if LiveSink).
 

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 918 of file outputs.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ (   self,
  args = None,
  sinks = (),
**  kwargs 
)

Accepts more arguments, given to the real sinks constructed.

Parameters
argsarguments as namespace or dictionary, case-insensitive
args.consoleprint matches to console
args.write[[target, format=FORMAT, key=value, ], ]
args.publishpublish matches to live topics
args.appprovide messages to given callback function
sinkspre-created sinks, arguments will be ignored
kwargsany and all arguments as keyword overrides, case-insensitive

Reimplemented from Sink.

Definition at line 938 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 980 of file outputs.py.

◆ close()

close (   self)

Closes all sinks.

Reimplemented from Sink.

Definition at line 1004 of file outputs.py.

◆ configure()

configure (   self,
  args = None,
**  kwargs 
)

Updates sinks configuration.

Parameters
argsarguments as namespace or dictionary, case-insensitive
kwargsany and all arguments as keyword overrides, case-insensitive

Reimplemented from Sink.

Definition at line 993 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 972 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 964 of file outputs.py.

◆ flush()

flush (   self)

Flushes all sinks.

Reimplemented from Sink.

Definition at line 1009 of file outputs.py.

◆ is_highlighting()

is_highlighting (   self)

Returns whether any sink requires highlighted matches.

Reimplemented from Sink.

Definition at line 1014 of file outputs.py.

◆ validate()

validate (   self)

Returns whether prerequisites are met for all sinks.

Reimplemented from Sink.

Definition at line 998 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 922 of file outputs.py.

◆ FORMAT_CLASSES

dict FORMAT_CLASSES = {"bag": BagSink}
static

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

Definition at line 925 of file outputs.py.

◆ sinks

sinks

List of all combined sinks.

Definition at line 944 of file outputs.py.

◆ valid

valid

Definition at line 941 of file outputs.py.


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