
Table Form Code Generation
Invoke ::= SEQUENCE { invoke ID INTEGER, opcode OPERATION.&operationCode ({My-ops}), argument OPERATION.&ArgumentType ({My-ops}{@opcode}) }The "{My-ops}" constraint on the opcode element specifies an information object set (not shown) that constrains the element value to one of the values in the object set. The {My-ops}{@opcode} constraint on the argument element goes a step further - it ties the type of the field to the type specified in the row that matches the given opcode value.
ASN1C generates an in-memory table for each of the items in the information object sets defined in a specification. In the example above, a table would be generated for the My-ops information object set. The code generated for the type would then use this table to verify that the given items in a structure that reference this table match the constraints.
public class Invoke : Asn1Type { public Asn1Integer invokeID; public OPERATION_operationCode opcode; public Asn1Type argument; ... }This is almost identical to the type generated in the simple case. The difference is that ASN1Type is used instead for the argument element instead of ASN1OpenType. This type is defined as the base class for all the generated ASN.1 types. It holds the value to be encoded or decoded. The way a user Would use this to encode a value of this type is as follows:
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 |