.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SNMP::Info::MRO 3pm" .TH SNMP::Info::MRO 3pm "2019-02-25" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SNMP::Info::MRO \- Method resolution introspection for SNMP::Info .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use SNMP::Info::MRO; \& use Data::Printer; \& \& p SNMP::Info::MRO::all_methods(\*(AqSNMP::Info::Layer3::Juniper\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a set of helpers to show where a given method in SNMP::Info has been implemented, and which implementation is being used at runtime. .PP The following distributions are \fIrequired\fR to run this code: .IP "\(bu" 4 \&\s-1PPI\s0 .IP "\(bu" 4 Class::ISA .IP "\(bu" 4 Module::Info .IP "\(bu" 4 Module::Load .SH "FUNCTIONS" .IX Header "FUNCTIONS" None of the functions are exported. For all helper functions, you can pass either the name of a Perl module, or an object instance of SNMP::Info. .ie n .IP "all_methods( $module )" 4 .el .IP "all_methods( \f(CW$module\fR )" 4 .IX Item "all_methods( $module )" Returns the location of methods defined in \f(CW$module\fR and all its ancestor classes (superclasses), either as Perl subroutines or via \f(CW%GLOBALS\fR or \f(CW%FUNCS\fR configuration. The data structure looks like: .Sp .Vb 10 \& { \& method_name => { \& globals => [ \& [ Package::Name => \*(Aqmib_leaf.0\*(Aq ], \& [ Other::Package::Name => \*(Aq1.3.6.1.4.1.9.2.1.58.0\*(Aq ], \& ], \& }, \& other_method_name => [ \& subs => [ \& \*(AqPackage::Name\*(Aq, \& ], \& funcs => [ \& [ Package::Name => \*(Aqmib_leaf_name\*(Aq ], \& ], \& ], \& } .Ve .Sp It should be noted that the order of method resolution in SNMP::Info is to first look for a defined subroutine (this is done by Perl), then the \&\s-1AUTOLOAD\s0 sequence will search for a definition in \f(CW%GLOBALS\fR followed by \&\f(CW%FUNCS\fR. .Sp The defining class or module at runtime is always the first entry in the list, if it exists: .Sp .Vb 2 \& $data\->{method_name}\->{subs}\->[0] \& if exists $data\->{method_name}\->{subs}; .Ve .ie n .IP "subroutines( $module )" 4 .el .IP "subroutines( \f(CW$module\fR )" 4 .IX Item "subroutines( $module )" Returns the set of subroutines defined in \f(CW$module\fR and all its ancestor classes (superclasses). The data structure looks like: .Sp .Vb 9 \& { \& method_name => [ \& \*(AqPackage::Name\*(Aq, \& \*(AqOther::Package::Name\*(Aq, \& ], \& other_method_name => [ \& \*(AqPackage::Name\*(Aq, \& ], \& } .Ve .Sp Should a subroutine have been defined more than once, the defining classes are listed in reverse order, such that the definition used at runtime is always: .Sp .Vb 1 \& $data\->{method_name}\->[0]; .Ve .ie n .IP "globals( $module || $object )" 4 .el .IP "globals( \f(CW$module\fR || \f(CW$object\fR )" 4 .IX Item "globals( $module || $object )" Returns a data structure showing how SNMP::Info will resolve \s-1MIB\s0 Leaf Nodes configured through the \f(CW%GLOBALS\fR hashes in \f(CW$module\fR. .Sp The data structure looks like: .Sp .Vb 9 \& { \& method_name => [ \& [ Package::Name => \*(Aqmib_leaf_name\*(Aq ], \& [ Other::Package::Name => \*(Aq1.3.6.1.4.1.9.2.1.58.0\*(Aq ], \& ], \& other_method_name => [ \& [ Package::Name => \*(Aqmib_leaf.0\*(Aq ], \& ], \& } .Ve .Sp Where a method has been defined in different packages, then they are listed in reverse order, such that the mapping used by SNMP::Info is always: .Sp .Vb 1 \& $data\->{method_name}\->[0]; .Ve .ie n .IP "funcs( $module || $object )" 4 .el .IP "funcs( \f(CW$module\fR || \f(CW$object\fR )" 4 .IX Item "funcs( $module || $object )" Returns a data structure showing how SNMP::Info will resolve \s-1MIB\s0 Tables configured through the \f(CW%FUNCS\fR hashes in \f(CW$module\fR. .Sp See \*(L"\s-1GLOBALS\*(R"\s0 in SNMP::Info::Layer3 for further detail. .ie n .IP "munge( $module || $object )" 4 .el .IP "munge( \f(CW$module\fR || \f(CW$object\fR )" 4 .IX Item "munge( $module || $object )" Returns a data structure showing the subroutines used for munging returned values for any method defined in \f(CW%FUNCS\fR or \f(CW%GLOBALS\fR. .Sp The data structure looks like: .Sp .Vb 9 \& { \& method_name => [ \& [ Package::Name => \*(Aq&subroutine\*(Aq ], \& [ Other::Package::Name => \*(Aq&Other::Package::subroutine\*(Aq ], \& ], \& other_method_name => [ \& [ Package::Name => \*(Aq&subroutine\*(Aq ], \& ], \& } .Ve .Sp Where a mapping has been defined in different packages, then they are listed in reverse order, such that the munge subroutine used by SNMP::Info is always: .Sp .Vb 1 \& $data\->{method_name}\->[0]; .Ve .ie n .IP "file( $module )" 4 .el .IP "file( \f(CW$module\fR )" 4 .IX Item "file( $module )" Returns the filename from which Perl will load the given module. .ie n .IP "superclasses( $class || $object )" 4 .el .IP "superclasses( \f(CW$class\fR || \f(CW$object\fR )" 4 .IX Item "superclasses( $class || $object )" Returns the list (in order) of the names of classes Perl will search to find methods for this SNMP::Info class or object instance. .Sp Note this \fBrequires\fR the distribution to be installed. .ie n .IP "print_globals( $module || $object )" 4 .el .IP "print_globals( \f(CW$module\fR || \f(CW$object\fR )" 4 .IX Item "print_globals( $module || $object )" Pretty print the output of \f(CW\*(C`globals()\*(C'\fR. .ie n .IP "print_funcs( $module || $object )" 4 .el .IP "print_funcs( \f(CW$module\fR || \f(CW$object\fR )" 4 .IX Item "print_funcs( $module || $object )" Pretty print the output of \f(CW\*(C`funcs()\*(C'\fR. .ie n .IP "print_munge( $module || $object )" 4 .el .IP "print_munge( \f(CW$module\fR || \f(CW$object\fR )" 4 .IX Item "print_munge( $module || $object )" Pretty print the output of \f(CW\*(C`munge()\*(C'\fR. .ie n .IP "print_superclasses( $class || $object )" 4 .el .IP "print_superclasses( \f(CW$class\fR || \f(CW$object\fR )" 4 .IX Item "print_superclasses( $class || $object )" Pretty print the output of \f(CW\*(C`superclasses()\*(C'\fR. .SH "AUTHOR" .IX Header "AUTHOR" Oliver Gorwits .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2014 by The SNMP::Info Project. .PP .Vb 10 \& # Redistribution and use in source and binary forms, with or without \& # modification, are permitted provided that the following conditions are met: \& # \& # * Redistributions of source code must retain the above copyright notice, \& # this list of conditions and the following disclaimer. \& # * Redistributions in binary form must reproduce the above copyright \& # notice, this list of conditions and the following disclaimer in the \& # documentation and/or other materials provided with the distribution. \& # * Neither the name of the University of California, Santa Cruz nor the \& # names of its contributors may be used to endorse or promote products \& # derived from this software without specific prior written permission. \& # \& # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" \& # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE \& # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \& # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE \& # LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \& # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \& # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \& # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN \& # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \& # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \& # POSSIBILITY OF SUCH DAMAGE. .Ve