Class SelectiveClassCoding

Summary


 An implementation of {ClassCoding}.  The subclass
 must override the method {get_template()} to return a list of
 pairs.  The first element of each pair is an arbitrary string used
 to identify the field; the second element is the name of the field.

 @example
 @   # This will save the three fields {increment_size}, {value} and {is_range_flag}.
 @   method get_template()
 @      return  [
 @          ["Increment Size", "increment_size"],
 @          ["Value", "value"],
 @          ["Is Range Flag", "is_range_flag"]]
 @   end

 The programmer may change the name of the field afterwards; for example {value} may
 be re-named {initial_value}, and the data would still be restored correctly.

 Alternatively, any of the pairs may be a string field name, in which the label
 is the field name itself.  This does not permit the field name to change without
 rendering the encoded string invalid.

Superclasses:
ClassCoding

Package:
lang
File:
selectiveclasscoding.icn
Methods:
decode_obj, encode_obj, load_map, load_template

Methods inherited from ClassCoding:
post_decode, pre_encode

Source code.

Details
Constructor

SelectiveClassCoding()

Methods:

decode_obj(e)


encode_obj(e)


load_map()


 Get the map for this class, using caching for efficiency.

 @p


load_template()


 Get the template for this class, using caching for efficiency.

 @p



This page produced by UniDoc on 2021/04/15 @ 23:59:54.