403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/man/man3/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/man/man3/Class::IntrospectionMethods.3pm
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
.\"
.\" 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 turned on, 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
.\" ========================================================================
.\"
.IX Title "IntrospectionMethods 3"
.TH IntrospectionMethods 3 "2004-12-13" "perl v5.22.0" "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"
Class::IntrospectionMethods \- creates methods with introspection
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\&  use Class::IntrospectionMethods qw/make_methods/;
\&
\&  make_methods 
\&    (
\&      parent,
\&      global_catalog => 
\&        {
\&           name => \*(Aqmetacat\*(Aq,
\&           list => 
\&             [
\&                [qw/foo/]     => f_cat,
\&                [qw/bar baz/] => b_cat,
\&             ],
\&        }
\&      new_with_init => \*(Aqnew\*(Aq,
\&      get_set       => [ qw /foo bar baz / ];
\&    ) ;
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This module provides:
.IP "\(bu" 4
A way to set up a lot of get/set method. These get/set methods can
access plain scalars, array, hash. These scalar, hash or array can be
tied (See perltie) with classes specified by the user. The element
of these arrays or hashes can be constrained to be object, tied
scalar.
.IP "\(bu" 4
A way to later query the object or class to retrieve the list of
methods (aka slots) created by this module.
.IP "\(bu" 4
A way to organize these slots in several catalogs.
.IP "\(bu" 4
When a slot contains object or tied scalars hashes or arrays, the
contained object can be queried for the container object.
In other words, the parent object (the one constructed by
\&\f(CW\*(C`Class::IntrospectionMethods\*(C'\fR contains a child object in one of its
slots either as a plain object or an object hidden behind a tied
construct. \f(CW\*(C`Class::IntrospectionMethods\*(C'\fR will provide the child
object a method to retrieve the parent object reference.
.PP
For instance, you can use this module to create a tree where each node
or leaf is an object. In this case, this module provides methods to
navigate up the tree of objects with the installed \*(L"parent\*(R" method.
.PP
In other words, this module provides special methods to enable the
user to navigate up or down a tree (or directed graph) using
introspection (to go down) and the \*(L"parent\*(R" method to go up.
.PP
You may notice similarities between this module and
Class::MethodMaker. In fact this module was written from
Class::MethodMaker v1.08, but it does not provide most of the fancy
methods of Class::MethodMaker. Only scalar, array and hash
accessors (with their tied and objects variants) are provided.
.PP
Originally, the introspection and \*(L"parent\*(R" functionalities were
implemented in Class::MethodMaker. Unfortunately, they were not
accepted by Class::MethodMaker's author since they did not fit his
own vision of his module (fair enough).
.PP
The old \s-1API\s0 of Class::MethodMaker is provided as deprecated
methods. Using the new (and hopefully more consistent) \s-1API\s0 is
prefered.
.SH "Transition from Class::MethodMaker"
.IX Header "Transition from Class::MethodMaker"
This module was forked from Class::MethodMaker v1.08. To ease
migration from older project (which include a proprietary project of
mine) using Class::MethodMaker to Class::IntrospectionMethods, a
compatiblity mode is provided. (although some features of
Class::MethodMaker will not work. See
Class::IntrospectionMethods::Legacy for details)
.PP
You can use the following function to finely tune the compatibility
behavior to either croak, carp (See Carp for details) or be silent.
.PP
One note: I provide backward compatibility for Class::MethodMaker
v1.08 and the modification I made that were later refused. So you may
notice compatibility features that do not exist in Class::MethodMaker
v1.08.
.SS "set_obsolete_behavior ( behavior, provide_legacy_method)"
.IX Subsection "set_obsolete_behavior ( behavior, provide_legacy_method)"
\&\f(CW\*(C`behavior\*(C'\fR is either \f(CW\*(C`skip\*(C'\fR, \f(CW\*(C`carp\*(C'\fR or \f(CW\*(C`croak\*(C'\fR. (default is
\&\f(CW\*(C`carp\*(C'\fR).
.PP
\&\f(CW\*(C`provide_legacy_method\*(C'\fR is either 1 or 0. Default 0. When set to one,
this module will provide methods that were only available in the
modified version of Class::MethodMaker v1.08.
.SH "CLASS INTROSPECTION"
.IX Header "CLASS INTROSPECTION"
Class::IntrospectionMethods provides a set of features that enable you
to query the available methods of a class. These methods can be
invoked as class methods or object methods. From now on, a class
created with Class::IntrospectionMethods will be called a CIMed class.
.PP
The top-down introspection is triggered by the \f(CW\*(C`global_catalog\*(C'\fR
option.
.SS "slot query: the global_catalog option"
.IX Subsection "slot query: the global_catalog option"
When set, the \f(CW\*(C`global_catalog\*(C'\fR will invoke the
\&\*(L"set_global_catalog\*(R" in Class::IntrospectionMethods::Catalog
function. This function will use the parameters you passed to the
\&\f(CW\*(C`global_catalog\*(C'\fR option to install a new method in your class. E.g.,
this \f(CW\*(C`global_catalog\*(C'\fR option:
.PP
.Vb 2
\& package Foo::Bar ;
\& use Class::IntrospectionMethods qw/make_methods/;
\&
\& make_methods
\&  (
\&    global_catalog => 
\&     {
\&      name => \*(Aqmetacat\*(Aq,
\&      list => [
\&               [qw/foo bar baz/]                 => foo_cat,
\&               [qw/a b z/]                       => alpha_cat,
\&              ],
\&     },
\&  )
.Ve
.PP
will enable you to call:
.PP
.Vb 3
\&  &Foo::Bar::metacat\->all_catalog ; # return alpha_cat foo_cat
\&  my $obj = Foo::Bar\-> new;
\&  $obj \-> metacat\->all_catalog ; # also return alpha_cat foo_cat
.Ve
.PP
See Class::IntrospectionMethods::Catalog for:
.IP "\(bu" 4
The other informations you can retrieve through the global catalog.
.IP "\(bu" 4
How to move a slot from one catalog to another at run-time (only the
object catalog can be modified)
.IP "\(bu" 4
The distinction between the class catalog and the object catalog
.PP
Note that IntrospectionMethods does not check whether the method
declared in global_catalog are actually created by
IntrospectionMethods or created elsewhere.
.SS "From slot to object: the parent option."
.IX Subsection "From slot to object: the parent option."
If you use tied scalars (with the \f(CW\*(C`tie_scalar\*(C'\fR or \f(CW\*(C`hash\*(C'\fR method
types), or object method type, your tied scalars or objects may need
to call the parent CIMed object.
.PP
For instance, if you want to implement error handling in your tied
scalar or objects that will call the parent CIMed object or display
error messages giving back to the user the slot name containing the
faulty object.
.PP
So if you need to query the slot name, or index value (for \f(CW\*(C`hash\*(C'\fR or
\&\f(CW\*(C`array\*(C'\fR method types), or be able to call the parent object, you can
use the \f(CW\*(C`parent\*(C'\fR option when creating the parent CIMed class:
.PP
.Vb 4
\& package FOO ;
\& use Class::IntrospectionMethods
\&   \*(Aqparent\*(Aq ,
\&   object => [ foo => \*(AqMy::Class\*(Aq ];
.Ve
.PP
Using this option will graft \fIone\fR attribute and its accessor
method. Be default, this attribute and accessor method will be named
\&\f(CW\*(C`cim_parent\*(C'\fR, but this can be changed with \f(CW\*(C`set_parent_method_name\*(C'\fR.
.PP
This attribute contains (and the accessor method will return) a
\&\f(CW\*(C`Class::IntrospectionMethods::ParentInfo\*(C'\fR object. This object
features methods \f(CW\*(C`index_value\*(C'\fR, \f(CW\*(C`slot_name\*(C'\fR and \f(CW\*(C`parent\*(C'\fR.
See \*(L"ParentInfo class\*(R" in Class::IntrospectionMethods::Parent for
more details.
.ie n .IP """CMM_PARENT""" 4
.el .IP "\f(CWCMM_PARENT\fR" 4
.IX Item "CMM_PARENT"
Reference of the parent object.
.ie n .IP """CMM_SLOT_NAME""" 4
.el .IP "\f(CWCMM_SLOT_NAME\fR" 4
.IX Item "CMM_SLOT_NAME"
slot name to use to get the child object from the parent.
.ie n .IP """CMM_INDEX_VALUE""" 4
.el .IP "\f(CWCMM_INDEX_VALUE\fR" 4
.IX Item "CMM_INDEX_VALUE"
index value (for \f(CW\*(C`tie_tie_hash\*(C'\fR method type) to use to get the child
object from the parent.
.PP
When using the \f(CW\*(C`\-parent\*(C'\fR option, a \f(CW\*(C`CMM_PARENT\*(C'\fR, \f(CW\*(C`CMM_SLOT_NAME\*(C'\fR
and \f(CW\*(C`CMM_INDEX_VALUE\*(C'\fR methods are also grafted to the child's
class.
.PP
Here is an example to retrieve a parent object :
.PP
.Vb 12
\& package FOO ;
\& use ExtUtils::testlib;
\&  \*(Aq\-parent\*(Aq ,
\&  object_tie_hash =>
\&  [
\&   {
\&    slot => \*(Aqbar\*(Aq,
\&    tie_hash => [\*(AqMyHash\*(Aq],
\&    class => [\*(AqMyObj\*(Aq, \*(Aqa\*(Aq => \*(Aqfoo\*(Aq]
\&   }
\&  ],
\&  new => \*(Aqnew\*(Aq;
\&
\& package main;
\&
\& my $o = new X;
\&
\& my $obj = $o\->a(\*(Aqfoo\*(Aq) ;
\& my $p= $obj\->metadad\->parent; # $p is $o
.Ve
.PP
See \*(L"\s-1EXAMPLE\*(R"\s0 in Class::IntrospectionMethods::Parent for further
details
.SH "SUPPORTED METHOD TYPES"
.IX Header "SUPPORTED METHOD TYPES"
.SS "new"
.IX Subsection "new"
Creates a basic constructor.
.PP
Takes a single string or a reference to an array of strings as its
argument.  For each string creates a simple method that creates and
returns an object of the appropriate class.
.PP
This method may be called as a class method, as usual, or as in instance
method, in which case a new object of the same class as the instance
will be created.
.SS "new_with_init"
.IX Subsection "new_with_init"
Creates a basic constructor which calls a method named \f(CW\*(C`init\*(C'\fR after
instantiating the object. The \f(CW\*(C`init\*(C'\fR method should be defined in the
class using IntrospectionMethods.
.PP
Takes a single string or a reference to an array of strings as its
argument.  For each string creates a simple method that creates an
object of the appropriate class, calls \f(CW\*(C`init\*(C'\fR on that object
propagating all arguments, before returning the object.
.PP
This method may be called as a class method, as usual, or as in instance
method, in which case a new object of the same class as the instance
will be created.
.SS "new_with_args"
.IX Subsection "new_with_args"
Creates a basic constructor.
.PP
Takes a single string or a reference to an array of strings as its
argument.  For each string creates a simple method that creates and
returns an object of the appropriate class.
.PP
This method may be called as a class method, as usual, or as in instance
method, in which case a new object of the same class as the instance
will be created.
.PP
Constructor arguments will be stored as a key, value pairs in the
object. No check is done regarding the consistencies of the data
passed to the constructor and the accessor methods created.
.SS "get_set"
.IX Subsection "get_set"
Takes a single string or a reference to an array of strings as its
argument.  Each string specifies a slot, for which accessor methods are
created. E.g.
.PP
.Vb 2
\&  get_set => \*(Aqfoo\*(Aq,
\&  get_set => [qw/foo bar/],
.Ve
.PP
The accessor methods are, by default:
.IP "x" 4
.IX Item "x"
If an argument is provided, sets a new value for x.  This is true even
if the argument is undef (cf. no argument, which does not set.)
.Sp
Returns (new) value.
.Sp
Value defaults to undef.
.IP "clear_x" 4
.IX Item "clear_x"
Sets value to undef.  This is exactly equivalent to
.Sp
.Vb 1
\&  $foo\->x (undef)
.Ve
.Sp
No return.
.PP
This is your basic get/set method, and can be used for slots
containing any scalar value, including references to non-scalar
data. Note, however, that IntrospectionMethods has meta-methods that
define more useful sets of methods for slots containing references to
lists, hashes, and objects.
.SS "object"
.IX Subsection "object"
Creates methods for accessing a slot that contains an object of a given
class.
.PP
.Vb 9
\&   object => [
\&              phooey => { class => \*(AqFoo\*(Aq },
\&               [ qw / bar1 bar2 bar3 / ] => { class => \*(AqBar\*(Aq},
\&              foo => { class => \*(AqBaz\*(Aq
\&                       constructor_args => [ set => \*(Aqit\*(Aq ]},
\&              [qw/dog fox/] => { class => \*(AqFob\*(Aq,
\&                       constructor_args => [ sound => \*(Aqbark\*(Aq ] },
\&              cat => { class => \*(AqFob\*(Aq,
\&                       constructor_args => [ sound => \*(Aqmiaow\*(Aq ]}
\&
\&              tiger => { class => \*(AqSpecial\*(Aq,
\&                         init => \*(Aqmy_init\*(Aq # method to call after creation 
\&                       }
\&             ]
.Ve
.PP
The main argument is an array reference. The array should contain a
set of \f(CW\*(C`slot_name => hash_ref\*(C'\fR pairs. \f(CW\*(C`slot_name\*(C'\fR can be an
array ref if you want to specify several slots the same way.
.PP
The hash ref sub-arguments are parsed thus:
.IP "class" 4
.IX Item "class"
The class name of the stored object.
.IP "constructor_args" 4
.IX Item "constructor_args"
A array ref containing arguments that are passed to the \f(CW\*(C`new\*(C'\fR
constructor.
.IP "init_method" 4
.IX Item "init_method"
Name of a initialisation method to call on the newly created object.
The method name defaults to \f(CW\*(C`cim_init\*(C'\fR. In other words if the user
class feature a \f(CW\*(C`cim_init\*(C'\fR method, this one will be called after
creation of the object.
.PP
For each slot \f(CW\*(C`x\*(C'\fR, the following methods are created:
.IP "x" 4
.IX Item "x"
A get/set method.
.Sp
If supplied with an object of an appropriate type, will set set the slot
to that value.
.Sp
Else, if the slot has no value, then an object is created by calling
\&\f(CW\*(C`new\*(C'\fR on the appropriate class, passing in any supplied
arguments. These arguments may supersede the arguments passed with the
\&\f(CW\*(C`constructor_args\*(C'\fR parameters (See above).
.Sp
The stored object is then returned.
.IP "delete_x" 4
.IX Item "delete_x"
Will destroy the object held by \f(CW\*(C`x\*(C'\fR.
.IP "defined_x" 4
.IX Item "defined_x"
Will return true if \f(CW\*(C`x\*(C'\fR contains an object. False otherwise.
.SS "tie_scalar"
.IX Subsection "tie_scalar"
Create a get/set method to deal with the tied scalar.
.PP
Takes a list of pairs, where the first is the name of the slot (or an
array ref containing a list of slots), the second is an array
reference.  The array reference takes the usual tie parameters.
.PP
For instance if Enum and Boolean are tied scalar that accept default values,
you can have:
.PP
.Vb 7
\&  tie_scalar =>
\&  [
\&   foo => [ \*(AqEnum\*(Aq,   enum => [qw/A B C/], default => \*(AqB\*(Aq ],
\&   bar => [ \*(AqEnum\*(Aq,   enum => [qw/T0 T1/], default => \*(AqT1\*(Aq],
\&   baz => [\*(AqBoolean\*(Aq, default => 0],
\&   [qw/lots of slots/] => [\*(AqBoolean\*(Aq, default => 1],
\&  ],
.Ve
.PP
Foreach slot \f(CW\*(C`xx\*(C'\fR, tie_scalar install the following methods:
.IP "tied_storage_xx" 4
.IX Item "tied_storage_xx"
Return the object tied behind the scalar. Auto-vivify if necessary.
.SS "hash"
.IX Subsection "hash"
Creates a group of methods for dealing with hash data stored in a
slot.
.PP
.Vb 5
\& hash =>
\&  [
\&    \*(Aqplain_hash1\*(Aq, \*(Aqplain_hash2\*(Aq,
\&    [qw/lot of plain hashes/] ,
\&    yet_another_plain_hash => {} ,
\&
\&    my_tied_hash => {tied_hash => \*(AqMy_Tie_Hash\*(Aq },
\&    my_tied_hash_with_args => 
\&      { tied_hash => [ \*(AqMy_Tie_Hash\*(Aq , @my_args ] },
\&
\&    my_hash_with_tied_storage => { tie_storage => \*(AqMyTieScalar\*(Aq },
\&    [qw/likewise_with_args likewise_with_other_args/] =>
\&      { tie_storage => [ \*(AqMyTieScalar\*(Aq, @my_args] }
\&
\&    my_tied_hash_with_tied_storage =>
\&      { tied_hash => \*(AqMy_Tie_Hash\*(Aq,tie_storage => \*(AqMyTieScalar\*(Aq },
\&
\&    my_hash_with_object => { class_storage => \*(AqMyClass\*(Aq },
\&    my_hash_with_object_and_constructor_args =>
\&      { class_storage => [ \*(AqMyClass\*(Aq , @my_args ] }, 
\&
\&  ]
.Ve
.PP
The \f(CW\*(C`hash\*(C'\fR parameters are:
.IP "\(bu" 4
A string or a a reference to an array of strings. For each
of these string, a hash based slot is created.
.IP "\(bu" 4
A hash ref who contains attributes attached to the slot(s) defined by
the previous arguments. These attribute are used to specify the
behavior of the hash attached to the slot or to specialize the hash
values. See Tie::Hash::CustomStorage for details on the possibles
attributes.
.PP
For each slot defined, creates:
.IP "x" 4
.IX Item "x"
Called with no arguments returns the hash stored in the slot, as a hash
in a list context or as a reference in a scalar context.
.Sp
Called with one simple scalar argument it treats the argument as a key
and returns the value stored under that key.
.Sp
Called with more than one argument, treats them as a series of key/value
pairs and adds them to the hash.
.IP "x_keys or x_index" 4
.IX Item "x_keys or x_index"
Returns the keys of the hash.
.IP "x_values" 4
.IX Item "x_values"
Returns the list of values.
.IP "x_exists" 4
.IX Item "x_exists"
Takes a single key, returns whether that key exists in the hash.
.IP "x_delete" 4
.IX Item "x_delete"
Takes a list, deletes each key from the hash.
.IP "x_clear" 4
.IX Item "x_clear"
Resets hash to empty.
.SS "array"
.IX Subsection "array"
Creates several methods for dealing with slots containing array data.
.PP
.Vb 5
\& array =>
\&  [
\&    \*(Aqplain_array1\*(Aq, \*(Aqplain_array2\*(Aq,
\&    [qw/lot of plain arrayes/] ,
\&    yet_another_plain_array => {} ,
\&
\&    my_tied_array => {tied_array => \*(AqMy_Tie_Array\*(Aq },
\&    my_tied_array_with_args => 
\&      { tied_array => [ \*(AqMy_Tie_Array\*(Aq , @my_args ] },
\&
\&    my_array_with_tied_storage => { tie_storage => \*(AqMyTieScalar\*(Aq },
\&    [qw/likewise_with_args likewise_with_other_args/] =>
\&      { tie_storage => [ \*(AqMyTieScalar\*(Aq, @my_args] }
\&
\&    my_tied_array_with_tied_storage =>
\&      { tied_array => \*(AqMy_Tie_Array\*(Aq,tie_storage => \*(AqMyTieScalar\*(Aq },
\&
\&    my_array_with_object => { class_storage => \*(AqMyClass\*(Aq },
\&    my_array_with_object_and_constructor_args =>
\&      { class_storage => [ \*(AqMyClass\*(Aq , @my_args ] }, 
\&
\&  ]
.Ve
.PP
The \f(CW\*(C`array\*(C'\fR parameters are:
.IP "\(bu" 4
A string or a a reference to an array of strings. For each
of these string, a array based slot is created.
.IP "\(bu" 4
A array ref who contains attributes attached to the slot(s) defined by
the previous arguments. These attribute are used to specify the
behavior of the array attached to the slot or to specialize the array
values. See Tie::Array::CustomStorage for details on the possible
attributes.
.PP
For each slot defined, creates:
.IP "x" 4
.IX Item "x"
This method returns the list of values stored in the slot. In an array
context it returns them as an array and in a scalar context as a
reference to the array.  If any arguments are provided to this method,
they \fIreplace\fR the current list contents.
.IP "x_push" 4
.IX Item "x_push"
.PD 0
.IP "x_pop" 4
.IX Item "x_pop"
.IP "x_shift" 4
.IX Item "x_shift"
.IP "x_unshift" 4
.IX Item "x_unshift"
.IP "x_splice" 4
.IX Item "x_splice"
.IP "x_clear" 4
.IX Item "x_clear"
.IP "x_count" 4
.IX Item "x_count"
.PD
Returns the number of elements in x.
.IP "x_index" 4
.IX Item "x_index"
Takes a list of indices, returns a list of the corresponding values.
.IP "x_set" 4
.IX Item "x_set"
Takes a list, treated as pairs of index => value; each given index is
set to the corresponding value.  No return.
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.SS "Creating an object tree"
.IX Subsection "Creating an object tree"
You can simply create an object with Class::IntrospectionMethods using
a CIMed class in an \f(CW\*(C`object*\*(C'\fR method. For instance, if you want to
create a model of a school clas and their students, you can write:
.PP
.Vb 1
\& Package School_class;
\&
\& use Class::IntrospectionMethods  
\&   get_set => \*(Aqgrade\*(Aq, 
\&   hash => 
\&    [ 
\&     student => { class_storage => \*(AqStudent\*(Aq}
\&    ],
\&   new => \*(Aqnew\*(Aq ;
.Ve
.PP
And here is the declaration of the Student class that is used in the
\&\f(CW\*(C`School_class\*(C'\fR declararion :
.PP
.Vb 4
\& Package Student ;
\& use Class::IntrospectionMethods  
\&  get_set => \*(Aqage\*(Aq,
\&  new => \*(Aqnew\*(Aq ;
.Ve
.PP
Now you can use these lines to get and set the student attributes:
.PP
.Vb 3
\& my $son_class = School_class\->new ;
\& $son_class\->grade(\*(Aqfirst\*(Aq) ;
\& $son_class\->student(\*(AqGinger\*(Aq)\->age(22) ;
\&
\& my $ginger = $son_class\->student(\*(AqGinger\*(Aq) ;
\& print $ginger\->age ;
.Ve
.SH "BUGS"
.IX Header "BUGS"

.SH "REPORTING BUGS"
.IX Header "REPORTING BUGS"
Email the author.
.SH "THANKS"
.IX Header "THANKS"
To Martyn J. Pearce for \f(CW\*(C`Class::MethodMaker\*(C'\fR and the enlightening
discussion we had a while ago about parent and catalog.
.PP
To Matthew Simon Cavalletto for the parameter translation idea that I
pilfered from \f(CW\*(C`Class::MakeMethods\*(C'\fR.
.SH "AUTHOR"
.IX Header "AUTHOR"
Current Maintainer: Dominique Dumont domi@komarr.grenoble.hp.com
.PP
Original Authors: Martyn J. Pearce fluffy@cpan.org, Peter Seibel (Organic Online)
.PP
Contributions from:
.PP
.Vb 3
\&  Evolution Online Systems, Inc. http://www.evolution.com
\&  Matthew Persico
\&  Yitzchak Scott\-Thoennes
.Ve
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
.Vb 3
\&    Copyright (c) 2004 Dominique Dumont.  This program is free
\&    software; you can redistribute it and/or modify it under the same terms as
\&    Perl itself.
\&
\&    Copyright (c) 2002, 2001, 2000 Martyn J. Pearce.  This program is free
\&    software; you can redistribute it and/or modify it under the same terms as
\&    Perl itself.
\&
\&    Copyright 1998, 1999, 2000 Evolution Online Systems, Inc.  You may use
\&    this software for free under the terms of the MIT License.  More info
\&    posted at http://www.evolution.com, or contact info@evolution.com
\&
\&    Copyright (c) 1996 Organic Online. All rights reserved. This program is
\&    free software; you can redistribute it and/or modify it under the same
\&    terms as Perl itself.
.Ve
.SH "SEE ALSO"
.IX Header "SEE ALSO"
.Vb 5
\&  C<Class::Struct>, C<Class::MakeMethods>, C<Class::MethodMaker>,
\&  "Object\-Oriented Perl" by Damian
\&  Conway. C<Tie::Hash::CustomStorage>, C<Tie::Array::CustomStorage>,
\&  C<Class::IntrospectionMethods::Parent>,
\&  C<Class::IntrospectionMethods::Catalog>
.Ve

Youez - 2016 - github.com/yon3zu
LinuXploit