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
Astro::App::Satpass2::Macro(3) User Contributed Perl Documentation Astro::App::Satpass2::Macro(3)

Astro::App::Satpass2::Macro - Implement a macro

No user-serviceable parts inside.

This is an abstract class to implement macros.

This class supports the following public methods:

 my $macro = Astro::App::Satpass2::Macro->new( name => 'Foo' );

This static method returns a new macro object. The arguments are pairs of attribute names and values. An exception will be thrown if the object can not be constructed.

 print $macro->execute( $name, @args );

This method executes the named macro, passing it the given arguments. The results of the execution are returned.

This method must be overridden by the subclass.

 print $macro->generator( 'foo' );
 print $macro->generator();

If the "generate" attribute (q.v.) was not provided when the object was instantiated , this method fails.

If the "generate" attribute was provided when the object was instantiated and arguments were provided, this method validates that the arguments are all names of macros implemented by this object, failing if they are not. If the arguments are valid, it calls the code provided in the "generate" attribute with the invocant and the arguments.

If the "generate" attribute was provided when the object was instantiated and no arguments were provided, the code provided in the "generate" attribute is called with the invocant and the list of all macros implemented by the invocant in ASCIIbetical order.

 print map { "$_\n" } sort $macro->implements();
 $macro->implements( $name )
     and print "Implements $name\n";
 $macro->implements( $name, required => 1 );

This method has several overloads dealing with what macros this object implements.

If $name is omitted or "undef", it returns the names of all macros implemented by this object, in no particular order.

If $name is specified, it returns a true value if the object implements the named macro, and false otherwise. No commitment is made as to exactly what value is returned, and the caller is to regard this value as opaque.

After the $name argument, optional name/value pairs can be specified. The only one defined at the moment is "required", which causes an exception to be thrown if this object does not implement the named macro.

 $self->init();

This method performs initialization and checking of attributes. It should not be called by the user. Subclasses that override this method to add extra attributes should call $self->SUPER::init().

Nothing is returned.

 $macro->wail( 'Something bad happened' );

This convenience method simply delegates to the corresponding "Astro::App::Satpass2::Warner" method.

 $macro->wail( 'Something bad happened' );

This convenience method simply delegates to the corresponding "Astro::App::Satpass2::Warner" method.

 $macro->wail( 'Something bad happened' );

This convenience method simply delegates to the corresponding "Astro::App::Satpass2::Warner" method.

This class has the following attributes:

This attribute is optional, but if specified as something other than "undef" must be a code reference.

This code will be called by the "generator()" method after it has validated or defaulted the arguments, and whatever it returns will be returned by "generator()".

The idea is to provide a way to recover a macro definition, given that only the creator of the class knows what user-provided information it needs to perform this function. The return need not be the exact information originally provided, but it must be information that, if provided again, will generate the same macro. In the case of string data, this means that it may be quoted or escaped differently, but after the quotes and escapes are processed you must get the same string that you got by processing the quotes and escapes in the string originally provided. If the object implements more than one macro, it should be capable of returning the information on any one of them by itself.

This required attribute is the name of the object. It is returned by the "name()" method.

This required attribute is the "Astro::App::Satpass2" object that this object's "execute()" method is to operate on. It must be a subclass of "Astro::App::Satpass2". We actually hold a weak reference to this object, so it can be garbage-collected. It is returned by the "parent()" method.

This optional attribute is an "Astro::App::Satpass2::Warner" object used to report errors. If omitted, one will be generated. It is returned by the "warner()" method.

<<< replace or remove boilerplate >>>

Support is by the author. Please file bug reports at <https://rt.cpan.org/Public/Dist/Display.html?Name=Astro-App-Satpass2>, <https://github.com/trwyant/perl-Astro-App-Satpass2/issues>, or in electronic mail to the author.

Thomas R. Wyant, III wyant at cpan dot org

Copyright (C) 2013-2021 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

2021-11-04 perl v5.32.1

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

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