Algorithm::Dependency::Objects - An implementation of an Object Dependency Algorithm
use Algorithm::Dependency::Objects; my $o = Algorithm::Dependency::Objects->new( objects => \@objects, selected => \@selected, # objects which are already taken care of ); my @needed = $o->schedule( $objects[0] ); # need to take care of @needed for $objecs[0] to be resolved
This modules is a re-implementation of Algorithm::Dependency using only objects instead of object ids, making use of Set::Object for book-keeping.
Duh.
Returns the Set::Object representing this collection. Objects is an enumeration of all the object who we're dependo-frobnicating, and selected is those that don't need to be run.
See Algorithm::Dependency's corresponding methods.
Make sure that the dependencies of every object in the set are also in the set.
Called by verify_input_set when objects are missing from the input set.
verify_input_set
You can override this method to simply return
$input_set->union($missing_set);
making all dependencies of the input objects implicit input objects themselves.
Called when a new object pops out of the blue in the middle of processing (it means get_deps is returning inconsistent values).
get_deps
Extract the dependencies out of an object. Calls depends on the object.
depends
Default implementation is
$object->can("depends");
Croaks if can_get_deps doesn't return true for every object in the set.
can_get_deps
Adam Kennedy's excellent Algorithm::Dependency module, upon which this is based.
None that we are aware of. Of course, if you find a bug, let us know, and we will be sure to fix it.
We use Devel::Cover to test the code coverage of our tests, below is the Devel::Cover report on this module test suite.
Yuval Kogman
Stevan Little
Copyright (C) 2005 Yuval Kogman, Stevan Little
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Algorithm::Dependency::Objects, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::Dependency::Objects
CPAN shell
perl -MCPAN -e shell install Algorithm::Dependency::Objects
For more information on module installation, please visit the detailed CPAN module installation guide.