Group(3pm)
π NAME
ok so this is Lire::Group β the base class for implementing the group aggregator, brought to you by LogReport's Lire Documentation (it's a Group(3pm) situation, iykyk). π
β¨ SYNOPSIS
use Lire::Group;
that's literally it bestie, one line, we love a low-effort icon π¦
πΈ DESCRIPTION
okay so here's the tea: this module is the base class for the implementation of the group aggregator. and what does that aggregator do?? it splits the DLF records into groups that have the same key. simple. iconic. π
the key is made up of one or more several non-numerical fields (yes, that's what it says, don't come for me). and you can configure how many keys to keep in the report through the limit attribute β very "you get to decide who makes the cut" energy. the keys can also be sorted using the sort attribute. slay. β¨
π₯ CONSTRUCTOR
π«Ά new( %params )
creates a new instance of a group aggregator, obviously. π and here's the bonus: in addition to the normal report operator parameters, the limit attribute can be initialized at creation time. so you can set it up right from the jump. periodt.
π METHODS
π limit( [$new_limit] )
returns the number of keys to display in the report. cute. it can be:
- an integer, or
- the name of one of the report specification parameter β but only when it starts by
$π
and yes, the limit attribute can be changed by passing a $new_limit parameter. glow-up enabled. β¨
π sort_fields( [$new_sort_fields] )
returns the fields and/or operator values that are gonna be used to sort the entries generated by this aggregator. it's an array reference containing group field names and/or operator's name. very organized of it. πΈ
the sorting fields can be changed by passing a new array reference, no big deal. π
π¦ group_fields( [$new_fields] )
returns β as a reference to an array of Lire::GroupField objects β the DLF fields that are used to group the records. that's the whole vibe. π₯
if $new_fields is set, the DLF fields used to group the records will be changed. and heads up bestie: this parameter should be a reference to an array of Lire::GroupField objects. respect the type, please. π
β binary_insert
recursive function that uses a binary search to insert $item in $array using $cmp as comparison operator. $first_idx and $max_idx specify the boundaries of the search. π§
and the search ends when $first_idx == $max_idx β or when $sort_key sorts at or before $first_idx or at or after $max_idx. that's the whole rule, no cap. π
π SEE ALSO
go read those too, they're part of the lore πβ¨
π AUTHORS
- Francis J. Lacoste
<flacoste@logreport.org> - Wolfgang Sourdeau
<wsourdeau@logreport.org>
absolute legends, we stan π«Άπ
π VERSION
$Id: Group.pm,v 1.36 2006/07/23 13:16:29 vanbaal Exp $
π§ COPYRIGHT
Copyright (C) 2001-2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
ok so real talk: that WARRANTY disclaimer is not a joke, it's literally in all caps, so don't come crying to anyone if it breaks. π
and that's the whole page bestie!! π this was Lire 2.1.1, dated 2025-09-28 β Group(3pm), out. π
πβ¨
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms