| 1 | package POE::Declare::Meta::Slot; | ||
| 2 | |||
| 3 | =pod | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | POE::Declare::Meta::Slot - Abstract base class for named class elements | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | In L<POE::Declare>, each class is a simple controlled structure with a set | ||
| 12 | of named elements within it, known as "slots". | ||
| 13 | |||
| 14 | Each slot uniquely occupies a name (just like in a HASH) except that in the | ||
| 15 | L<POE::Declare> model, that name is reserved across all resources (the | ||
| 16 | method name, the HASH key, and in some cases certain method names below the | ||
| 17 | root name as well). | ||
| 18 | |||
| 19 | For example, a slot named "foo" of type C<Param> will consume the HASH key | ||
| 20 | "foo", have an accessor method "foo", and take a "foo" parameter in the | ||
| 21 | object constructor. | ||
| 22 | |||
| 23 | A slot named "mytimeout" filled with a C<Timeout> will consume the | ||
| 24 | "mytimeout" HASH key, and may have methods such as C<mytimeout_alarm>, | ||
| 25 | C<mytimeout_keepalive> and C<mytimeout_clear>. | ||
| 26 | |||
| 27 | =head1 METHODS | ||
| 28 | |||
| 29 | =head2 new | ||
| 30 | |||
| 31 | # You cannot create a Slot directly | ||
| 32 | my $object = POE::Declare::Meta::Attribute->new( | ||
| 33 | name => 'foo', | ||
| 34 | ); | ||
| 35 | |||
| 36 | The default slot constructor takes a list of named parameters, and creates | ||
| 37 | a C<HASH>-based object using them. The default implementation does not | ||
| 38 | check its parameters, as it expects them to be provided by other functions | ||
| 39 | which themselves will have already checked params. | ||
| 40 | |||
| 41 | =cut | ||
| 42 | |||
| 43 | 5 | ▶ | use 5.008007; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 45 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 46 | |||
| 47 | 5 | ▶ | use vars qw{$VERSION}; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 48 | 5 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 49 | 5 | $VERSION = '0.59'; | |
| 50 | } | ||
| 51 | |||
| 52 | 5 | ▶ | use Class::XSAccessor { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 53 | 5 | constructor => 'new', | |
| 54 | getters => { | ||
| 55 | name => 'name', | ||
| 56 | }, | ||
| 57 | 5 | }; | |
| 58 | |||
| 59 | # By default, a slot contains nothing | ||
| 60 | 17 | ▶ | sub as_perl { '' } |
|
Subroutine
as_perl: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 61 | |||
| 62 | 5 | 1; | |
| 63 | |||
| 64 | =pod | ||
| 65 | |||
| 66 | =head1 SUPPORT | ||
| 67 | |||
| 68 | Bugs should be always be reported via the CPAN bug tracker at | ||
| 69 | |||
| 70 | L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Declare> | ||
| 71 | |||
| 72 | For other issues, or commercial enhancement or support, contact the author. | ||
| 73 | |||
| 74 | =head1 AUTHORS | ||
| 75 | |||
| 76 | Adam Kennedy E<lt>adamk@cpan.orgE<gt> | ||
| 77 | |||
| 78 | =head1 SEE ALSO | ||
| 79 | |||
| 80 | L<POE>, L<POE::Declare> | ||
| 81 | |||
| 82 | =head1 COPYRIGHT | ||
| 83 | |||
| 84 | Copyright 2006 - 2012 Adam Kennedy. | ||
| 85 | |||
| 86 | This program is free software; you can redistribute | ||
| 87 | it and/or modify it under the same terms as Perl itself. | ||
| 88 | |||
| 89 | The full text of the license can be found in the | ||
| 90 | LICENSE file included with this module. | ||
| 91 | |||
| 92 | =cut | ||