1 package Test::Valgrind::Component;
8 Test::Valgrind::Component - Base class for Test::Valgrind components.
16 our $VERSION = '1.13';
20 This class is the base for all others that act as components that can be started and stopped.
26 use base qw<Test::Valgrind::Carp>;
40 if (Scalar::Util::blessed($self)) {
42 if ($self->isa(__PACKAGE__)) {
43 $self->{started} = undef;
53 =head2 C<started [ $bool ]>
55 Specifies whether the component is running (C<1>), stopped (C<0>) or was never started (C<undef>).
59 sub started { @_ <= 1 ? $_[0]->{started} : ($_[0]->{started} = $_[1] ? 1 : 0) }
63 Marks the component as started, and throws an exception if it was already.
64 Returns its self object.
71 $self->_croak(ref($self) . ' component already started') if $self->started;
79 Marks the component as stopped, and throws an exception if it wasn't started.
80 Returns its self object.
87 $self->_croak(ref($self) . ' component is not started') unless $self->started;
99 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
101 You can contact me by mail or on C<irc.perl.org> (vincent).
105 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>.
106 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
110 You can find documentation for this module with the perldoc command.
112 perldoc Test::Valgrind::Component
114 =head1 COPYRIGHT & LICENSE
116 Copyright 2009,2010,2011 Vincent Pit, all rights reserved.
118 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
122 1; # End of Test::Valgrind::Component