1 package Test::Valgrind::Component;
8 Test::Valgrind::Component - Base class for Test::Valgrind components.
16 our $VERSION = '1.02';
20 use base qw/Test::Valgrind::Carp/;
34 if (Scalar::Util::blessed($self)) {
36 if ($self->isa(__PACKAGE__)) {
37 $self->{started} = undef;
47 =head2 C<started [ $bool ]>
49 Specifies whether the component is running (C<1>), stopped (C<0>) or was never started (C<undef>).
53 sub started { @_ <= 1 ? $_[0]->{started} : ($_[0]->{started} = $_[1] ? 1 : 0) }
57 Marks the component as started, and throws an exception if it was already.
58 Returns its self object.
65 $self->_croak(ref($self) . ' component already started') if $self->started;
73 Marks the component as stopped, and throws an exception if it wasn't started.
74 Returns its self object.
81 $self->_croak(ref($self) . ' component is not started') unless $self->started;
93 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
95 You can contact me by mail or on C<irc.perl.org> (vincent).
99 Please report any bugs or feature requests to C<bug-test-valgrind at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind>.
100 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
104 You can find documentation for this module with the perldoc command.
106 perldoc Test::Valgrind::Component
108 =head1 COPYRIGHT & LICENSE
110 Copyright 2009 Vincent Pit, all rights reserved.
112 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
116 1; # End of Test::Valgrind::Component