GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CLASS::MOP::OVERLOAD (3)

.ds Aq ’

NAME

Class::MOP::Overload - Overload Meta Object

CONTENTS

VERSION

version 2.1605

SYNOPSIS



    my $meta     = Class->meta;
    my $overload = $meta->get_overloaded_operator(+);

    if ( $overload->has_method_name ) {
        print Method for + is , $overload->method_name, "\n";
    }
    else {
        print Overloading for + is implemented by ,
            $overload->coderef_name, " sub\n";
    }



DESCRIPTION

This class provides meta information for overloading in classes and roles.

INHERITANCE

Class::MOP::Overload is a subclass of Class::MOP::Object.

METHODS

    Class::MOP::Overload->new(%options)

This method creates a new Class::MOP::Overload object. It accepts a number of options:
o operator

This is a string that matches an operator known by the overload module, such as "" or +. This is required.

o method_name

The name of the method which implements the overloading. Note that this does not need to actually correspond to a real method, since it’s okay to declare a not-yet-implemented overloading.

Either this or the coderef option must be passed.

o method

A Class::MOP::Method object for the method which implements the overloading.

This is optional.

o coderef

A coderef which implements the overloading.

Either this or the method_name option must be passed.

o coderef_package

The package where the coderef was defined.

This is required if coderef is passed.

o coderef_name

The name of the coderef. This can be __ANON__.

This is required if coderef is passed.

o associated_metaclass

A Class::MOP::Module object for the associated class or role.

This is optional.

CW$overload->operator

Returns the operator for this overload object.

CW$overload->method_name

Returns the method name that implements overloading, if it has one.

CW$overload->has_method_name

Returns true if the object has a method name.

CW$overload->method

Returns the Class::MOP::Method that implements overloading, if it has one.

CW$overload->has_method

Returns true if the object has a method.

CW$overload->coderef

Returns the coderef that implements overloading, if it has one.

CW$overload->has_coderef

Returns true if the object has a coderef.

CW$overload->coderef_package

Returns the package for the coderef that implements overloading, if it has one.

CW$overload->has_coderef

Returns true if the object has a coderef package.

CW$overload->coderef_name

Returns the sub name for the coderef that implements overloading, if it has one.

CW$overload->has_coderef_name

Returns true if the object has a coderef name.

CW$overload->is_anonymous

Returns true if the overloading is implemented by an anonymous coderef.

CW$overload->associated_metaclass

Returns the Class::MOP::Module (class or role) that is associated with the overload object.

CW$overload->clone

Clones the overloading object, setting original_overload in the process.

CW$overload->original_overload

For cloned objects, this returns the Class::MOP::Overload object from which they were cloned. This can be used to determine the source of an overloading in a class that came from a role, for example.

AUTHORS

o Stevan Little <stevan.little@iinteractive.com>
o Dave Rolsky <autarch@urth.org>
o Jesse Luehrs <doy@tozt.net>
o Shawn M Moore <code@sartak.org>
o XXXX XXXXX (Yuval Kogman) <nothingmuch@woobling.org>
o Karen Etheridge <ether@cpan.org>
o Florian Ragwitz <rafl@debian.org>
o Hans Dieter Pearcey <hdp@weftsoar.net>
o Chris Prather <chris@prather.org>
o Matt S Trout <mst@shadowcat.co.uk>

COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CLASS::MOP::OVERLOAD (3) 2016-02-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.