
=head1 NAME

OODoc::Text::Subroutine - collects information about one documented sub


=head1 INHERITANCE

 OODoc::Text::Subroutine
   is an OODoc::Text
   is an OODoc::Object


=head1 SYNOPSIS



=head1 DESCRIPTION

Perl has various things we can call "sub" (for "subroutine") one
way or the other.  This object tries to store all types of them:
methods, funtion, ties, and overloads. Actually, these are the
most important parts of the documentation.  The share more than
they differ.


=head1 OVERLOADED


overload: B<'""' (stringification)>

=over 4

See L<OODoc::Text/"OVERLOADED">

=back

overload: B<'==' and '!='>

=over 4

See L<OODoc::Text/"OVERLOADED">

=back

overload: B<'cmp' (string comparison)>

=over 4

See L<OODoc::Text/"OVERLOADED">

=back


=head1 METHODS


=head2 Constructors


OODoc::Text::Subroutine-E<gt>B<new>(OPTIONS)

=over 4

-Option     --Defined in     --Default
 container    L<OODoc::Text>   <required>
 description  L<OODoc::Text>   C<''>
 linenr       L<OODoc::Text>   <required>
 name         L<OODoc::Text>   undef
 parameters                    undef
 type         L<OODoc::Text>   <required>

. container OBJECT

. description STRING

. linenr INTEGER

. name STRING

. parameters STRING

. type STRING

=back

=head2 Inheritance knowledge


$obj-E<gt>B<extends>([OBJECT])

=over 4

=back

=head2 Attributes


$obj-E<gt>B<container>([OBJECT])

=over 4

See L<OODoc::Text/"Attributes">

=back

$obj-E<gt>B<description>

=over 4

See L<OODoc::Text/"Attributes">

=back

$obj-E<gt>B<name>

=over 4

See L<OODoc::Text/"Attributes">

=back

$obj-E<gt>B<parameters>

=over 4

The parameter list for the subroutine is returned as string.  The
result may be C<undef> or empty.

=back

$obj-E<gt>B<type>

=over 4

See L<OODoc::Text/"Attributes">

=back

=head2 Location


$obj-E<gt>B<location>(MANUAL)

=over 4

Try to figure-out what the location for the subroutine is within the
MANUAL page.  Have a look at all levels of extension for this
sub-routine's documentation and decides the best enclosing
chapter, section and subsection.  Then return that object for the
current manual.

=back

$obj-E<gt>B<manual>([NAME])

=over 4

See L<OODoc::Text/"Location">

=back

$obj-E<gt>B<path>

=over 4

Returns the path of the text structure which contains this subroutine.

=back

$obj-E<gt>B<unique>

=over 4

See L<OODoc::Text/"Location">

=back

$obj-E<gt>B<where>

=over 4

See L<OODoc::Text/"Location">

=back

=head2 Collected


$obj-E<gt>B<collectedOptions>

=over 4

Returns a list of option-default combinations on this subroutine.

=back

$obj-E<gt>B<default>(NAME|OBJECT)

=over 4

In case of a NAME, a default object for this method is looked up.  This
does not search through super classes, but solely which is defined with
this subroutine.  When passed an OBJECT of type OODoc::Text::Default
that will be stored.

=back

$obj-E<gt>B<defaults>

=over 4

Returns a list of all defaults as defined by this documentation item in
one manual.

=back

$obj-E<gt>B<diagnostic>(OBJECT)

=over 4

Add a new diagnostic message (a OODoc::Text::Diagnostic object) to the
list already in this object.  You can not look for a message because
these names are without use.

=back

$obj-E<gt>B<diagnostics>

=over 4

Returns a list of all diagnostics.

=back

$obj-E<gt>B<example>(OBJECT)

=over 4

See L<OODoc::Text/"Collected">

=back

$obj-E<gt>B<examples>

=over 4

See L<OODoc::Text/"Collected">

=back

$obj-E<gt>B<findDescriptionObject>

=over 4

See L<OODoc::Text/"Collected">

=back

$obj-E<gt>B<findOption>(NAME)

=over 4

Does a little more thorough job than L<option()|OODoc::Text::Subroutine/"Collected"> bu searching the inherited
options for this subroutine as well.

=back

$obj-E<gt>B<openDescription>

=over 4

See L<OODoc::Text/"Collected">

=back

$obj-E<gt>B<option>(NAME|OBJECT)

=over 4

In case of a NAME, the option object for this method is looked up.  This
does not search through super classes, but solely which is defined with
this subroutine.  When passed an OBJECT of type OODoc::Text::Option
that will be stored.

=back

$obj-E<gt>B<options>

=over 4

Returns a list of all options as defined by this documentation item in
one manual.

=back

=head2 Commonly used functions


$obj-E<gt>B<filenameToPackage>(FILENAME)

OODoc::Text::Subroutine-E<gt>B<filenameToPackage>(FILENAME)

=over 4

See L<OODoc::Object/"Commonly used functions">

=back

$obj-E<gt>B<mkdirhier>(DIRECTORY)

OODoc::Text::Subroutine-E<gt>B<mkdirhier>(DIRECTORY)

=over 4

See L<OODoc::Object/"Commonly used functions">

=back

=head2 Manual Repository


$obj-E<gt>B<addManual>(MANUAL)

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<mainManual>(NAME)

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<manuals>

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<manualsForPackage>(NAME)

=over 4

See L<OODoc::Object/"Manual Repository">

=back

$obj-E<gt>B<packageNames>

=over 4

See L<OODoc::Object/"Manual Repository">

=back




=head1 DIAGNOSTICS

I<Error:> manual definition requires manual object

A call to L<addManual()|OODoc::Object/"Manual Repository"> expects a new manual object (a L<OODoc::Manual|OODoc::Manual>),
however an incompatible thing was passed.  Usually, intended was a call
to L<manualsForPackage()|OODoc::Object/"Manual Repository"> or L<mainManual()|OODoc::Object/"Manual Repository">.

I<Warning:> subroutine $name extended by different type:

Any description of a subroutine classifies it as method, tie, overload or
whatever.  Apparently, this indicated subroutine is defined being of a
different type on these both places, and there is an inheritance relation
between these places.

In very rare cases, this warning can be ignored, but usually these
situation is errorneous of confusing for the users of the library.

I<Warning:> subroutine $self location conflict: $here $super

The location of subroutine descriptions must be consistent over the
manual pages.  You may change the level of clearness about the
exact location (place in the chapter in one page, and in a subsection
in the next), as long as it is not conflicting (the subsection must
be a part of the chapter).






=head1 REFERENCES

See the OODoc website at L<http://perl.overmeer.net/oodoc/> for more details.

=head1 COPYRIGHTS

Module version 0.93.
Written by Mark Overmeer (mark@overmeer.net).  See the ChangeLog for
other contributors.

Copyright (c) 2003-2006 by the author(s). All rights reserved.  This program
is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.


