
Populating OpenType Variables for Encoding
When -tables option is used, open type fields are generated as Asn1Type fields. The general procedure to populate the value for these fields is as follows:
A complete example showing how to assign open type values when table constraint code is generated is as follows:
In the above example, the Invoke type contains a relative table constraint. Its element opcode refers to the ATTRIBUTE class's id field and the argument element refers to ATTRIBUTE class's Type field. The opcode element is the index element into the {SupportedAttributes} information object set. The argument element is an open type but its type must match that specified at the location in the {SupportedAttributes} information object set indexed by opcode.
In this example, opcode can have only two possible values { 0 1 1 } or { 0 1 2 }. If the opcode value is { 0 1 1} then argument must be a value of type VisibleString. If the opcode value is { 0 1 2 } then argument will have an INTEGER value. Any other value of the opcode element will be a violation of the Table Constraint.
If the SupportedAttributes object set was extensible (in this example, it is not), then the argument element can be a value of any type. In this case, if the user is using an index element value outside the object set, then the user will have to encode the argument element as an Asn1OpenType.
The important thing to note is that not much changes from the normal procedure. The only significant difference is that now the argument field can be directly populated with an instance of its target type. Without table constraint checking logic, this value would have to have been first encoded and then placed in an Asn1OpenType container object.
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |