Algorithm-Dependency

 view release on metacpan or  search on metacpan

lib/Algorithm/Dependency.pm  view on Meta::CPAN

#pod
#pod =cut

sub new {
	my $class  = shift;
	my %args   = @_;
	my $source = _INSTANCE($args{source}, 'Algorithm::Dependency::Source')
		or return undef;

	# Create the object
	my $self = bless {
		source   => $source, # Source object
		selected => {},
		}, $class;

	# Were we given the 'ignore_orphans' flag?
	if ( $args{ignore_orphans} ) {
		$self->{ignore_orphans} = 1;
	}

	# Done, unless we have been given some selected items

lib/Algorithm/Dependency/Item.pm  view on Meta::CPAN

#pod this one depends on.
#pod
#pod Returns a new C<Algorithm::Dependency::Item> on success, or C<undef>
#pod on error.
#pod
#pod =cut

sub new {
	my $class = shift;
	my $id    = (defined $_[0] and ! ref $_[0] and $_[0] ne '') ? shift : return undef;
	bless { id => $id, depends => [ @_ ] }, $class;
}

#pod =pod
#pod
#pod =head2 id
#pod
#pod The C<id> method returns the id of the item.
#pod
#pod =cut

lib/Algorithm/Dependency/Source.pm  view on Meta::CPAN

	my $class = shift;

	# This can't be created directly, it must be through
	# a SUPER::new call
	if ( $class eq __PACKAGE__ ) {
		die "Cannot directly instantiate Algorithm::Dependency::Source."
			. " You must use a subclass";
	}

	# Create the basic object
	my $self = bless {
		# Has the source been loaded
		loaded      => 0,

		# Indexes
		items_hash  => undef,
		items_array => undef,
		}, $class;

	$self;
}

lib/Algorithm/Dependency/Weight.pm  view on Meta::CPAN

		: _INSTANCE($args{source}, 'Algorithm::Dependency::Source')
		or return undef;

	# Build the alg-dep object we use
	my $algdep = Algorithm::Dependency->new(
		source         => $source,
		ignore_orphans => 1,
		) or return undef;

	# Create the basic object
	my $self = bless {
		source => $source,
		algdep => $algdep,
		weight => {},
		}, $class;

	$self;
}

#pod =pod
#pod



( run in 1.263 second using v1.01-cache-2.11-cpan-de7293f3b23 )