Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Config::Model::BackendUserkContributed PerlConfig::Model::BackendTrackOrder(3)

NAME
       Config::Model::BackendTrackOrder	- Track	read order of elements from
       configuration

VERSION
       version 2.140

SYNOPSIS
	# inside a backend
	use Config::Model::BackendTrackOrder;

	has tracker => (
	   is => 'ro',
	   isa => 'Config::Model::BackendTrackOrder',
	   lazy_build => 1,
	);

	sub _build_tracker {
	   my $self = shift;
	   return Config::Model::BackendTrackOrder->new(
	       backend_obj => $self,
	       node => $self->node,
	   ) ;
	}

	# register elements to record user order
	$self->tracker->register_element('foo');
	$self->tracker->register_element('bar');

	# later, when writing data back
	foreach	my $elt	( $self->tracker->get_ordered_element_names ) {
	     # write data
	}

DESCRIPTION
       This module is used by backends to record the order of the
       configuration elements found in user file. Later	these elements can be
       written back in the file	using the same order.

       Data are	written	in canonical order if "canonical" method of the
       "Config::Model::Instance" in instance returns true.

CONSTRUCTOR
       THe constructor accepts the following parameters:

       backend_obj
	   The backend object holding this tracker (required).

       node
	   The node holding the	backend	above

METHODS
   register_element
       Register	the element and	keep track of the registration order during
       initial load

       Element registered after	initial	load (i.e . user modification) are
       registered using	canonical order.

   get_ordered_element_names
       Returns a list of elements respecting user's order.

       Returns the canonical list if Instance canonical	attribute is 1.

AUTHOR
       Dominique Dumont

COPYRIGHT AND LICENSE
       This software is	Copyright (c) 2005-2020	by Dominique Dumont.

       This is free software, licensed under:

	 The GNU Lesser	General	Public License,	Version	2.1, February 1999

perl v5.32.0			  2020-08-2Config::Model::BackendTrackOrder(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | CONSTRUCTOR | METHODS | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Config::Model::BackendTrackOrder&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help