Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
grepros.outputs.Sink Class Reference
Inheritance diagram for grepros.outputs.Sink:
Inheritance graph
[legend]

Public Member Functions

def __enter__ (self)
 
def __exit__ (self, exc_type, exc_value, traceback)
 
def __init__ (self, args=None, **kwargs)
 
def autodetect (cls, target)
 
def bind (self, source)
 
def close (self)
 
def emit (self, topic, msg, stamp=None, match=None, index=None)
 
def emit_meta (self)
 
def flush (self)
 
def is_highlighting (self)
 
def thread_excepthook (self, text, exc)
 
def validate (self)
 

Public Attributes

 args
 
 source
 inputs.Source instance bound to this sink More...
 
 valid
 Result of validate() More...
 

Static Public Attributes

 DEFAULT_ARGS = dict(META=False)
 Constructor argument defaults. More...
 
tuple FILE_EXTENSIONS = ()
 Auto-detection file extensions for subclasses, as (".ext", ) More...
 

Private Member Functions

def _ensure_stamp_index (self, topic, msg, stamp=None, index=None)
 

Private Attributes

 _batch_meta
 
 _counts
 

Detailed Description

Output base class.

Definition at line 32 of file outputs.py.

Constructor & Destructor Documentation

◆ __init__()

def grepros.outputs.Sink.__init__ (   self,
  args = None,
**  kwargs 
)
@param   args        arguments as namespace or dictionary, case-insensitive
@param   args.meta   whether to emit metainfo
@param   kwargs      any and all arguments as keyword overrides, case-insensitive

Reimplemented in grepros.outputs.AppSink, grepros.outputs.TopicSink, grepros.outputs.BagSink, grepros.plugins.mcap.McapSink, grepros.outputs.ConsoleSink, grepros.plugins.parquet.ParquetSink, grepros.plugins.auto.postgres.PostgresSink, grepros.plugins.auto.dbbase.BaseDataSink, grepros.plugins.auto.sqlite.SqliteSink, grepros.plugins.sql.SqlSink, grepros.plugins.auto.html.HtmlSink, and grepros.plugins.auto.csv.CsvSink.

Definition at line 41 of file outputs.py.

Member Function Documentation

◆ __enter__()

def grepros.outputs.Sink.__enter__ (   self)
Context manager entry.

Definition at line 56 of file outputs.py.

◆ __exit__()

def grepros.outputs.Sink.__exit__ (   self,
  exc_type,
  exc_value,
  traceback 
)
Context manager exit, closes sink.

Definition at line 60 of file outputs.py.

◆ _ensure_stamp_index()

def grepros.outputs.Sink._ensure_stamp_index (   self,
  topic,
  msg,
  stamp = None,
  index = None 
)
private
Returns (stamp, index) populated with current ROS time and topic index if `None`.

Definition at line 115 of file outputs.py.

◆ autodetect()

def grepros.outputs.Sink.autodetect (   cls,
  target 
)
Returns true if target is recognizable as output for this sink class.

Reimplemented in grepros.outputs.BagSink, and grepros.plugins.auto.postgres.PostgresSink.

Definition at line 110 of file outputs.py.

◆ bind()

def grepros.outputs.Sink.bind (   self,
  source 
)
Attaches source to sink.

Reimplemented in grepros.outputs.MultiSink, and grepros.outputs.TopicSink.

Definition at line 84 of file outputs.py.

◆ close()

def grepros.outputs.Sink.close (   self)

◆ emit()

def grepros.outputs.Sink.emit (   self,
  topic,
  msg,
  stamp = None,
  match = None,
  index = None 
)
Outputs ROS message.

@param   topic  full name of ROS topic the message is from
@param   msg    ROS message
@param   stamp  message ROS timestamp, if not current ROS time
@param   match  ROS message with values tagged with match markers if matched, else None
@param   index  message index in topic, if any

Reimplemented in grepros.outputs.MultiSink, grepros.outputs.AppSink, grepros.outputs.TopicSink, grepros.outputs.BagSink, grepros.plugins.mcap.McapSink, grepros.outputs.ConsoleSink, grepros.plugins.parquet.ParquetSink, grepros.plugins.auto.dbbase.BaseDataSink, grepros.plugins.auto.sqlite.SqliteSink, grepros.plugins.sql.SqlSink, grepros.plugins.auto.html.HtmlSink, and grepros.plugins.auto.csv.CsvSink.

Definition at line 71 of file outputs.py.

◆ emit_meta()

def grepros.outputs.Sink.emit_meta (   self)
Outputs source metainfo like bag header as debug stream, if not already emitted.

Reimplemented in grepros.outputs.MultiSink, grepros.outputs.AppSink, and grepros.outputs.ConsoleSink.

Definition at line 64 of file outputs.py.

◆ flush()

def grepros.outputs.Sink.flush (   self)
Writes out any pending data to disk.

Reimplemented in grepros.outputs.MultiSink, and grepros.plugins.auto.html.HtmlSink.

Definition at line 98 of file outputs.py.

◆ is_highlighting()

def grepros.outputs.Sink.is_highlighting (   self)
Returns whether this sink requires highlighted matches.

Reimplemented in grepros.outputs.MultiSink, grepros.outputs.AppSink, grepros.outputs.ConsoleSink, and grepros.plugins.auto.html.HtmlSink.

Definition at line 105 of file outputs.py.

◆ thread_excepthook()

def grepros.outputs.Sink.thread_excepthook (   self,
  text,
  exc 
)
Handles exception, used by background threads.

Definition at line 101 of file outputs.py.

◆ validate()

def grepros.outputs.Sink.validate (   self)

Member Data Documentation

◆ _batch_meta

grepros.outputs.Sink._batch_meta
private

Definition at line 47 of file outputs.py.

◆ _counts

grepros.outputs.Sink._counts
private

Definition at line 48 of file outputs.py.

◆ args

grepros.outputs.Sink.args

Definition at line 50 of file outputs.py.

◆ DEFAULT_ARGS

grepros.outputs.Sink.DEFAULT_ARGS = dict(META=False)
static

Constructor argument defaults.

Definition at line 39 of file outputs.py.

◆ FILE_EXTENSIONS

tuple grepros.outputs.Sink.FILE_EXTENSIONS = ()
static

Auto-detection file extensions for subclasses, as (".ext", )

Definition at line 36 of file outputs.py.

◆ source

grepros.outputs.Sink.source

inputs.Source instance bound to this sink

Definition at line 54 of file outputs.py.

◆ valid

grepros.outputs.Sink.valid

Result of validate()

Definition at line 52 of file outputs.py.


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


grepros
Author(s): Erki Suurjaak
autogenerated on Sat Jan 6 2024 03:11:30