.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "DlfStream 3pm" .TH DlfStream 3pm 2025-09-28 "Lire 2.1.1" "LogReport's Lire Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Lire::DlfStream \- Interface to DLF data stream .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Lire::DlfStore; \& \& my $store = Lire::DlfStore\->open( "mystore" ); \& my $dlf_stream = $store\->open_dlf_stream( "www", "r" ); \& \& print "Data begins on ", scalar localtime $dlf_stream\->start_time(), "\en"; \& print "Data ends on ", scalar localtime $dlf_stream\->end_time(), "\en"; \& while ( my $dlf = $dlf_stream\->read_dlf() ) { \& ... \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This object encapsulates DLF stream. .SS name .IX Subsection "name" Returns the schema\*(Aqs name of the DlfStream. .SS \fBmode()\fP .IX Subsection "mode()" Returns the mode in which the DlfStream was opened. .SS \fBsort_spec()\fP .IX Subsection "sort_spec()" Returns the sort specification that is set on the stream. .SS \fBclose()\fP .IX Subsection "close()" This method should be called when the Lire::DlfStream isn\*(Aqt needed anymore, otherwise the same DlfStream cannot be opened until then. .SS \fBnrecords()\fP .IX Subsection "nrecords()" Returs the number of DLF records in the stream. .SS \fBstart_time()\fP .IX Subsection "start_time()" Returns the timestamp of the oldest DLF record in the stream in seconds since the epoch. .SS \fBend_time()\fP .IX Subsection "end_time()" Returns the timestamp of the newest DLF record in the stream in seconds since the epoch. .SS \fBread_dlf()\fP .IX Subsection "read_dlf()" Returns an hash reference containing the next DLF record in the stream. It returns undef once the end of the stream is reached. .PP This method will throw an exception if the DlfStream isn\*(Aqt open in \*(Aqr\*(Aq mode or if there is an error reading the DLF record. .SS \fBread_dlf_aref()\fP .IX Subsection "read_dlf_aref()" Returns the next DLF record in the stream as an array reference. The fields are in the order specified by the schema. .PP This method will throw an exception if the DlfStream isn\*(Aqt open in \*(Aqr\*(Aq mode or if there is an error reading the DLF record. .ie n .SS "write_dlf( $dlf, [ $link_ids ] )" .el .SS "write_dlf( \f(CW$dlf\fP, [ \f(CW$link_ids\fP ] )" .IX Subsection "write_dlf( $dlf, [ $link_ids ] )" Writes the fields contained in the hash ref \f(CW$dlf\fR to the DLF stream. .PP This method will throw an exception if there is an error writing the DLF record or if the stream isn\*(Aqt opened in \*(Aqw\*(Aq mode. .PP The \f(CW$link_ids\fR parameter is used when the stream\*(Aqs schema is a Lire::DerivedSchema. It should be an array reference containing the DLF ids of the records which are linked to this record. .ie n .SS "clean( [ $time ] )" .el .SS "clean( [ \f(CW$time\fP ] )" .IX Subsection "clean( [ $time ] )" This method will remove all DLF records older than \f(CW$time\fR. It \f(CW$time\fR is omitted, all Dlf records will be removed.