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
Physics::Unit::Scalar::Implementation(3) User Contributed Perl Documentation Physics::Unit::Scalar::Implementation(3)

Physics::Unit::Scalar::Implementation - This page discusses implementation issues of the Physics/Unit/Scalar.pm module.

Classes and objects derived from Physics::Unit::Scalar follow these rules:
  • All objects of a particular class that derives from Physics::Unit::Scalar define their values relative to the same Physics::Unit object, and thus have the same dimensionality and scale. Thus, for example, all objects of type Physics::Unit::Distance use the Unit object "meter". Objects of type Physics::Unit::Acceleration use the Unit object "meter / sec^2".
  • Objects of the Physics::Unit::Scalar class (and not a derived class) each have their own Physics::Unit object to describe the quantity.

InitSubtypes()
This is called during compilation, and creates classes for each of the unit types defined in Physics::Unit.
MyUnit($arg)
Returns a reference to the Unit object that is used to define the quantity. $arg can either be a class name or an object that derives from Physics::Unit::Scalar.
GetMyUnit($class)
Get the class' MyUnit.
GetDefaultUnit($class)
Get the class' DefaultUnit.
ScalarResolve($hash)
This takes an unblessed reference to a hash as an argument. The hash should have a value member and a MyUnit member.

This determines the proper type of Scalar that the object should be (based on MyUnit's type), 'normalizes' the Scalar, blesses it into the proper subtype, and returns it.

This is used by ScalarFactory and several of the arithmetic functions (whenever the arithmetic function actually changes the dimensionality of the unit, and thus the type of scalar).

2022-04-09 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.