The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Egg::Component - Base class to treat Egg component.

SYNOPSIS

  package MyComponent;
  use strict;
  use base qw/ Egg::Component /;
  
  our @ISA;
  
  sub import {
     my $class= shift;
     $class->initialize;
     for (@_) {
         $class->isa_register(1, $_);
     }
     $class->isa_terminator;
     $class;
  }

DESCRIPTION

It is a base class to handle various components of the plug-in, the model, and the view, etc.

This module contains the class for the terminal corresponding to the hook call.

METHODS

initialize

It initializes it.

Namespace, config, and the regists method of the relation to the class that calls it by this method are generated.

namespace

The class name that calls initialize is returned.

config

The configuration that relates to the class that calls initialize is returned.

regists

It returns it with HASH to which the list of the component that relates to the class that calls initialize is generated by the ixhash method.

The value of HASH is ARRAY reference. The first element is a package name. The second element is a version of the package. The third element is a configuration. It becomes a structure.

isa_register ([LOAD_BOOL], [LABEL_STRING], [PACKAGE_STRING], [CONFIG_DATA])

It registers in @ISA that relates to the class that calls the component, and it registers in the component list by the regists method.

Require does PACKAGE_STRING at the same time as passing an effective value to LOAD_BOOL.

LABEL_STRING is a name of the key when registering in the regists method.

PACKAGE_STRING is a package name of the component module. It is assumed the one that the package name is specified for LABEL_STRING when omitting it.

When registering in regists, it preserves it in the third element when CONFIG_DATA is specified. It calls it in PACKAGE_STRING, and in addition, CONFIG_DATA is passed and called to the Japanese oak including the config method and the method.

isa_terminator

Egg::Component::Base is added to @ISA that relates to the class that calls the component.

If the terminal class has already been registered, nothing is done. Moreover, if the terminal class is not located at the end of @ISA, @ISA is adjusted.

This method assumes the thing called after a series of 'isa_register' method is processed. Please call this method and adjust @ISA when you call 'isa_register' again afterwards.

  for (@comps) {
      ............
      .....
      $class->isa_register( .... );
  }
  $class->isa_terminator;

add_register ([LOAD_BOOL], [LABEL_STRING], [PACKAGE_STRING], [CONFIG_DATA])

The operation of @ISA does all processing similar to the isa_register method excluding the thing not done.

ixhash ([HASH_DATA])

Tie::Hash::Indexed ¤Ë¤è¤ëHASH¤òÀ¸À®¤·¤Æ¡¢¤½¤ì¤òHASH¥ê¥Õ¥¡¥ì¥ó¥¹¤ÇÊÖ¤·¤Þ¤¹¡£

HASH defined to pass HASH_DATA is returned.

HASH_DATA is bad in the reference. It is made to pass with usual HASH.

  my $hash= $component->ixhash(
    hoge => 'booo',
    zooo => 'baaa',
    .....
    );

SEE ALSO

Egg::Release, Egg::Component::Base, UNIVERSAL::require, Class::C3, Tie::Hash::Indexed, Class::Data::Inheritable,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 180:

Non-ASCII character seen before =encoding in '¤Ë¤è¤ëHASH¤òÀ¸À®¤·¤Æ¡¢¤½¤ì¤òHASH¥ê¥Õ¥¡¥ì¥ó¥¹¤ÇÊÖ¤·¤Þ¤¹¡£'. Assuming CP1252