NAME
XAS::Lib::Counter - A Perl extension for the XAS environment
SYNOPSIS
use XAS::Lib::Counter;
my $counter = XAS::Lib::Counter->new(
-database = $database
);
my $value = $counter->inc('jobid');
my $value = $counter->dec('jobid');
my $value = $counter->value('jobid');
my $value = $counter->reset('jobid');
DESCRIPTION
This module will maintain a table of counters. These counters are numeric and start from 1.
METHODS
new
This will initialize the base object. It takes the following parameters:
inc($name)
This will increment the named counter by one and return the result.
dec($name)
This will decrement the named counter by one and return the result;
reset($name)
This will reset the named counter to one and return the result.
value($name)
This will return the current value of the named counter.
SEE ALSO
XAS
AUTHOR
Kevin L. Esteb, <kevin@kesteb.us>
COPYRIGHT AND LICENSE
Copyright (C) 2012 by Kevin Esteb
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.