register_parser


Description:

public static void register_parser (Type type, VariantType vtype, SerializableParseFunc parse_func)

Register a parser that can convert Variant data into an instance of a given Type.

Note that you can register more than one parser for the same Type provided that you give them different variant type signatures.

If there is already a parser registered for the given type and vtype it will be silently replaced.

The recommended behaviour is that Object classes register their parsers in their respective class init functions.

Parameters:

type

The Type of the object class to register a parser for

vtype

Variants to be converted must have this signature

parse_func

A function to convert Variant data into an instance of the given type .