System.ConvUtils.TConvTypeProcs

From RAD Studio API Documentation
Jump to: navigation, search

System.ConvUtils.TConvTypeInfoSystem.TObjectTConvTypeProcs

Delphi

TConvTypeProcs = class(TConvTypeInfo)

C++

class PASCALIMPLEMENTATION TConvTypeProcs : public TConvTypeInfo

Properties

Type Visibility Source Unit Parent
class public
System.ConvUtils.pas
System.ConvUtils.hpp
System.ConvUtils System.ConvUtils

Description

TConvTypeProcs describes a single registered conversion type (measurement unit) that is registered by supplying conversion methods.

The global RegisterConversionType function creates a TConvTypeProcs instance automatically when you register a conversion type by supplying functions to convert between the that type and the base units in its conversion family. TConvTypeProcs implements the FromCommon and ToCommon methods to perform their conversions by using the functions supplied to its constructor.

There is no need to use TConvTypeProcs directly. To register a conversion type that uses custom conversion functions, call RegisterConversionType using the syntax that supplies two conversion functions.

You can, however, use TConvTypeProcs as a base class when implementing your own conversion type that performs addition common actions before or after the custom conversion procedure. For example, you could write a class that always rounds the result to a specified number of decimal places after a conversion is computed using the supplied functions.

See Also