NAME

DTA::TokWrap::Document::Maker - DTA tokenizer wrappers: document wrapper: make-mode

SYNOPSIS

 use DTA::TokWrap::Document::Maker;
 
 $doc = DTA::TokWrap::Document::Maker->new(%opts);
 $doc->makeKey($key);
 
 ##-- ... any other DTA::TokWrap::Document method ...

DESCRIPTION

DTA::TokWrap::Document::Maker provides an experimental DTA::TokWrap::Document subclass which attempts to perform make-like dependency tracking on document data keys.

Globals

@ISA

DTA::TokWrap::Document::Maker inherits from DTA::TokWrap::Document, and should support all DTA::TokWrap::Document methods.

Constructors etc.

new
 $doc = $CLASS_OR_OBJECT->new(%args);

Low-level constructor for make-mode document wrapper object. See DTA::TokWrap::Document::new.

defaults
 %defaults = CLASS->defaults();

Static class-dependent defaults.

init
 $doc = $doc->init();

Dynamic object-dependent defaults.

Methods: make Mode: Dependency Tracking

Variable: %KEYGEN

%KEYGEN = ($dataKey => $generatorSpec, ...)

See %DTA::TokWrap::Document::KEYGEN.

%KEYDEPS
 %KEYDEPS = ($dataKey => \@depsForKey, ...)

Recursive key dependencies.

%KEYDEPS_0
 %KEYDEPS_0 = ($dataKey => \@immediateDepsForKey, ...)

Immediate key dependencies.

%KEYDEPS_H
 %KEYDEPS_0 = ($dataKey => {$dep1=>undef,$dep2=>undef,...}, ...)

Recursive dependencies as a hash-of-hashes.

keycmp
 $cmp = DTA::ToKWrap::Document::Maker::keycmp($a,$b);

Sort comparison function for data keys.

uniqKeys
 @uniqKeys = uniqKeys(@keys);

Returns unique keys from @keys.

keyDeps0
 @deps0 = PACKAGE::keyDeps0(@docKeys);

Returns unique immediate dependencies for @docKeys.

keyDeps
 @deps = PACKAGE::keyDeps(@docKeys);

Returns unique recursive dependencies for @docKeys.

keyStamp
 $floating_secs_or_undef = $doc->keyStamp($key);

Returns $doc->{"${key}_stamp"} if it exists. Otherwise returns file modification time for file keys. Returned value is (floating point) seconds since epoch.

keyNewerDeps
 @newerDeps = $doc->keyNewerDeps($key);
 @newerDeps = $doc->keyNewerDeps($key, $missingDepsAreNewer)

Returns list of recursive dependencies for $key which are newer than $key itself. If $missingDepsAreNewer is given and true, missing dependencies are not allowed.

keyIsCurrent
 $bool = $doc->keyIsCurrent($key);
 $bool = $doc->keyIsCurrent($key, $requireMissingDeps)

Returns true iff $key is at least as new as all its dependencies.

If $requireMissingDeps is true, missing dependencies are treated as infinitely new (function returns false).

genKey
 $bool = $doc->genKey($key);
 $bool = $doc->genKey($key,\%KEYGEN)

Unconditionally (re-)generate a data key (single step only, ignoring dependencies).

Passes on local \%KEYGEN.

makeKey
 $bool = $doc->makeKey($key);
 $bool = $doc->makeKey($key,\%queued)

Conditionally (re-)generate a data key, checking dependencies.

makeAll
 $bool = $doc->makeAll();

Alias for $doc->makeKey('all').

forceStale
 undef = $doc->forceStale(@keys);

Forces all keys @keys to be considered stale by setting $doc->{"${key}_stamp"}=-$ix, where $ix is the index of $key in the dependency-sorted list.

You can use the $doc->keyDeps() method to get a list of all dependencies. In particular, using $doc->keyDeps('all') should mark all keys as stale

remakeKey
 $keyval_or_undef = $doc->remakeKey($key);

Unconditionally (re-)generate a data key and all its dependencies.

SEE ALSO

DTA::TokWrap::Intro(3pm), dta-tokwrap.perl(1), ...

SEE ALSO

DTA::TokWrap::Intro(3pm), dta-tokwrap.perl(1), ...

AUTHOR

Bryan Jurish <jurish@bbaw.de>

COPYRIGHT AND LICENSE

Copyright (C) 2009-2018 by Bryan Jurish

This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.